Class: Gem::Commands::WebCommand
- Inherits:
-
Gem::Command
- Object
- Gem::Command
- Gem::Commands::WebCommand
- Includes:
- VersionOption
- Defined in:
- lib/rubygems/commands/web_command.rb
Instance Method Summary collapse
- #arguments ⇒ Object
- #execute ⇒ Object
-
#initialize ⇒ WebCommand
constructor
A new instance of WebCommand.
- #usage ⇒ Object
Constructor Details
#initialize ⇒ WebCommand
Returns a new instance of WebCommand.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rubygems/commands/web_command.rb', line 6 def initialize super 'web', "Open the gem's homepage", :command => nil, :version=> Gem::Web::VERSION, :latest=> false add_option("-g", "--github", "Open github page of gem, this searches all urls for a github page. This is the default.") do |v| [:github] = v end add_option("-c", "--sourcecode", "Open sourcecode gem") do |v| [:sourcecode] = v end add_option("-d", "--doc", "Open documentation of gem") do |v| [:doc] = v end add_option("-w", "--webpage", "Open webpage of gem") do |v| [:webpage] = v end add_option("-r", "--rubygems", "Open the rubygems page of a gem") do |v| [:rubygems] = v end add_option("-t", "--rubytoolbox", "Open the ruby toolbox page of a gem") do |v| [:rubytoolbox] = v end end |
Instance Method Details
#arguments ⇒ Object
32 33 34 |
# File 'lib/rubygems/commands/web_command.rb', line 32 def arguments "GEMNAME gem to open the webpage for" end |
#execute ⇒ Object
40 41 42 |
# File 'lib/rubygems/commands/web_command.rb', line 40 def execute Gem::Web::Executor.new.open_page(get_one_optional_argument, ) end |
#usage ⇒ Object
36 37 38 |
# File 'lib/rubygems/commands/web_command.rb', line 36 def usage "[GEMNAME]" end |