Class: Gemstash::CLI
- Inherits:
-
Thor
- Object
- Thor
- Gemstash::CLI
show all
- Defined in:
- lib/gemstash/cli.rb,
lib/gemstash/cli/base.rb,
lib/gemstash/cli/stop.rb,
lib/gemstash/cli/setup.rb,
lib/gemstash/cli/start.rb,
lib/gemstash/cli/status.rb,
lib/gemstash/cli/authorize.rb
Overview
Base Command Line Interface class.
Defined Under Namespace
Classes: Authorize, Base, Error, Setup, Start, Status, Stop
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
24
25
26
|
# File 'lib/gemstash/cli.rb', line 24
def self.exit_on_failure?
true
end
|
.start(args = ARGV) ⇒ Object
28
29
30
31
32
33
34
35
36
|
# File 'lib/gemstash/cli.rb', line 28
def self.start(args = ARGV)
help_flags = %w[-h --help]
if args.any? {|a| help_flags.include?(a) }
super(%w[help] + args.reject {|a| help_flags.include?(a) })
else
super
end
end
|
Instance Method Details
#authorize(*args) ⇒ Object
62
63
64
|
# File 'lib/gemstash/cli.rb', line 62
def authorize(*args)
Gemstash::CLI::Authorize.new(self, *args).run
end
|
#help(command = nil) ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/gemstash/cli.rb', line 38
def help(command = nil)
command ||= "readme"
page = manpage(command)
if page && which("man")
exec "man", page
elsif page
puts File.read("#{page}.txt")
else
super
end
end
|
#start ⇒ Object
82
83
84
|
# File 'lib/gemstash/cli.rb', line 82
def start
Gemstash::CLI::Start.new(self).run
end
|
#stop ⇒ Object
96
97
98
|
# File 'lib/gemstash/cli.rb', line 96
def stop
Gemstash::CLI::Stop.new(self).run
end
|
#version ⇒ Object
101
102
103
|
# File 'lib/gemstash/cli.rb', line 101
def version
say "Gemstash version #{Gemstash::VERSION}"
end
|