Class: Datagraph::Command::Open

Inherits:
Datagraph::Command show all
Defined in:
lib/datagraph/command/open.rb

Overview

Opens an account or a repository in a web browser.

Instance Method Summary (collapse)

Methods inherited from Datagraph::Command

#basename, #parse_repository_specs, #parse_resource_specs, #validate_repository_specs, #validate_resource_specs

Methods included from Datagraph::Client

rpc

Instance Method Details

- execute(*resource_specs)

This method returns an undefined value.

Parameters:

  • (Array<String>) resource_specs


9
10
11
12
13
14
15
16
17
18
19
# File 'lib/datagraph/command/open.rb', line 9

def execute(*resource_specs)
  begin
    require 'launchy'
  rescue LoadError => e
    RDF::CLI.abort "install the 'launchy' gem to use this command"
  end
  resources = validate_resource_specs(resource_specs)
  resources.each do |resource|
    Launchy.open(resource.url)
  end
end