Bundler::Dependency

Constants

PLATFORM_MAP

Attributes

autorequire[R]
groups[R]
platforms[R]

Public Class Methods

new(name, version, options = {}, &blk) click to toggle source
    # File lib/bundler/dependency.rb, line 22
22:     def initialize(name, version, options = {}, &blk)
23:       super(name, version)
24: 
25:       @autorequire = nil
26:       @groups      = Array(options["group"] || :default).map { |g| g.to_sym }
27:       @source      = options["source"]
28:       @platforms   = Array(options["platforms"])
29:       @env         = options["env"]
30: 
31:       if options.key?('require')
32:         @autorequire = Array(options['require'] || [])
33:       end
34:     end

Public Instance Methods

current_env?() click to toggle source
    # File lib/bundler/dependency.rb, line 52
52:     def current_env?
53:       return true unless @env
54:       if Hash === @env
55:         @env.all? do |key, val|
56:           ENV[key.to_s] && (String === val ? ENV[key.to_s] == val : ENV[key.to_s] =~ val)
57:         end
58:       else
59:         ENV[@env.to_s]
60:       end
61:     end
current_platform?() click to toggle source
    # File lib/bundler/dependency.rb, line 63
63:     def current_platform?
64:       return true if @platforms.empty?
65:       @platforms.any? { |p| send("#{p}?") }
66:     end
gem_platforms(valid_platforms) click to toggle source
    # File lib/bundler/dependency.rb, line 36
36:     def gem_platforms(valid_platforms)
37:       return valid_platforms if @platforms.empty?
38: 
39:       platforms = []
40:       @platforms.each do |p|
41:         platform = PLATFORM_MAP[p]
42:         next unless valid_platforms.include?(platform)
43:         platforms |= [platform]
44:       end
45:       platforms
46:     end
should_include?() click to toggle source
    # File lib/bundler/dependency.rb, line 48
48:     def should_include?
49:       current_env? && current_platform?
50:     end
to_lock() click to toggle source
    # File lib/bundler/dependency.rb, line 68
68:     def to_lock
69:       out = "  #{name}"
70: 
71:       unless requirement == Gem::Requirement.default
72:         out << " (#{requirement.to_s})"
73:       end
74: 
75:       out << '!' if source
76: 
77:       out << "\n"
78:     end

Private Instance Methods

jruby?() click to toggle source
     # File lib/bundler/dependency.rb, line 106
106:     def jruby?
107:       defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
108:     end
mri?() click to toggle source
    # File lib/bundler/dependency.rb, line 94
94:     def mri?
95:       !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
96:     end
mri_18?() click to toggle source
     # File lib/bundler/dependency.rb, line 98
 98:     def mri_18?
 99:       mri? && RUBY_VERSION < "1.9"
100:     end
mri_19?() click to toggle source
     # File lib/bundler/dependency.rb, line 102
102:     def mri_19?
103:       mri? && RUBY_VERSION >= "1.9"
104:     end
mswin?() click to toggle source
     # File lib/bundler/dependency.rb, line 110
110:     def mswin?
111:       # w0t?
112:     end
ruby?() click to toggle source
    # File lib/bundler/dependency.rb, line 82
82:     def ruby?
83:       !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx")
84:     end
ruby_18?() click to toggle source
    # File lib/bundler/dependency.rb, line 86
86:     def ruby_18?
87:       ruby? && RUBY_VERSION < "1.9"
88:     end
ruby_19?() click to toggle source
    # File lib/bundler/dependency.rb, line 90
90:     def ruby_19?
91:       ruby? && RUBY_VERSION >= "1.9"
92:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.