Class: Tinet::CLI
- Inherits:
-
Thor
- Object
- Thor
- Tinet::CLI
- Defined in:
- lib/tinet/cli.rb
Instance Method Summary collapse
- #build ⇒ Object
- #conf ⇒ Object
- #down ⇒ Object
- #exec(node, command) ⇒ Object
- #help(command = nil, subcommand = false) ⇒ Object
- #init ⇒ Object
- #ps ⇒ Object
- #pull ⇒ Object
- #restart ⇒ Object
- #up ⇒ Object
- #version ⇒ Object
Instance Method Details
#build ⇒ Object
73 74 75 76 |
# File 'lib/tinet/cli.rb', line 73 def build return version if [:version] Tinet::Command::Build.new().run end |
#conf ⇒ Object
82 83 84 85 |
# File 'lib/tinet/cli.rb', line 82 def conf return version if [:version] Tinet::Command::Conf.new().run end |
#down ⇒ Object
46 47 48 49 |
# File 'lib/tinet/cli.rb', line 46 def down return version if [:version] Tinet::Command::Down.new().run end |
#exec(node, command) ⇒ Object
64 65 66 67 |
# File 'lib/tinet/cli.rb', line 64 def exec(node, command) return version if [:version] Tinet::Command::Exec.new().run(node, command) end |
#help(command = nil, subcommand = false) ⇒ Object
Note:
Override Thor#help
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/tinet/cli.rb', line 103 def help(command = nil, subcommand = false) if command.nil? puts <<-USAGE Usage: tinet [OPTIONS] COMMAND Options: -f, [--specfile=SPECFILE] # Specify specification YAML file (Default: ./spec.yml) -d, [--dry-run] # Print the recipes that are needed to execute -v, [--version] # Show the TINET version information USAGE end super end |
#init ⇒ Object
18 19 20 21 |
# File 'lib/tinet/cli.rb', line 18 def init return version if [:version] Tinet::Command::Init.new.run end |
#ps ⇒ Object
27 28 29 30 |
# File 'lib/tinet/cli.rb', line 27 def ps return version if [:version] Tinet::Command::Ps.new().run end |
#pull ⇒ Object
55 56 57 58 |
# File 'lib/tinet/cli.rb', line 55 def pull return version if [:version] Tinet::Command::Pull.new().run end |
#restart ⇒ Object
91 92 93 94 95 |
# File 'lib/tinet/cli.rb', line 91 def restart return version if [:version] Tinet::Command::Down.new().run Tinet::Command::Up.new().run end |