Parent

GemInstaller::GemSpecManager

Attributes

source_index_search_adapter[W]
valid_platform_selector[W]
output_filter[W]

Public Instance Methods

all_local_gems() click to toggle source
    # File lib/geminstaller/gem_spec_manager.rb, line 9
 9:     def all_local_gems
10:       all_local_specs = @source_index_search_adapter.all_local_specs
11:       return [] unless all_local_specs
12:       all_local_gems = all_local_specs.collect do |spec|
13:         gem = GemInstaller::RubyGem.new(spec.name, :version  => spec.version.version)
14:       end
15:       return all_local_gems
16:     end
is_gem_installed?(gem) click to toggle source
   # File lib/geminstaller/gem_spec_manager.rb, line 5
5:     def is_gem_installed?(gem)
6:       return local_matching_gems(gem).size > 0
7:     end
local_matching_gems(gem, exact_platform_match = true) click to toggle source
    # File lib/geminstaller/gem_spec_manager.rb, line 18
18:     def local_matching_gems(gem, exact_platform_match = true)
19:       found_gem_specs = @source_index_search_adapter.search(gem,gem.version)
20:       return [] unless found_gem_specs
21: 
22:       if GemInstaller::RubyGemsVersionChecker.matches?('<=0.9.4')
23:         found_gem_specs = found_gem_specs.select do |gem_spec|
24:           valid_platforms = @valid_platform_selector.select(gem.platform, exact_platform_match)
25:           valid_platforms.include?(gem_spec.platform)
26:         end
27:       else
28:         # TODO: this is a hack because source_index#search doesn't allow specification of platform
29:         if exact_platform_match
30:           found_gem_specs = found_gem_specs.select do |spec|
31:             spec_platform_matches?(spec, gem.platform)
32:           end
33:         end
34:       end
35:       matching_gems = found_gem_specs.map do |gem_spec|
36:         GemInstaller::RubyGem.new(gem_spec.name, {:version => gem_spec.version.version, :platform => gem_spec.platform })
37:       end
38:       return matching_gems
39:     end
spec_platform_matches?(spec, platform) click to toggle source
    # File lib/geminstaller/gem_spec_manager.rb, line 41
41:     def spec_platform_matches?(spec, platform)
42:       if GemInstaller::RubyGemsVersionChecker.matches?('>0.9.5')
43:         return Gem::Platform.new(spec.platform) == Gem::Platform.new(platform)
44:       end
45:       return spec.platform == platform
46:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.