Class: Pushwagner::Maven::Artifact
- Inherits:
-
Object
- Object
- Pushwagner::Maven::Artifact
- Defined in:
- lib/pushwagner/maven.rb
Instance Attribute Summary collapse
-
#artifact_id ⇒ Object
readonly
Returns the value of attribute artifact_id.
-
#group_id ⇒ Object
readonly
Returns the value of attribute group_id.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #base_path ⇒ Object
-
#initialize(artifact_id, group_id, version) ⇒ Artifact
constructor
A new instance of Artifact.
- #jar_name ⇒ Object
- #jar_path ⇒ Object
- #snapshot? ⇒ Boolean
Constructor Details
#initialize(artifact_id, group_id, version) ⇒ Artifact
Returns a new instance of Artifact.
38 39 40 41 42 |
# File 'lib/pushwagner/maven.rb', line 38 def initialize(artifact_id, group_id, version) @artifact_id = artifact_id @group_id = group_id @version = version end |
Instance Attribute Details
#artifact_id ⇒ Object (readonly)
Returns the value of attribute artifact_id.
36 37 38 |
# File 'lib/pushwagner/maven.rb', line 36 def artifact_id @artifact_id end |
#group_id ⇒ Object (readonly)
Returns the value of attribute group_id.
36 37 38 |
# File 'lib/pushwagner/maven.rb', line 36 def group_id @group_id end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
36 37 38 |
# File 'lib/pushwagner/maven.rb', line 36 def version @version end |
Instance Method Details
#base_path ⇒ Object
44 45 46 |
# File 'lib/pushwagner/maven.rb', line 44 def base_path "#{group_id.gsub('.', '/')}/#{artifact_id.gsub('.', '/')}/#{version}" end |
#jar_name ⇒ Object
48 49 50 |
# File 'lib/pushwagner/maven.rb', line 48 def jar_name "#{artifact_id}-#{version}.jar" end |
#jar_path ⇒ Object
52 53 54 |
# File 'lib/pushwagner/maven.rb', line 52 def jar_path "#{base_path}/#{jar_name}" end |
#snapshot? ⇒ Boolean
56 57 58 |
# File 'lib/pushwagner/maven.rb', line 56 def snapshot? version.downcase =~ /snapshot/ end |