Class: Maven::Tools::DSL::ExclusionsDSL

Inherits:
Array
  • Object
show all
Extended by:
Options
Defined in:
lib/maven/tools/dsl/exclusions_dsl.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Options

args_and_options, fill_options, help_block

Constructor Details

#initialize(dep) ⇒ ExclusionsDSL

Returns a new instance of ExclusionsDSL.



37
38
39
# File 'lib/maven/tools/dsl/exclusions_dsl.rb', line 37

def initialize( dep )
  @dep = dep
end

Class Method Details

.create(dep, *args, &block) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/maven/tools/dsl/exclusions_dsl.rb', line 28

def self.create( dep, *args, &block )
  a = ExclusionsDSL.new( dep )
  args.each do |arg|
    a << ExclusionDSL.create( dep, *arg )
  end
  a.instance_eval( &block ) if block
  a
end

Instance Method Details

#exclusion(*args, &block) ⇒ Object



48
49
50
# File 'lib/maven/tools/dsl/exclusions_dsl.rb', line 48

def exclusion( *args, &block )
  self << ExclusionDSL.create( @dep, *args, &block )
end

#helpObject



41
42
43
44
45
46
# File 'lib/maven/tools/dsl/exclusions_dsl.rb', line 41

def help
  warn self.class.help( 'exclusions', :exclusion => nil ) + <<EOS
arguments: exclusions 'group_id:artifact_id1', 'group_id:artifact_id2'
arguments: exclusions ['group_id','artifact_id1'], ['group_id','artifact_id2']
EOS
end

#to_coordinate_arrayObject



52
53
54
55
56
# File 'lib/maven/tools/dsl/exclusions_dsl.rb', line 52

def to_coordinate_array
  self.collect do |a|
    a.to_coordinate
  end
end