Class: Nexus::Gav
- Inherits:
-
Object
- Object
- Nexus::Gav
- Defined in:
- lib/nexus_client/gav.rb
Instance Attribute Summary collapse
-
#artifact ⇒ Object
Returns the value of attribute artifact.
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#classifier ⇒ Object
Returns the value of attribute classifier.
-
#extension ⇒ Object
Returns the value of attribute extension.
-
#gav_value ⇒ Object
readonly
Returns the value of attribute gav_value.
-
#group ⇒ Object
Returns the value of attribute group.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#sha1 ⇒ Object
Returns the value of attribute sha1.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#dir_location ⇒ Object
returns a directory location given the gav ie.
- #filename ⇒ Object
-
#initialize(gav_string) ⇒ Gav
constructor
A new instance of Gav.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(gav_string) ⇒ Gav
Returns a new instance of Gav.
6 7 8 9 10 11 |
# File 'lib/nexus_client/gav.rb', line 6 def initialize(gav_string) raise(err) if gav_match.match(gav_string).nil? @group,@artifact,@version,@repo,@classifier,@extension = gav_string.split(":") @gav_value = gav_string @attributes = {} end |
Instance Attribute Details
#artifact ⇒ Object
Returns the value of attribute artifact.
3 4 5 |
# File 'lib/nexus_client/gav.rb', line 3 def artifact @artifact end |
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/nexus_client/gav.rb', line 3 def attributes @attributes end |
#classifier ⇒ Object
Returns the value of attribute classifier.
3 4 5 |
# File 'lib/nexus_client/gav.rb', line 3 def classifier @classifier end |
#extension ⇒ Object
Returns the value of attribute extension.
3 4 5 |
# File 'lib/nexus_client/gav.rb', line 3 def extension @extension end |
#gav_value ⇒ Object (readonly)
Returns the value of attribute gav_value.
4 5 6 |
# File 'lib/nexus_client/gav.rb', line 4 def gav_value @gav_value end |
#group ⇒ Object
Returns the value of attribute group.
3 4 5 |
# File 'lib/nexus_client/gav.rb', line 3 def group @group end |
#repo ⇒ Object
Returns the value of attribute repo.
3 4 5 |
# File 'lib/nexus_client/gav.rb', line 3 def repo @repo end |
#sha1 ⇒ Object
Returns the value of attribute sha1.
3 4 5 |
# File 'lib/nexus_client/gav.rb', line 3 def sha1 @sha1 end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/nexus_client/gav.rb', line 3 def version @version end |
Instance Method Details
#dir_location ⇒ Object
returns a directory location given the gav ie. /org/glassfish/main/external/ant/
30 31 32 |
# File 'lib/nexus_client/gav.rb', line 30 def dir_location File.join(group.gsub('.', '/'), artifact) end |
#filename ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/nexus_client/gav.rb', line 17 def filename if classifier.empty? "#{artifact}-#{version}.#{extension}" else "#{artifact}-#{version}-#{classifier}.#{extension}" end end |
#to_hash ⇒ Object
25 26 27 |
# File 'lib/nexus_client/gav.rb', line 25 def to_hash {:g => group, :a => artifact, :v => version, :r => repo, :c => classifier, :e => extension} end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/nexus_client/gav.rb', line 13 def to_s gav_value end |