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)


94
95
96
# File 'lib/poke/cli.rb', line 94

def self.exit_on_failure?
  true
end

Instance Method Details

#curlObject



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

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

#envObject



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

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

#newObject



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

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

#responseObject



80
81
82
83
84
85
86
87
# File 'lib/poke/cli.rb', line 80

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

#speedObject



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

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