Class: Gem::Dependency

Inherits:
Object
  • Object
show all
Includes:
Bundler::ForcePlatform, FilterIgnoredSpecs
Defined in:
lib/bundler/rubygems_ext.rb

Direct Known Subclasses

Bundler::Dependency

Defined Under Namespace

Modules: FilterIgnoredSpecs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Bundler::ForcePlatform

#default_force_ruby_platform

Methods included from FilterIgnoredSpecs

#matching_specs

Instance Attribute Details

#force_ruby_platformObject (readonly)

Returns the value of attribute force_ruby_platform.



247
248
249
# File 'lib/bundler/rubygems_ext.rb', line 247

def force_ruby_platform
  @force_ruby_platform
end

#groupsObject

Returns the value of attribute groups.



249
250
251
# File 'lib/bundler/rubygems_ext.rb', line 249

def groups
  @groups
end

#sourceObject

Returns the value of attribute source.



249
250
251
# File 'lib/bundler/rubygems_ext.rb', line 249

def source
  @source
end

Instance Method Details

#encode_with(coder) ⇒ Object



254
255
256
257
258
# File 'lib/bundler/rubygems_ext.rb', line 254

def encode_with(coder)
  [:@name, :@requirement, :@type, :@prerelease, :@version_requirements].each do |ivar|
    coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar)
  end
end

#to_lockObject



261
262
263
264
265
266
267
268
# File 'lib/bundler/rubygems_ext.rb', line 261

def to_lock
  out = String.new("  #{name}")
  unless requirement.none?
    reqs = requirement.requirements.map {|o, v| "#{o} #{v}" }.sort.reverse
    out << " (#{reqs.join(", ")})"
  end
  out
end