RubyGems.org

applix

0.3.8

ApplixHash#from_argv builds hashes from ARGV like argument vectors \ according to following examples: '-f' --> { :f => true } '--flag' --> { :flag => true } '--flag:false' \ --> { :flag => false } '--flag=false' --> { :flag => 'false' } '--option=value' --> { :option => "value" } '--int=1' \ --> { :int => "1" } '--float=2.3' --> { :float \ => "2.3" } '--float:2.3' --> { :float => 2.3 } '--txt="foo bar"' --> { :txt => "foo bar" } '--txt:'"foo bar"'' --> { :txt => "foo bar" } '--txt:%w{foo bar}' --> { :txt => ["foo", "bar"] } '--now:Time.now' --> { :now => #<Date: 3588595/2,0,2299161> } remaining arguments(non flag/options) are inserted as [:arguments, \ args], eg: Hash.from_argv %w(--foo --bar=loo 123 now) becomes \ { :foo => true, :bar => 'loo', :arguments => ["123", "now"] } \

installgem install applix
Authors

dirk luesebrink

2,339 total downloads 168 for this version
Owners

Eccad02bf8d4e74ebeed807022d38a9b

Bundler
gem "applix", "~> 0.3.8"
Versions
  1. 0.3.8 August 28, 2011
  2. 0.3.7 August 21, 2011
  3. 0.3.6 August 16, 2011
  4. 0.3.5 August 15, 2011
  5. 0.3.4 August 15, 2011
Show all versions (9 total)