Class: Bundler::DepProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/dep_proxy.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dep, platform) ⇒ DepProxy

Returns a new instance of DepProxy.



13
14
15
16
# 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) ⇒ Object (private)



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

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

Instance Attribute Details

#__platformObject (readonly)

Returns the value of attribute __platform.



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

def __platform
  @__platform
end

#depObject (readonly)

Returns the value of attribute dep.



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

def dep
  @dep
end

Class Method Details

.get_proxy(dep, platform) ⇒ Object



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

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

Instance Method Details

#cloneObject

Raises:

  • (NoMethodError)


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

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

#dupObject

Raises:

  • (NoMethodError)


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

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

#nameObject



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

def name
  @dep.name
end

#requirementObject



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

def requirement
  @dep.requirement
end

#to_sObject



34
35
36
37
38
39
# 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

#typeObject



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

def type
  @dep.type
end