Sha256: a931dc2d8a4af1e9fdec7920547f89434938eaebd50ac6c18a5904bbc20d7347

Contents?: true

Size: 488 Bytes

Versions: 8

Compression:

Stored size: 488 Bytes

Contents

# frozen_string_literal: true

require "bundler"

module BundleUpdateInteractive
  class Gemfile
    def self.parse(path="Gemfile")
      dsl = Bundler::Dsl.new
      dsl.eval_gemfile(path)
      dependencies = dsl.dependencies.to_h { |d| [d.name, d] }
      new(dependencies)
    end

    def initialize(dependencies)
      @dependencies = dependencies.freeze
    end

    def [](name)
      @dependencies[name]
    end

    def dependencies
      @dependencies.values
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bundle_update_interactive-0.9.1 lib/bundle_update_interactive/gemfile.rb
bundle_update_interactive-0.9.0 lib/bundle_update_interactive/gemfile.rb
bundle_update_interactive-0.8.1 lib/bundle_update_interactive/gemfile.rb
bundle_update_interactive-0.8.0 lib/bundle_update_interactive/gemfile.rb
bundle_update_interactive-0.7.0 lib/bundle_update_interactive/gemfile.rb
bundle_update_interactive-0.6.0 lib/bundle_update_interactive/gemfile.rb
bundle_update_interactive-0.5.0 lib/bundle_update_interactive/gemfile.rb
bundle_update_interactive-0.4.0 lib/bundle_update_interactive/gemfile.rb