lib/ivy4r.rb in ivy4r-0.9.7 vs lib/ivy4r.rb in ivy4r-0.9.9
- old
+ new
@@ -33,11 +33,11 @@
{:dir => 'target/p1', :includes => 'buildfile'}
]
}
=end
class Ivy4r
- VERSION = '0.9.7'
+ VERSION = '0.9.9'
# Set the ant home directory to load ant classes from if no custom __antwrap__ is provided
# and the default provided ant version 1.7.1 should not be used.
# Must be set before any call to method that uses the ivy is made.
attr_accessor :ant_home
@@ -162,11 +162,11 @@
# Used to get or set ant properties.
# [set] <tt>property['name'] = value</tt> sets the ant property with name to given value no overwrite
# [get] <tt>property[matcher]</tt> gets property that is equal via case equality operator (<tt>===</tt>)
def property
- AntPropertyHelper.new(ant_properties)
+ AntPropertyHelper.new(ant, ant_properties)
end
# Returns the __antwrap__ instance to use for all internal calls creates a default
# instance if no instance has been set before.
def ant
@@ -220,14 +220,15 @@
def ant_properties
ant.project.properties
end
end
-AntPropertyHelper = Struct.new(:ant_properties) do #:nodoc:
+AntPropertyHelper = Struct.new(:ant, :ant_properties) do #:nodoc:
def []=(name, value) #:nodoc:
- ant_properties[name] = value
+ ant.property :name => name, :value => value
end
def [](matcher) #:nodoc:
- ant_properties.find {|p| matcher === p[0] }[1]
+ property = ant_properties.find {|p| matcher === p[0] }
+ property ? property[1] : nil
end
end