Class: NexusCli::Artifact
- Inherits:
-
Object
- Object
- NexusCli::Artifact
- Defined in:
- lib/nexus_cli/artifact.rb
Instance Attribute Summary collapse
-
#artifact_id ⇒ Object
readonly
Returns the value of attribute artifact_id.
-
#classifier ⇒ Object
readonly
Returns the value of attribute classifier.
-
#extension ⇒ Object
readonly
Returns the value of attribute extension.
-
#group_id ⇒ Object
readonly
Returns the value of attribute group_id.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #file_name ⇒ Object
-
#initialize(coordinates) ⇒ Array<String>
constructor
Constructs an artifact object from Maven co-ordinates See maven.apache.org/pom.html#Maven_coordinatess for more information on maven coordinatess.
Constructor Details
#initialize(coordinates) ⇒ Array<String>
Constructs an artifact object from Maven co-ordinates See maven.apache.org/pom.html#Maven_coordinatess for more information on maven coordinatess
13 14 15 |
# File 'lib/nexus_cli/artifact.rb', line 13 def initialize(coordinates) @group_id, @artifact_id, @extension, @classifier, @version = parse_coordinates(coordinates) end |
Instance Attribute Details
#artifact_id ⇒ Object (readonly)
Returns the value of attribute artifact_id.
3 4 5 |
# File 'lib/nexus_cli/artifact.rb', line 3 def artifact_id @artifact_id end |
#classifier ⇒ Object (readonly)
Returns the value of attribute classifier.
3 4 5 |
# File 'lib/nexus_cli/artifact.rb', line 3 def classifier @classifier end |
#extension ⇒ Object (readonly)
Returns the value of attribute extension.
3 4 5 |
# File 'lib/nexus_cli/artifact.rb', line 3 def extension @extension end |
#group_id ⇒ Object (readonly)
Returns the value of attribute group_id.
3 4 5 |
# File 'lib/nexus_cli/artifact.rb', line 3 def group_id @group_id end |
#version ⇒ Object
Returns the value of attribute version.
4 5 6 |
# File 'lib/nexus_cli/artifact.rb', line 4 def version @version end |
Instance Method Details
#file_name ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/nexus_cli/artifact.rb', line 17 def file_name if classifier.nil? "#{artifact_id}-#{version}.#{extension}" else "#{artifact_id}-#{version}-#{classifier}.#{extension}" end end |