Class: Maven::Tools::DSL::ExclusionDSL
- Inherits:
-
Object
- Object
- Maven::Tools::DSL::ExclusionDSL
- Extended by:
- Options
- Includes:
- Models
- Defined in:
- lib/maven/tools/dsl/exclusions_dsl.rb
Class Method Summary collapse
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize ⇒ ExclusionDSL
constructor
A new instance of ExclusionDSL.
- #to_coordinate ⇒ Object
Methods included from Options
args_and_options, fill_options, help_block
Methods included from Models
#method_missing, #model, #respond_to?
Constructor Details
#initialize ⇒ ExclusionDSL
Returns a new instance of ExclusionDSL.
78 79 80 |
# File 'lib/maven/tools/dsl/exclusions_dsl.rb', line 78 def initialize @model = Exclusion.new end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Maven::Tools::DSL::Models
Class Method Details
.create(dep, *args, &block) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/maven/tools/dsl/exclusions_dsl.rb', line 63 def self.create( dep, *args, &block ) args, = ( *args ) e = ExclusionDSL.new case args.size when 1 e.group_id, e.artifact_id = args[0].split( /:/ ) when 2 e.group_id, e.artifact_id = *args end e.instance_eval( &block ) if block ( e, || {} ) dep.exclusions << e.model e end |
Instance Method Details
#help ⇒ Object
82 83 84 85 86 87 |
# File 'lib/maven/tools/dsl/exclusions_dsl.rb', line 82 def help warn self.class.help( 'exclusion', :group_id, :artifact_id ) + <<EOS argument: exclusion 'group_id:artifact_id' arguments: exclusion 'group_id','artifact_id' EOS end |
#to_coordinate ⇒ Object
89 90 91 |
# File 'lib/maven/tools/dsl/exclusions_dsl.rb', line 89 def to_coordinate "#{@model.group_id}:#{@model.artifact_id}" end |