Class | Hash |
In: |
lib/buildr/core/util.rb
(CVS)
|
Parent: | Object |
Returns a hash from a string in the Java properties file format. For example:
str = 'foo=bar\nbaz=fab' Hash.from_properties(str) => { 'foo'=>'bar', 'baz'=>'fab' }.to_properties
Returns a new hash without the specified keys.
For example:
{ :a=>1, :b=>2, :c=>3, :d=>4 }.except(:a, :c) => { :b=>2, :d=>4 }
Returns a new hash with only the specified keys.
For example:
{ :a=>1, :b=>2, :c=>3, :d=>4 }.only(:a, :c) => { :a=>1, :c=>3 }
Convert hash to string format used for Java properties file. For example:
{ 'foo'=>'bar', 'baz'=>'fab' }.to_properties => foo=bar baz=fab