Object
# File lib/geminstaller/valid_platform_selector.rb, line 36
36: def binary_platform_substring
37: return ['686-darwin'] if @ruby_platform =~ /686-darwin/
38: return ['cygwin'] if @ruby_platform =~ /cygwin/
39: return ['powerpc'] if @ruby_platform =~ /powerpc/
40: return ['i386-mswin32','mswin32'] if @ruby_platform =~ /mswin/
41: return ['386-linux'] if @ruby_platform =~ /386-linux/
42: return ['486-linux'] if @ruby_platform =~ /486-linux/
43: return ['586-linux'] if @ruby_platform =~ /586-linux/
44: return ['686-linux'] if @ruby_platform =~ /686-linux/
45: return ['solaris'] if @ruby_platform =~ /solaris/
46: return nil
47: end
# File lib/geminstaller/valid_platform_selector.rb, line 5
5: def select(gem_platform = nil, exact_platform_match = false)
6: if GemInstaller::RubyGemsVersionChecker.matches?('>=0.9.5')
7: # valid_platform_selector is not used for RubyGems >= 0.9.5
8: raise RuntimeError.new("Internal GemInstaller Error: ValidPlatformSelector should not be used for RubyGems >= 0.9.5")
9: end
10:
11: @ruby_platform ||= RUBY_PLATFORM
12: return [@ruby_platform] if gem_platform == Gem::Platform::CURRENT
13: return [gem_platform] if exact_platform_match
14: valid_platforms = []
15: valid_platforms += binary_platform_substring if binary_platform_substring
16: if @options[:prefer_binary_platform] == false
17: # put ruby first if prefer_binary_platform is false
18: valid_platforms.unshift('ruby')
19: else
20: # leave binary platform first if prefer_binary_platform is false or nil
21: valid_platforms << 'ruby'
22: end
23: if gem_platform and
24: !valid_platforms.include?(gem_platform)
25: # only prepend the gem_platform as the first choice if
26: # 1. it is not nil
27: # 2. it is not already in the list
28: # 3. it is not 'ruby'
29: valid_platforms.unshift(gem_platform)
30: end
31: message = "Selecting valid platform(s): @ruby_platform='#{@ruby_platform}', gem_platform='#{gem_platform}', valid_platforms='#{valid_platforms.inspect}'"
32: @output_filter.geminstaller_output(:debug,"#{message}\n")
33: valid_platforms
34: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.