summaryrefslogtreecommitdiff
path: root/lib/bundler/runtime.rb
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-08-02 16:41:08 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-08-03 15:09:14 -0500
commita6eed560b78af7e83c52a91f6a23c992a2b96ff6 (patch)
tree155fa35b41d8225a0b212a85338156c245423fa0 /lib/bundler/runtime.rb
parentdfea4f22d32c5833ba373f4ecf7575cb49259d6c (diff)
downloadbundler-a6eed560b78af7e83c52a91f6a23c992a2b96ff6.tar.gz
Remove Bundler::Environment
Diffstat (limited to 'lib/bundler/runtime.rb')
-rw-r--r--lib/bundler/runtime.rb25
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index 3a86fe9226..fb2c76bc0c 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -2,9 +2,14 @@
require "digest/sha1"
module Bundler
- class Runtime < Environment
+ class Runtime
include SharedHelpers
+ def initialize(root, definition)
+ @root = root
+ @definition = definition
+ end
+
def setup(*groups)
groups.map!(&:to_sym)
@@ -107,6 +112,24 @@ module Bundler
end
end
+ def self.definition_method(meth)
+ define_method(meth) do
+ raise ArgumentError, "no definition when calling Runtime##{meth}" unless @definition
+ @definition.send(meth)
+ end
+ end
+ private_class_method :definition_method
+
+ definition_method :requested_specs
+ definition_method :specs
+ definition_method :dependencies
+ definition_method :current_dependencies
+ definition_method :requires
+
+ def lock(opts = {})
+ @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections])
+ end
+
alias_method :gems, :specs
def cache(custom_path = nil)