Class: Jars::JarDetails
- Inherits:
-
Array
- Object
- Array
- Jars::JarDetails
- Defined in:
- lib/jars/lock.rb
Instance Method Summary collapse
- #artifact_id ⇒ Object
- #classifier ⇒ Object
- #file ⇒ Object
- #gacv ⇒ Object
- #group_id ⇒ Object
- #path ⇒ Object
- #scope ⇒ Object
- #version ⇒ Object
Instance Method Details
#artifact_id ⇒ Object
18 19 20 |
# File 'lib/jars/lock.rb', line 18 def artifact_id self[1] end |
#classifier ⇒ Object
26 27 28 |
# File 'lib/jars/lock.rb', line 26 def classifier size == 5 ? nil : self[2] end |
#file ⇒ Object
9 10 11 12 |
# File 'lib/jars/lock.rb', line 9 def file file = self[-1].strip file.empty? ? path : file end |
#gacv ⇒ Object
30 31 32 |
# File 'lib/jars/lock.rb', line 30 def gacv classifier ? self[0..3] : self[0..2] end |
#group_id ⇒ Object
14 15 16 |
# File 'lib/jars/lock.rb', line 14 def group_id self[0] end |
#path ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/jars/lock.rb', line 34 def path if scope == :system # replace maven like system properties embedded into the string self[-1].gsub(/\$\{[a-zA-Z.]+\}/) do |a| ENV_JAVA[a[2..-2]] || a end else File.join(Jars.home, group_id.gsub(/[.]/, '/'), artifact_id, version, gacv[1..-1].join('-') + '.jar') end end |
#scope ⇒ Object
5 6 7 |
# File 'lib/jars/lock.rb', line 5 def scope self[-2].to_sym end |
#version ⇒ Object
22 23 24 |
# File 'lib/jars/lock.rb', line 22 def version self[-3] end |