Class: Transdeps::Specification
- Inherits:
-
Struct
- Object
- Struct
- Transdeps::Specification
- Defined in:
- lib/transdeps/specification.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#project_path ⇒ Object
Returns the value of attribute project_path.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
2 3 4 |
# File 'lib/transdeps/specification.rb', line 2 def name @name end |
#project_path ⇒ Object
Returns the value of attribute project_path
2 3 4 |
# File 'lib/transdeps/specification.rb', line 2 def project_path @project_path end |
#version ⇒ Object
Returns the value of attribute version
2 3 4 |
# File 'lib/transdeps/specification.rb', line 2 def version @version end |
Class Method Details
.from_lock(lock, path = '') ⇒ Object
3 4 5 6 |
# File 'lib/transdeps/specification.rb', line 3 def self.from_lock(lock, path='') match = lock.match(/^(?<name>[^\s]+) \((?<version>.*)\)/) new(match[:name], match[:version], path) end |
Instance Method Details
#=~(other) ⇒ Object
12 13 14 |
# File 'lib/transdeps/specification.rb', line 12 def =~(other) same_gem_as?(other) && version == other.version end |
#same_gem_as?(other) ⇒ Boolean
8 9 10 |
# File 'lib/transdeps/specification.rb', line 8 def same_gem_as?(other) name == other.name end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/transdeps/specification.rb', line 16 def to_s "#{name} (#{version})" end |