Parent

GemInstaller::InstallProcessor

Attributes

gem_list_checker[W]
gem_command_manager[W]
gem_spec_manager[W]
missing_dependency_finder[W]
options[W]
output_filter[W]

Public Instance Methods

fix_dependencies(gem) click to toggle source
    # File lib/geminstaller/install_processor.rb, line 55
55:     def fix_dependencies(gem)
56:       missing_dependencies = @missing_dependency_finder.find(gem)
57:       while (missing_dependencies.size > 0)
58:         missing_dependencies.each do |missing_dependency|
59:           @output_filter.geminstaller_output(:install,"Installing #{missing_dependency.name} (#{missing_dependency.version})\n")
60:           # recursively call install_gem to install the missing dependency.  Since fix_dependencies
61:           # should never be set on an auto-created missing dependency gem, there is no risk of an 
62:           # endless loop or stack overflow.
63:           install_gem(missing_dependency)
64:         end
65:         # continue to look for and install missing dependencies until none are found
66:         missing_dependencies = @missing_dependency_finder.find(gem)
67:       end
68:     end
install_gem(gem) click to toggle source
    # File lib/geminstaller/install_processor.rb, line 10
10:     def install_gem(gem)
11:       already_specified = false
12:       if gem.check_for_upgrade
13:         @gem_list_checker.verify_and_specify_remote_gem!(gem)
14:         already_specified = true
15:       end
16:       gem_is_installed = @gem_spec_manager.is_gem_installed?(gem)
17:       if gem_is_installed
18:         @output_filter.geminstaller_output(:debug,"Gem #{gem.name}, version #{gem.version} is already installed.\n")
19:       else
20:         perform_install(gem, already_specified)
21:         installation_performed = true
22:       end
23:       if gem.fix_dependencies
24:         if GemInstaller::RubyGemsVersionChecker.matches?('>=0.9.5')
25:           # RubyGems >=0.9.5 automatically handles missing dependencies, so just perform an install
26:           unless installation_performed
27:             @output_filter.geminstaller_output(:install,"The 'fix_dependencies' option was specified for #{gem.name}, version #{gem.version}, so it will be reinstalled to fix any missing dependencies.\n")
28:             perform_install(gem, already_specified, true)
29:           end
30:         else
31:           # RubyGems <=0.9.4 does not automatically handles missing dependencies, so GemInstaller must find them
32:           # manually with missing_dependency_finder
33:           fix_dependencies(gem)
34:         end
35:       end
36:     end
perform_install(gem, already_specified, force_install = false) click to toggle source
    # File lib/geminstaller/install_processor.rb, line 38
38:     def perform_install(gem, already_specified, force_install = false)
39:       @gem_list_checker.verify_and_specify_remote_gem!(gem) unless already_specified
40:       @output_filter.geminstaller_output(:install,"Invoking gem install for #{gem.name}, version #{gem.version}.\n")
41:       output_lines = @gem_command_manager.install_gem(gem, force_install)
42:       print_dependency_install_messages(gem, output_lines) unless @options[:silent]
43:     end
process(gems) click to toggle source
   # File lib/geminstaller/install_processor.rb, line 4
4:     def process(gems)
5:       gems.each do |gem|
6:         install_gem(gem)
7:       end
8:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.