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
permalink #artifact_id ⇒ Object
[View source]
19 20 21 |
# File 'lib/jars/lock.rb', line 19 def artifact_id self[ 1 ] end |
permalink #classifier ⇒ Object
[View source]
27 28 29 |
# File 'lib/jars/lock.rb', line 27 def classifier size == 5 ? nil : self[ 2 ] end |
permalink #file ⇒ Object
[View source]
10 11 12 13 |
# File 'lib/jars/lock.rb', line 10 def file file = self[ -1 ].strip file.empty? ? path : file end |
permalink #gacv ⇒ Object
[View source]
31 32 33 |
# File 'lib/jars/lock.rb', line 31 def gacv classifier ? self[ 0..3 ] : self[ 0..2 ] end |
permalink #group_id ⇒ Object
[View source]
15 16 17 |
# File 'lib/jars/lock.rb', line 15 def group_id self[ 0 ] end |
permalink #path ⇒ Object
[View source]
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/jars/lock.rb', line 35 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 |
permalink #scope ⇒ Object
[View source]
6 7 8 |
# File 'lib/jars/lock.rb', line 6 def scope self[ -2 ].to_sym end |
permalink #version ⇒ Object
[View source]
23 24 25 |
# File 'lib/jars/lock.rb', line 23 def version self[ -3 ] end |