Class: Ghn::Commands

Inherits:
Thor
  • Object
show all
Defined in:
lib/ghn/commands.rb

Instance Method Summary collapse

Instance Method Details

#list(name = nil) ⇒ Object



10
11
12
13
# File 'lib/ghn/commands.rb', line 10

def list(name = nil)
  repo_full_name = aliases.find(name) || name
  puts collect(repo_full_name)
end

#open(name = nil) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/ghn/commands.rb', line 16

def open(name = nil)
  repo_full_name = aliases.find(name) || name
  collect(repo_full_name).each do |url|
    puts "Opening.. #{url}" if options["verbose"]
    system "#{open_command} #{url}"
    sleep 0.5 # prevent `LSOpenURLsWithRole() failed with error` on Mac OSX Yosemite
  end
end