Class: Bundler::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/environment.rb

Direct Known Subclasses

Installer, Runtime

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root, definition) ⇒ Environment

Returns a new instance of Environment.



6
7
8
9
10
11
12
# File 'lib/bundler/environment.rb', line 6

def initialize(root, definition)
  @root = root
  @definition = definition

  env_file = Bundler.app_config_path.join("environment.rb")
  env_file.rmtree if env_file.exist?
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



4
5
6
# File 'lib/bundler/environment.rb', line 4

def root
  @root
end

Instance Method Details

#current_dependenciesObject



30
31
32
# File 'lib/bundler/environment.rb', line 30

def current_dependencies
  @definition.current_dependencies
end

#dependenciesObject



26
27
28
# File 'lib/bundler/environment.rb', line 26

def dependencies
  @definition.dependencies
end

#inspectObject



14
15
16
# File 'lib/bundler/environment.rb', line 14

def inspect
  @definition.to_lock.inspect
end

#lock(opts = {}) ⇒ Object



34
35
36
# File 'lib/bundler/environment.rb', line 34

def lock(opts = {})
  @definition.lock(Bundler.default_lockfile, opts[:preserve_unknown_sections])
end

#requested_specsObject



18
19
20
# File 'lib/bundler/environment.rb', line 18

def requested_specs
  @definition.requested_specs
end

#specsObject



22
23
24
# File 'lib/bundler/environment.rb', line 22

def specs
  @definition.specs
end

#update(*gems) ⇒ Object



38
39
40
# File 'lib/bundler/environment.rb', line 38

def update(*gems)
  # Nothing
end