Sha256: 7c4444a1ea5bc6ec3ebf65dc3662aab5f08b0cd1d34a48088ac4bb8d2e3af717

Contents?: true

Size: 674 Bytes

Versions: 4

Compression:

Stored size: 674 Bytes

Contents

require 'bundler'
module Ikazuchi
  class Definition
    def root
      @root ||= File.expand_path '../..', __dir__
    end

    def gemfile
      @gemfile ||= File.expand_path 'Gemfile', __dir__
    end

    def definition
      @definition ||= ::Bundler::Definition.build gemfile, nil, nil
    end

    def runtime
      @runtime ||= ::Bundler::Runtime.new root, definition
    end

    def dependencies
      definition.dependencies
    end

    def require!(*groups)
      runtime.require(*groups)
    end

    class << self
      def require!(*groups)
        new.require!(*groups)
      end

      def dependencies
        new.dependencies
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ikazuchi-1.2.1 lib/ikazuchi/definition.rb
ikazuchi-1.2.0 lib/ikazuchi/definition.rb
ikazuchi-1.1.1 lib/ikazuchi/definition.rb
ikazuchi-1.1.0 lib/ikazuchi/definition.rb