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

Public Instance Methods

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

Private Instance Methods

jruby?() click to toggle source
     # File lib/bundler/dependency.rb, line 109
109:     def jruby?
110:       defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
111:     end
mingw?() click to toggle source
     # File lib/bundler/dependency.rb, line 117
117:     def mingw?
118:       Bundler::WINDOWS && Gem::Platform.local.os == "mingw32"
119:     end
mingw_18?() click to toggle source
     # File lib/bundler/dependency.rb, line 121
121:     def mingw_18?
122:       mingw? && RUBY_VERSION < "1.9"
123:     end
mingw_19?() click to toggle source
     # File lib/bundler/dependency.rb, line 125
125:     def mingw_19?
126:       mingw? && RUBY_VERSION >= "1.9"
127:     end
mri?() click to toggle source
    # File lib/bundler/dependency.rb, line 97
97:     def mri?
98:       !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
99:     end
mri_18?() click to toggle source
     # File lib/bundler/dependency.rb, line 101
101:     def mri_18?
102:       mri? && RUBY_VERSION < "1.9"
103:     end
mri_19?() click to toggle source
     # File lib/bundler/dependency.rb, line 105
105:     def mri_19?
106:       mri? && RUBY_VERSION >= "1.9"
107:     end
mswin?() click to toggle source
     # File lib/bundler/dependency.rb, line 113
113:     def mswin?
114:       Bundler::WINDOWS
115:     end
ruby?() click to toggle source
    # File lib/bundler/dependency.rb, line 85
85:     def ruby?
86:       !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx")
87:     end
ruby_18?() click to toggle source
    # File lib/bundler/dependency.rb, line 89
89:     def ruby_18?
90:       ruby? && RUBY_VERSION < "1.9"
91:     end
ruby_19?() click to toggle source
    # File lib/bundler/dependency.rb, line 93
93:     def ruby_19?
94:       ruby? && RUBY_VERSION >= "1.9"
95:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.