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
20 21 22 |
# File 'lib/jars/lock.rb', line 20 def artifact_id self[1] end |
#classifier ⇒ Object
28 29 30 31 32 |
# File 'lib/jars/lock.rb', line 28 def classifier return nil if size == 5 self[2] end |
#file ⇒ Object
11 12 13 14 |
# File 'lib/jars/lock.rb', line 11 def file file = self[-1].strip file.empty? ? path : file end |
#gacv ⇒ Object
34 35 36 |
# File 'lib/jars/lock.rb', line 34 def gacv classifier ? self[0..3] : self[0..2] end |
#group_id ⇒ Object
16 17 18 |
# File 'lib/jars/lock.rb', line 16 def group_id self[0] end |
#path ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/jars/lock.rb', line 38 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..].join('-')}.jar") end end |
#scope ⇒ Object
7 8 9 |
# File 'lib/jars/lock.rb', line 7 def scope self[-2].to_sym end |
#version ⇒ Object
24 25 26 |
# File 'lib/jars/lock.rb', line 24 def version self[-3] end |