class Rudisco::GemActions
Attributes
gem[R]
@return [Rudisco::Gem]
Public Class Methods
new(gem)
click to toggle source
@param [Rudisco::Gem] gem
@return [Rudisco::GemActions]
# File lib/rudisco/models/gem/actions.rb, line 9 def initialize(gem) @gem = gem end
Public Instance Methods
complete(action, params = {})
click to toggle source
Creates an instance of GemActions
class.
@param [Symbol] action
Described in Gem#action
@param [Hash] params
Additional parameters. Optional.
@exception Rudisco::GemActions::ActionUnknown
Raised when action is unknown.
# File lib/rudisco/models/gem/actions.rb, line 25 def complete(action, params = {}) if respond_to? action send action, params else raise Unknown, action end end
download(params = {})
click to toggle source
Downloads gem.
@param [Hash] params @option params [String] :path (ENV)
# File lib/rudisco/models/gem/actions.rb, line 88 def download(params = {}) path = params[:path] || ENV['HOME'] Helpers::download gem.gem_url, path end
git_clone(params = {})
click to toggle source
Clones gem from git-source.
@param [Hash] params @option params [String] :path (ENV)
# File lib/rudisco/models/gem/actions.rb, line 100 def git_clone(params = {}) path = params[:path] || ENV['HOME'] path = File.join(path, gem.name) Helpers::git_clone gem.source_code_url, path end
open_bug_tracker(params = {})
click to toggle source
Opens in browser bug tracker page
# File lib/rudisco/models/gem/actions.rb, line 57 def open_bug_tracker(params = {}) Helpers.open_in_browser gem.bug_tracker_url end
open_documentation(params = {})
click to toggle source
Opens in browser documentation page
# File lib/rudisco/models/gem/actions.rb, line 50 def open_documentation(params = {}) Helpers.open_in_browser gem.documentation_url end
open_rubygems(params = {})
click to toggle source
Opens in browser gem page on rubygems.org
# File lib/rudisco/models/gem/actions.rb, line 78 def open_rubygems(params = {}) Helpers.open_in_browser gem.project_url end
open_sources(params = {})
click to toggle source
Opens in browser code sources page.
# File lib/rudisco/models/gem/actions.rb, line 64 def open_sources(params = {}) Helpers.open_in_browser gem.source_code_url end
open_wiki(params = {})
click to toggle source
Opens in browser wiki page.
# File lib/rudisco/models/gem/actions.rb, line 71 def open_wiki(params = {}) Helpers.open_in_browser gem.wiki_url end
update(params = {})
click to toggle source
Updates gems.
Used to get latest information about gem. This need because some db.attributes getting update even when gem version not changed.
# File lib/rudisco/models/gem/actions.rb, line 43 def update(params = {}) Gem.corteges_scanning gem end