Class: LockJar::Domain::Pom
- Defined in:
- lib/lock_jar/domain/artifact.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#scopes ⇒ Object
readonly
Returns the value of attribute scopes.
Attributes inherited from Artifact
Instance Method Summary collapse
- #<=>(another_artifact) ⇒ Object
- #==(another_artifact) ⇒ Object
-
#initialize(_path, _scopes = ['compile','runtime']) ⇒ Pom
constructor
A new instance of Pom.
- #notations ⇒ Object
- #to_dep ⇒ Object
- #to_urn ⇒ Object
Methods inherited from Artifact
Constructor Details
#initialize(_path, _scopes = ['compile','runtime']) ⇒ Pom
Returns a new instance of Pom.
81 82 83 84 85 |
# File 'lib/lock_jar/domain/artifact.rb', line 81 def initialize( _path, _scopes = ['compile','runtime'] ) @type = 'pom' @path = _path @scopes = _scopes end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
79 80 81 |
# File 'lib/lock_jar/domain/artifact.rb', line 79 def path @path end |
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
79 80 81 |
# File 'lib/lock_jar/domain/artifact.rb', line 79 def scopes @scopes end |
Instance Method Details
#<=>(another_artifact) ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/lock_jar/domain/artifact.rb', line 103 def <=>(another_artifact) if another_artifact.is_a? Pom if to_urn == another_artifact.to_urn return 0 if Set.new(scopes) == Set.new(another_artifact.scopes) # XXX: this is not a reliable way to compare. if scopes.size > another_artifact.scopes.size return 1 else return -1 end else to_urn <=> another_artifact.to_urn end else super end end |
#==(another_artifact) ⇒ Object
99 100 101 |
# File 'lib/lock_jar/domain/artifact.rb', line 99 def ==(another_artifact) self.<=>(another_artifact) == 0 end |
#notations ⇒ Object
95 96 97 |
# File 'lib/lock_jar/domain/artifact.rb', line 95 def notations LockJar::Maven.dependencies( path, scopes ) end |
#to_dep ⇒ Object
91 92 93 |
# File 'lib/lock_jar/domain/artifact.rb', line 91 def to_dep { path => scopes } end |
#to_urn ⇒ Object
87 88 89 |
# File 'lib/lock_jar/domain/artifact.rb', line 87 def to_urn "pom:#{path}" end |