Class: Coffer::CLI
- Inherits:
-
Thor
- Object
- Thor
- Coffer::CLI
- Defined in:
- lib/coffer/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.handle_no_command_error(command, has_namespace = $thor_runner) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/coffer/cli.rb', line 59 def self.handle_no_command_error(command, has_namespace=$thor_runner) coin = Coffer::Registry.instance.find(command) if coin.nil? # warn "Unable to find a coin with a name or symbol of #{ coin }" super return end ARGV.shift coin.call_rpc( *ARGV ) end |
Instance Method Details
#install(coin) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/coffer/cli.rb', line 20 def install(coin) coin = Coffer::Registry.instance.find( coin ) if coin.nil? warn "Unable to find a coin with a name or symbol of #{ coin }" end warn "installing coin: #{ coin.name } (#{coin.symbol})" installer = Coffer::Installer.new(coin) if installer.install puts "success!" else puts "Failed to install coin..." end end |
#list ⇒ Object
8 9 10 11 12 |
# File 'lib/coffer/cli.rb', line 8 def list Coffer::Registry.instance.coins.each do |coin| puts "%-20s (%s)" % [ coin.name, coin.symbol ] end end |
#search ⇒ Object
15 16 17 |
# File 'lib/coffer/cli.rb', line 15 def search warn "not implemented" end |