Class: Gem::Commands::FakeCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/rubygems_plugin.rb

Instance Method Summary collapse

Constructor Details

#initializeFakeCommand

Returns a new instance of FakeCommand.



6
7
8
9
10
11
12
13
14
15
# File 'lib/rubygems_plugin.rb', line 6

def initialize
  super "fake", "Make RubyGems think that the named gem is already installed."

  add_option(
    "-v", "--version VERSION",
    "Specify a version for the gem (default is #{FakeGem::DEFAULT_VERSION})"
  ) do |value, options|
    options[:version] = value
  end
end

Instance Method Details

#executeObject



25
26
27
28
29
# File 'lib/rubygems_plugin.rb', line 25

def execute
  options[:args].each do |gemname|
    FakeGem.new(gemname, options).install
  end
end

#summaryObject

:nodoc:



17
18
19
# File 'lib/rubygems_plugin.rb', line 17

def summary # :nodoc:
  FakeGem::SUMMARY
end

#usageObject

:nodoc:



21
22
23
# File 'lib/rubygems_plugin.rb', line 21

def usage # :nodoc:
  "#{program_name} GEMNAME [GEMNAME ...]"
end