Class: Jars::Installer::Dependency
- Inherits:
-
Object
- Object
- Jars::Installer::Dependency
- Defined in:
- lib/jars/installer.rb
Instance Attribute Summary collapse
-
#coord ⇒ Object
readonly
Returns the value of attribute coord.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#gav ⇒ Object
readonly
Returns the value of attribute gav.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(line) ⇒ Dependency
constructor
A new instance of Dependency.
- #system? ⇒ Boolean
Constructor Details
#initialize(line) ⇒ Dependency
Returns a new instance of Dependency.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/jars/installer.rb', line 39 def initialize( line ) setup_type( line ) line.sub!( /^\s+/, empty = '' ) @coord = line.sub( /:[^:]+:([A-Z]:\\)?[^:]+$/, empty ) first, second = @coord.split( /:#{type}:/ ) group_id, artifact_id = first.split( /:/ ) parts = group_id.split( '.' ) parts << artifact_id parts << second.split( ':' )[ -1 ] parts << File.basename( line.sub( /.:/, empty ) ) @path = File.join( parts ).strip setup_scope( line ) reg = /:jar:|:pom:|:test:|:compile:|:runtime:|:provided:|:system:/ @file = line.slice(@coord.length, line.length).sub(reg, empty).strip @system = line.index(':system:') != nil @gav = @coord.sub(reg, ':') end |
Instance Attribute Details
#coord ⇒ Object (readonly)
Returns the value of attribute coord.
9 10 11 |
# File 'lib/jars/installer.rb', line 9 def coord @coord end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
9 10 11 |
# File 'lib/jars/installer.rb', line 9 def file @file end |
#gav ⇒ Object (readonly)
Returns the value of attribute gav.
9 10 11 |
# File 'lib/jars/installer.rb', line 9 def gav @gav end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/jars/installer.rb', line 9 def path @path end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
9 10 11 |
# File 'lib/jars/installer.rb', line 9 def scope @scope end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/jars/installer.rb', line 9 def type @type end |
Class Method Details
.new(line) ⇒ Object
11 12 13 14 15 |
# File 'lib/jars/installer.rb', line 11 def self.new( line ) if line.match( /:jar:|:pom:/ ) super end end |
Instance Method Details
#system? ⇒ Boolean
60 61 62 |
# File 'lib/jars/installer.rb', line 60 def system? @system end |