def encrypt(key=$key) e = OpenSSL::Cipher::Cipher.new 'DES-EDE3-CBC' e.encrypt key s = e.update self s << e.final s = s.unpack('H*').upcase s end
def decrypt(key=$key) e = OpenSSL::Cipher::Cipher.new 'DES-EDE3-CBC' e.decrypt key s = self.to_a.pack("H*").unpack("C*").pack("c*") s = e.update s s << e.final end end puts "raveendran".encrypt("password") puts "509067DC2076497134DBF9A7DE5992B2".decrypt("password")
You can chnage the $key vlaue.
You can encrypt the string with password. The password should match when trying to decrypt the encrypted string.
Heroku is the instant ruby platform. Deploy any ruby app instantly with a simple and familiar git push. Take advantage of advanced features like HTTP caching, memcached, rack middleware, and instant scaling built into every app. Never think about hosting or servers again.
Heroku is a multi-tenant platform and hosting environment. Your app doesn’t need its own servers, slices, or clusters, and you’ll benefit from continuous platform improvements.
Each element in this diagram represents a large pool of servers invisibly managed by Heroku. Because we control all the infrastructure and software layers, we can present a clean interface for deploying your code.
We actively curate each layer, ensuring you have the latest in software and best practices, and that it’s all stable and integrated smoothly.
Everything You Need
Together, these elements provide everything you need to run a modern, high-performance, scalable web app. Click around to understand the path of a request through the system.
Hydra is a distributed testing framework. It allows you to distribute your tests locally across multiple cores and processors, as well as run your tests remotely over SSH.
Hydra’s goals are to make distributed testing easy. So as long as you can ssh into a computer and run the tests, you can automate the distribution with Hydra.
Installing Hydra is easy, just install the gem:
gem install hydra
OR Download the gem file from http://gemcutter.org and install it
Setting up Hydra
To set up Hydra, you need to edit your project’s Rakefile and add this code:
# require the hydra codebase
# require the hydra rake task helpers
Adding Cucumber Files
# set up a new hydra testing task named 'hydra:cucumber' run with "rake hydra:cucumber"
Hydra::TestTask.new('hydra:cucumber') do |t|
# add all files in the features directory that end with ".feature"
Adding Test::Unit Files
# set up a new hydra testing task named 'hydra:units' run with "rake hydra:units"
Hydra::TestTask.new('hydra:units') do |t|
# add all files in the test/unit directory recursively that
# end with "_test.rb"
# and test/functional
# and test/integration
Adding RSpec Files
# set up a new hydra testing task named 'hydra:spec' run with "rake hydra:spec"
Hydra::TestTask.new('hydra:spec') do |t|
# you may or may not need this, depending on how you require
# spec_helper in your test files:
# add all files in the spec directory that end with "_spec.rb"