Class: Blakey::Repository::Ruby::GemfileLockParser
- Inherits:
-
Object
- Object
- Blakey::Repository::Ruby::GemfileLockParser
- Defined in:
- lib/blakey/repository/ruby/gemfile_lock_parser.rb
Constant Summary collapse
- DEFAULT_GEMFILE_LOCK_PATH =
'Gemfile.lock'
Instance Attribute Summary collapse
-
#gemfile_lock_path ⇒ Object
readonly
Returns the value of attribute gemfile_lock_path.
Instance Method Summary collapse
- #dependencies ⇒ Object
-
#initialize(gemfile_lock_path: nil, source:) ⇒ GemfileLockParser
constructor
A new instance of GemfileLockParser.
- #ruby_version ⇒ Object
Constructor Details
#initialize(gemfile_lock_path: nil, source:) ⇒ GemfileLockParser
Returns a new instance of GemfileLockParser.
8 9 10 11 |
# File 'lib/blakey/repository/ruby/gemfile_lock_parser.rb', line 8 def initialize(gemfile_lock_path: nil, source:) @gemfile_lock_path = (gemfile_lock_path || DEFAULT_GEMFILE_LOCK_PATH) @source = source end |
Instance Attribute Details
#gemfile_lock_path ⇒ Object (readonly)
Returns the value of attribute gemfile_lock_path.
13 14 15 |
# File 'lib/blakey/repository/ruby/gemfile_lock_parser.rb', line 13 def gemfile_lock_path @gemfile_lock_path end |
Instance Method Details
#dependencies ⇒ Object
15 16 17 |
# File 'lib/blakey/repository/ruby/gemfile_lock_parser.rb', line 15 def dependencies parsed_gemfile_lock.specs.map { |spec| [spec.name, spec.version.to_s] }.to_h end |
#ruby_version ⇒ Object
19 20 21 |
# File 'lib/blakey/repository/ruby/gemfile_lock_parser.rb', line 19 def ruby_version parsed_gemfile_lock.ruby_version end |