lib/maven/tools/dsl/dependency_dsl.rb in maven-tools-1.0.5 vs lib/maven/tools/dsl/dependency_dsl.rb in maven-tools-1.0.6
- old
+ new
@@ -27,12 +27,18 @@
extend Options
include Models
class << self
def create( parent, type, scope, *args, &block )
- a = DependencyDSL.from( type, *args, &block )
- a.scope = scope if scope
-
+ if type
+ a = DependencyDSL.from( type, *args, &block )
+ a.scope = scope if scope
+ else
+ scope = args.shift
+ args += [nil, nil, { :scope => scope } ][ (args.size - 4 )..2 ]
+ a = DependencyDSL.new( *args )
+ end
+
options = process_exclusions( a.model, a.dup )
a.instance_eval &block if block
fill_options( a.model, options, :type )
parent.dependencies << a.model
a