class Bundler::Dependency
def current_env?
def current_env? return true unless @env if Hash === @env @env.all? do |key, val| ENV[key.to_s] && (String === val ? ENV[key.to_s] == val : ENV[key.to_s] =~ val) end else ENV[@env.to_s] end end
def current_platform?
def current_platform? return true if @platforms.empty? @platforms.any? { |p| send("#{p}?") } end
def gem_platforms(valid_platforms)
def gem_platforms(valid_platforms) return valid_platforms if @platforms.empty? platforms = [] @platforms.each do |p| platform = PLATFORM_MAP[p] next unless valid_platforms.include?(platform) platforms |= [platform] end platforms end
def initialize(name, version, options = {}, &blk)
def initialize(name, version, options = {}, &blk) super(name, version) @autorequire = nil @groups = Array(options["group"] || :default).map { |g| g.to_sym } @source = options["source"] @platforms = Array(options["platforms"]) @env = options["env"] if options.key?('require') @autorequire = Array(options['require'] || []) end end
def jruby?
def jruby? defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby" end
def mswin?
def mswin? # w0t? end
def ruby?
def ruby? !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx") end
def ruby_18?
def ruby_18? ruby? && RUBY_VERSION < "1.9" end
def ruby_19?
def ruby_19? ruby? && RUBY_VERSION >= "1.9" end
def should_include?
def should_include? current_env? && current_platform? end
def to_lock
def to_lock out = " #{name}" unless requirement == Gem::Requirement.default out << " (#{requirement.to_s})" end out << '!' if source out << "\n" end