Creating a Ruby service using the dRuby module to be called within a Rails application

To simplify things, lets fabricate a use case scenario;

Imagine that you have to control a password’s strength when the user is registering a new account. The controlling of the password is done using a password list file obtained from https://wiki.skullsecurity.org/index.php?title=Passwords. I’m using the best available one according to the site, which is rockyou.txt.bz2.

To use the list, I have extracted the list and copied it to /usr/share/wordlists/. Once that is done, the shell command ”grep” can easily be used;

The command will check if the password ”hacker” exists or not in the file. And to use the same command in our ruby applications, we can construct a class like this one.

And to make things look like beautiful, We write an dRuby runner class as this one;

To bootstrap and run, we will do so;

Now the server part is up and running. To test our client, we can do so;

The client part can be implemented in your rails application as well!