Class: Transdeps::SpecList
- Inherits:
-
Struct
- Object
- Struct
- Transdeps::SpecList
- Defined in:
- lib/transdeps/spec_list.rb
Instance Attribute Summary collapse
-
#lock_file_contents ⇒ Object
Returns the value of attribute lock_file_contents.
-
#lock_file_path ⇒ Object
Returns the value of attribute lock_file_path.
-
#parser ⇒ Object
Returns the value of attribute parser.
Instance Method Summary collapse
- #-(other) ⇒ Object
- #[](name) ⇒ Object
-
#initialize(lock_file_path, lock_file_contents, parser = Bundler::LockfileParser.new(lock_file_contents.to_s)) ⇒ SpecList
constructor
A new instance of SpecList.
- #specs ⇒ Object
Constructor Details
#initialize(lock_file_path, lock_file_contents, parser = Bundler::LockfileParser.new(lock_file_contents.to_s)) ⇒ SpecList
Returns a new instance of SpecList.
7 8 9 10 |
# File 'lib/transdeps/spec_list.rb', line 7 def initialize(lock_file_path, lock_file_contents, parser=Bundler::LockfileParser.new(lock_file_contents.to_s)) lock_file_path = Pathname(lock_file_path) super(lock_file_path, lock_file_contents, parser) end |
Instance Attribute Details
#lock_file_contents ⇒ Object
Returns the value of attribute lock_file_contents
6 7 8 |
# File 'lib/transdeps/spec_list.rb', line 6 def lock_file_contents @lock_file_contents end |
#lock_file_path ⇒ Object
Returns the value of attribute lock_file_path
6 7 8 |
# File 'lib/transdeps/spec_list.rb', line 6 def lock_file_path @lock_file_path end |
#parser ⇒ Object
Returns the value of attribute parser
6 7 8 |
# File 'lib/transdeps/spec_list.rb', line 6 def parser @parser end |
Instance Method Details
#-(other) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/transdeps/spec_list.rb', line 18 def -(other) specs.map do |spec| next unless other[spec.name] unless spec =~ other[spec.name] Inconsistency.new(spec, other[spec.name]) end end.compact end |
#[](name) ⇒ Object
27 28 29 |
# File 'lib/transdeps/spec_list.rb', line 27 def [](name) specs.find{|spec| spec.name == name } end |
#specs ⇒ Object
12 13 14 15 16 |
# File 'lib/transdeps/spec_list.rb', line 12 def specs parser.specs.map do |spec| Specification.from_lock(spec.to_s, lock_file_path.dirname.to_s) end end |