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



8
9
10
11
# File 'lib/ghn/commands.rb', line 8

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

#open(name = nil) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/ghn/commands.rb', line 14

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