class Nexus::Gav
Attributes
artifact[RW]
attributes[RW]
classifier[RW]
extension[RW]
gav_value[R]
group[RW]
repo[RW]
sha1[RW]
version[RW]
Public Class Methods
new(gav_string)
click to toggle source
# 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
Public Instance Methods
dir_location()
click to toggle source
returns a directory location given the gav ie. /org/glassfish/main/external/ant/
# File lib/nexus_client/gav.rb, line 30 def dir_location File.join(group.gsub('.', '/'), artifact) end
filename()
click to toggle source
# 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()
click to toggle source
# 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()
click to toggle source
# File lib/nexus_client/gav.rb, line 13 def to_s gav_value end
Private Instance Methods
err()
click to toggle source
# File lib/nexus_client/gav.rb, line 39 def err 'Must provide gav_str in the form of "<group>:<artifact>:<version>:<repo>:<classifier>:<extension>"' end
gav_match()
click to toggle source
# File lib/nexus_client/gav.rb, line 35 def gav_match /([\w\.\-]+:[\w\.\-]+:[\.\w\-]+:[\w\.\-]*:[\w\.\-]*:[\w\.\-]*)/ end