123456789_123456789_123456789_123456789_123456789_

Class: Bundler::DepProxy

Relationships & Source Files
Inherits: Object
Defined in: lib/bundler/dep_proxy.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(dep, platform) ⇒ DepProxy (private)

[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 13

def initialize(dep, platform)
  @dep = dep
  @__platform = platform
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &blk) (private)

[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 51

def method_missing(*args, &blk)
  @dep.send(*args, &blk)
end

Class Method Details

.get_proxy(dep, platform)

[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 9

def self.get_proxy(dep, platform)
  @proxies[[dep, platform]] ||= new(dep, platform).freeze
end

Instance Attribute Details

#__platform (readonly)

[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 5

attr_reader :__platform, :dep

#dep (readonly)

[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 5

attr_reader :__platform, :dep

Instance Method Details

#clone

Raises:

  • (NoMethodError)
[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 45

def clone
  raise NoMethodError.new("DepProxy cannot be cloned")
end

#dup

Raises:

  • (NoMethodError)
[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 41

def dup
  raise NoMethodError.new("DepProxy cannot be duplicated")
end

#eql?

[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 20

alias_method :eql?, :==

#name

[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 26

def name
  @dep.name
end

#requirement

[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 30

def requirement
  @dep.requirement
end

#to_s

[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 34

def to_s
  s = name.dup
  s << " (#{requirement})" unless requirement == Gem::Requirement.default
  s << " #{__platform}" unless __platform == Gem::Platform::RUBY
  s
end

#type

[ GitHub ]

  
# File 'lib/bundler/dep_proxy.rb', line 22

def type
  @dep.type
end