Sha256: d71bece6fdbe742326339f39a30dec6c1fc770358a9a714d38410afaea3158d4

Contents?: true

Size: 348 Bytes

Versions: 3

Compression:

Stored size: 348 Bytes

Contents

require 'bundler'

module Natives
  class GemfileViewer
    def initialize(gemfile_path)
      @gemfile_path = File.expand_path(gemfile_path)
      @lockfile_path = "#{@gemfile_path}.lock"
    end

    def gem_names
      lockfile = Bundler::LockfileParser.new(Bundler.read_file(@lockfile_path))
      lockfile.specs.map(&:name)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
natives-0.6.2 lib/natives/gemfile_viewer.rb
natives-0.6.1 lib/natives/gemfile_viewer.rb
natives-0.6.0 lib/natives/gemfile_viewer.rb