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)
  type = options["type"] || :runtime
  super(name, version, type)
  @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 mingw?

def mingw?
  Bundler::WINDOWS && Gem::Platform.local.os == "mingw32"
end

def mingw_18?

def mingw_18?
  mingw? && RUBY_VERSION < "1.9"
end

def mingw_19?

def mingw_19?
  mingw? && RUBY_VERSION >= "1.9"
end

def mri?

def mri?
  !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
end

def mri_18?

def mri_18?
  mri? && RUBY_VERSION < "1.9"
end

def mri_19?

def mri_19?
  mri? && RUBY_VERSION >= "1.9"
end

def mswin?

def mswin?
  Bundler::WINDOWS
end

def rbx?

def rbx?
  ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
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
    reqs = requirement.requirements.map{|o,v| "#{o} #{v}" }
    out << " (#{reqs.join(', ')})"
  end
  out << '!' if source
  out << "\n"
end