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
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(pom_path, pom_scopes = %w(compile runtime))) ⇒ Pom
constructor
A new instance of Pom.
- #notations ⇒ Object
- #to_dep ⇒ Object
- #to_urn ⇒ Object
Methods inherited from Artifact
Constructor Details
#initialize(pom_path, pom_scopes = %w(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(pom_path, pom_scopes = %w(compile runtime)) @type = 'pom' @path = pom_path @scopes = pom_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
#<=>(other) ⇒ Object
103 104 105 106 107 108 109 110 111 |
# File 'lib/lock_jar/domain/artifact.rb', line 103 def <=>(other) if other.is_a? Pom return Set.new(scopes) <=> Set.new(other.scopes) if to_urn == other.to_urn to_urn <=> other.to_urn else super end end |
#==(other) ⇒ Object
99 100 101 |
# File 'lib/lock_jar/domain/artifact.rb', line 99 def ==(other) self.<=>(other) == 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 |