$ String camelize snake_case_example another_snake_case_example
The output is:
SnakeCaseExample
AnotherSnakeCaseExample
#!/usr/bin/env ruby if ARGV.size > 1 then gem 'activesupport' require 'active_support/core_ext/string/inflections' class String include ActiveSupport::CoreExtensions::String::Inflections end command = ARGV.shift ARGV.each { |argument| puts argument.send( command ) } else # Print usage information puts "Usage: #{File.basename( __FILE__ )} <command> <argument_1> [<argument_2> ...]" end
{bash} $ ./String camelize blah_blah
./String:4: undefined method `gem' for main:Object (NoMethodError)