Parent

GemInstaller::Autogem

Attributes

gem_command_manager[W]
gem_source_index_proxy[W]

Public Instance Methods

autogem(gems) click to toggle source
    # File lib/geminstaller/autogem.rb, line 4
 4:     def autogem(gems)
 5:       @gem_source_index_proxy.refresh!
 6:       # REALLY refresh - refreshing the source_index directly isn't enough.
 7:       Gem.refresh
 8:       @completed_names = []
 9:       @completed_gems = []
10:       gems.each do |gem|
11:         process_gem(gem)
12:       end
13:       @completed_gems
14:     end
invoke_require_gem_command(name, version) click to toggle source
    # File lib/geminstaller/autogem.rb, line 33
33:     def invoke_require_gem_command(name, version)
34:       if GemInstaller::RubyGemsVersionChecker.matches?('< 0.9')
35:         require_gem(name, version)
36:       else
37:         begin
38:           result = gem(name, version)
39:         rescue Gem::Exception => e
40:           exception_message = e.message
41:           exception_message.strip!
42:           error_message = "Error: GemInstaller failed to activate gem '#{name}', version '#{version}'.  This may be because GemInstaller processes gems in order (was alphabetical prior to 0.5.0), and an earlier gem in your geminstaller.yml config already activated another version.  Use the 'gem dependency [-R]' command to track this down, and reorder/edit your config as necessary.  Original Gem::Exception was: '#{exception_message}'"
43:           raise GemInstaller::GemInstallerError.new(error_message)
44:         end
45:       end
46:     end
process_gem(gem) click to toggle source
    # File lib/geminstaller/autogem.rb, line 16
16:     def process_gem(gem)
17:       name = gem.name
18:       version = gem.version
19:       unless @completed_names.index(name) or gem.no_autogem
20:         begin
21:           invoke_require_gem_command(name, version)
22:         rescue Gem::LoadError => load_error
23:           load_error_message = load_error.message
24:           load_error_message.strip!
25:           error_message = "Error: GemInstaller attempted to load gem '#{name}', version '#{version}', but that version is not installed.  Use GemInstaller to install the gem.  Original Gem::LoadError was: '#{load_error_message}'"
26:           raise GemInstaller::GemInstallerError.new(error_message)
27:         end
28:         @completed_names << name
29:         @completed_gems << gem
30:       end
31:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.