Class Index [+]

Quicksearch

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 26
26:     def initialize(name, version, options = {}, &blk)
27:       super(name, version)
28: 
29:       @autorequire = nil
30:       @groups      = Array(options["group"] || :default).map { |g| g.to_sym }
31:       @source      = options["source"]
32:       @platforms   = Array(options["platforms"])
33:       @env         = options["env"]
34: 
35:       if options.key?('require')
36:         @autorequire = Array(options['require'] || [])
37:       end
38:     end

Public Instance Methods

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

Private Instance Methods

jruby?() click to toggle source
     # File lib/bundler/dependency.rb, line 115
115:     def jruby?
116:       defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
117:     end
mingw?() click to toggle source
     # File lib/bundler/dependency.rb, line 123
123:     def mingw?
124:       Bundler::WINDOWS && Gem::Platform.local.os == "mingw32"
125:     end
mingw_18?() click to toggle source
     # File lib/bundler/dependency.rb, line 127
127:     def mingw_18?
128:       mingw? && RUBY_VERSION < "1.9"
129:     end
mingw_19?() click to toggle source
     # File lib/bundler/dependency.rb, line 131
131:     def mingw_19?
132:       mingw? && RUBY_VERSION >= "1.9"
133:     end
mri?() click to toggle source
     # File lib/bundler/dependency.rb, line 99
 99:     def mri?
100:       !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
101:     end
mri_18?() click to toggle source
     # File lib/bundler/dependency.rb, line 103
103:     def mri_18?
104:       mri? && RUBY_VERSION < "1.9"
105:     end
mri_19?() click to toggle source
     # File lib/bundler/dependency.rb, line 107
107:     def mri_19?
108:       mri? && RUBY_VERSION >= "1.9"
109:     end
mswin?() click to toggle source
     # File lib/bundler/dependency.rb, line 119
119:     def mswin?
120:       Bundler::WINDOWS
121:     end
rbx?() click to toggle source
     # File lib/bundler/dependency.rb, line 111
111:     def rbx?
112:       ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
113:     end
ruby?() click to toggle source
    # File lib/bundler/dependency.rb, line 87
87:     def ruby?
88:       !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx")
89:     end
ruby_18?() click to toggle source
    # File lib/bundler/dependency.rb, line 91
91:     def ruby_18?
92:       ruby? && RUBY_VERSION < "1.9"
93:     end
ruby_19?() click to toggle source
    # File lib/bundler/dependency.rb, line 95
95:     def ruby_19?
96:       ruby? && RUBY_VERSION >= "1.9"
97:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.