lib/maven/tools/dsl.rb in maven-tools-1.0.7 vs lib/maven/tools/dsl.rb in maven-tools-1.0.8
- old
+ new
@@ -32,9 +32,16 @@
@context = nil
@model = nil
result
end
+ def use( plugin, version = nil, &block )
+ Kernel.gem( plugin.to_s, version ) if version
+ require plugin.to_s
+ const = plugin.to_s.split( /_/ ).collect{ |a| a.capitalize }.join
+ Object.const_get( const ).send( :maven, self, &block )
+ end
+
def maven( val = nil, &block )
if @context == nil
tesla( &block )
else
@current.maven = val