Class: Poke::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/poke/cli.rb

Overview

Handle the application command line parsing and the dispatch to various command objects

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/poke/cli.rb', line 81

def self.exit_on_failure?
  true
end

Instance Method Details

#curlObject



42
43
44
45
46
47
48
49
# File 'lib/poke/cli.rb', line 42

def curl(*)
  if options[:help]
    invoke :help, ['curl']
  else
    require_relative 'commands/curl'
    Poke::Commands::Curl.new(options).execute
  end
end

#envObject



27
28
29
30
31
32
33
34
# File 'lib/poke/cli.rb', line 27

def env(*)
  if options[:help]
    invoke :help, ['env']
  else
    require_relative 'commands/env'
    Poke::Commands::Env.new(options).execute
  end
end

#initObject



19
20
21
22
# File 'lib/poke/cli.rb', line 19

def init
  require_relative 'commands/init'
  Poke::Commands::Init.new.execute
end

#responseObject



67
68
69
70
71
72
73
74
# File 'lib/poke/cli.rb', line 67

def response(*)
  if options[:help]
    invoke :help, ['response']
  else
    require_relative 'commands/response'
    Poke::Commands::Response.new(options).execute
  end
end

#speedObject



56
57
58
59
60
61
62
63
# File 'lib/poke/cli.rb', line 56

def speed(*)
  if options[:help]
    invoke :help, ['curl']
  else
    require_relative 'commands/speed'
    Poke::Commands::Speed.new(options).execute
  end
end

#versionObject



12
13
14
15
# File 'lib/poke/cli.rb', line 12

def version
  require_relative 'version'
  puts "v#{Poke::VERSION}"
end