Class: GemSearch::Commands::Browse
- Includes:
- Utils::SystemUtil
- Defined in:
- lib/gem_search/commands/browse.rb
Constant Summary collapse
- GEM_URL =
"#{RUBYGEMS_URL}/gems/%s"
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods included from Utils::SystemUtil
Methods inherited from Base
Constructor Details
This class inherits a constructor from GemSearch::Commands::Base
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gem_search/commands/browse.rb', line 10 def call gem_name = [:browse] result = Request.new.search_for_browse(gem_name) url = extract_uri(result["homepage_uri"], gem_name) puts "Opening #{url}" browser_open(url) rescue OpenURI::HTTPError puts_abort("No such a gem.") rescue => e unexpected_error(e) end |