Class: Dydra::Command::Open

Inherits:
Dydra::Command show all
Defined in:
lib/dydra/command/open.rb

Overview

Opens an account or a repository in a web browser.

Instance Method Summary (collapse)

Methods inherited from Dydra::Command

#abort, #basename, #catch_errors, #debug?, #initialize, #parse_repository_specs, #parse_resource_specs, #require_gem!, #stderr, #stdout, #validate_repository_specs, #validate_resource_specs, #verbose?, #wrap_errors

Methods included from Dydra::Client

authenticate!, credentials_file, delete, get, get_json, post, reset!, resource, rpc, setup?

Constructor Details

This class inherits a constructor from Dydra::Command

Instance Method Details

- execute(*resource_specs)

This method returns an undefined value.

Parameters:

  • resource_specs (Array<String>)


9
10
11
12
13
14
15
# File 'lib/dydra/command/open.rb', line 9

def execute(*resource_specs)
  require_gem! 'launchy', "install the 'launchy' gem to use this command"
  resources = validate_resource_specs(resource_specs)
  resources.each do |resource|
    Launchy.open(resource.url)
  end
end