Place in your Gemfile and run bundle
gem "ruby_extensions", git: "[email protected]:gristmill/ruby_extensions.git" # , tag: 'v0.3.0'
# Hash a string
"password".to_sha1
# => "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8"
# Extract email addresses from a string
"Hello [email protected], how are you?".to_email
# => ["[email protected]"]
# Turn a string into a url friendly slug
"hello world how are you today?".to_slug
# => "hello-world-how-are-you-today"
At least for now...
ruby -Itest test/string.rb