Class: Natives::GemfileViewer
- Inherits:
-
Object
- Object
- Natives::GemfileViewer
- Defined in:
- lib/natives/gemfile_viewer.rb
Instance Method Summary collapse
- #gem_names ⇒ Object
-
#initialize(gemfile_path) ⇒ GemfileViewer
constructor
A new instance of GemfileViewer.
Constructor Details
#initialize(gemfile_path) ⇒ GemfileViewer
Returns a new instance of GemfileViewer.
5 6 7 8 |
# File 'lib/natives/gemfile_viewer.rb', line 5 def initialize(gemfile_path) @gemfile_path = File.(gemfile_path) @lockfile_path = "#{@gemfile_path}.lock" end |
Instance Method Details
#gem_names ⇒ Object
10 11 12 13 |
# File 'lib/natives/gemfile_viewer.rb', line 10 def gem_names lockfile = Bundler::LockfileParser.new(Bundler.read_file(@lockfile_path)) lockfile.specs.map(&:name) end |