Bundler::Installer

Public Class Methods

install(root, definition, options = {}) click to toggle source
    # File lib/bundler/installer.rb, line 6
 6:     def self.install(root, definition, options = {})
 7:       installer = new(root, definition)
 8:       installer.run(options)
 9:       installer
10:     end

Public Instance Methods

run(options) click to toggle source
    # File lib/bundler/installer.rb, line 12
12:     def run(options)
13:       if Bundler.settings[:frozen]
14:         @definition.ensure_equivalent_gemfile_and_lockfile
15:       end
16: 
17:       if dependencies.empty?
18:         Bundler.ui.warn "The Gemfile specifies no dependencies"
19:         return
20:       end
21: 
22:       if Bundler.default_lockfile.exist? && !options["update"]
23:         begin
24:           tmpdef = Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil)
25:           local = true unless tmpdef.new_platform? || tmpdef.missing_specs.any?
26:         rescue BundlerError
27:         end
28:       end
29: 
30:       # Since we are installing, we can resolve the definition
31:       # using remote specs
32:       unless local
33:         options["local"] ?
34:           @definition.resolve_with_cache! :
35:           @definition.resolve_remotely!
36:       end
37: 
38:       # Ensure that BUNDLE_PATH exists
39:       Bundler.mkdir_p(Bundler.bundle_path) unless File.exist?(Bundler.bundle_path)
40: 
41:       # Must install gems in the order that the resolver provides
42:       # as dependencies might actually affect the installation of
43:       # the gem.
44:       specs.each do |spec|
45:         spec.source.fetch(spec) if spec.source.respond_to?(:fetch)
46: 
47:         # unless requested_specs.include?(spec)
48:         #   Bundler.ui.debug "  * Not in requested group; skipping."
49:         #   next
50:         # end
51: 
52:         begin
53:           old_args = Gem::Command.build_args
54:           Gem::Command.build_args = [Bundler.settings["build.#{spec.name}"]]
55:           spec.source.install(spec)
56:         ensure
57:           Gem::Command.build_args = old_args
58:         end
59: 
60:         Bundler.ui.info ""
61:         generate_bundler_executable_stubs(spec) if Bundler.settings[:bin]
62:         FileUtils.rm_rf(Bundler.tmp)
63:       end
64: 
65:       lock
66:     end

Private Instance Methods

generate_bundler_executable_stubs(spec) click to toggle source
    # File lib/bundler/installer.rb, line 70
70:     def generate_bundler_executable_stubs(spec)
71:       bin_path = Bundler.bin_path
72:       template = File.read(File.expand_path('../templates/Executable', __FILE__))
73:       relative_gemfile_path = Bundler.default_gemfile.relative_path_from(bin_path)
74: 
75:       spec.executables.each do |executable|
76:         next if executable == "bundle"
77:         File.open "#{bin_path}/#{executable}", 'w', 0755 do |f|
78:           f.puts ERB.new(template, nil, '-').result(binding)
79:         end
80:       end
81:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.