Class: Engineyard::Local::Command::Group
- Inherits:
-
Thor
- Object
- Thor
- Engineyard::Local::Command::Group
- Defined in:
- lib/engineyard-local/command/group.rb
Overview
TODO move to purely vagrant command based setup
Class Method Summary collapse
- .command_info ⇒ Object
-
.env=(env) ⇒ Object
TODO this class level env crap will go away once these commands are moved out of thor to Vagrant commands.
- .printable_tasks(all = true, subcommand = false) ⇒ Object
Instance Method Summary collapse
- #down(*args) ⇒ Object
- #exec(*args) ⇒ Object
- #help(*args) ⇒ Object
-
#initialize(*args) ⇒ Group
constructor
NOTE this is generally a bad idea as it might break between Vagrant versions the alternate is to monkey with the output (we’re attempting to own the ux) from Thor where ey-local remains a Vagrant plugin.
- #list ⇒ Object
- #log(*args) ⇒ Object
- #rails(*args) ⇒ Object
- #start ⇒ Object
- #status(*args) ⇒ Object
- #stop ⇒ Object
- #terminate(*args) ⇒ Object
- #up(*args) ⇒ Object
- #update(*args) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Group
NOTE this is generally a bad idea as it might break between Vagrant versions the alternate is to monkey with the output (we’re attempting to own the ux) from Thor where ey-local remains a Vagrant plugin. Either way the library is reaching into deps and using their internals, Vagrant is preferred here because the author has more experience with said internals TODO clean up the vagrant command environment init
56 57 58 |
# File 'lib/engineyard-local/command/group.rb', line 56 def initialize(*args) super end |
Class Method Details
.command_info ⇒ Object
60 61 62 |
# File 'lib/engineyard-local/command/group.rb', line 60 def self.command_info Local.locales[:commands] end |
.env=(env) ⇒ Object
TODO this class level env crap will go away once
these commands are moved out of thor to Vagrant commands
21 22 23 |
# File 'lib/engineyard-local/command/group.rb', line 21 def self.env=(env) @@env = env end |
.printable_tasks(all = true, subcommand = false) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/engineyard-local/command/group.rb', line 9 def self.printable_tasks(all = true, subcommand = false) (all ? all_tasks : tasks).map do |_, task| next if task.hidden? item = [] item << (task, false, subcommand) item << (task.description ? "# #{task.description.gsub(/ +/m,' ')}" : "") item end.compact end |
Instance Method Details
#down(*args) ⇒ Object
100 101 102 |
# File 'lib/engineyard-local/command/group.rb', line 100 def down(*args) Command::VagrantAction.new(env, ).exec(:halt) && externally_unregister_vm(env) end |
#exec(*args) ⇒ Object
83 84 85 |
# File 'lib/engineyard-local/command/group.rb', line 83 def exec(*args) Command::Exec.new(env, ).exec(args) end |
#help(*args) ⇒ Object
71 72 73 |
# File 'lib/engineyard-local/command/group.rb', line 71 def help(*args) Command::Help.new(env, ).exec(self, *args) end |
#list ⇒ Object
114 115 116 117 118 119 120 |
# File 'lib/engineyard-local/command/group.rb', line 114 def list if ["format"] && !["short", "full"].include?(["format"]) help("list") else Command::List.new(env, ).exec() end end |
#log(*args) ⇒ Object
107 108 109 110 |
# File 'lib/engineyard-local/command/group.rb', line 107 def log(*args) cmd_args = ["tail -#{options["lines"]} log/#{options["environment"]}.log"] Command::Exec.new(env, ).exec(cmd_args) end |
#rails(*args) ⇒ Object
78 79 80 |
# File 'lib/engineyard-local/command/group.rb', line 78 def rails(*args) Command::Rails.new(env, ).exec(*args) end |
#start ⇒ Object
123 124 125 |
# File 'lib/engineyard-local/command/group.rb', line 123 def start Command::Start.new(env, ).exec() end |
#status(*args) ⇒ Object
133 134 135 |
# File 'lib/engineyard-local/command/group.rb', line 133 def status(*args) Command::Status.new(env, ).exec(env) end |
#stop ⇒ Object
128 129 130 |
# File 'lib/engineyard-local/command/group.rb', line 128 def stop Command::Stop.new(env, ).exec() end |
#terminate(*args) ⇒ Object
143 144 145 |
# File 'lib/engineyard-local/command/group.rb', line 143 def terminate(*args) Command::Terminate.new(env, ).exec() end |
#up(*args) ⇒ Object
95 96 97 |
# File 'lib/engineyard-local/command/group.rb', line 95 def up(*args) Command::Up.new(env, ).exec(*args) && externally_register_vm(env) end |
#update(*args) ⇒ Object
138 139 140 |
# File 'lib/engineyard-local/command/group.rb', line 138 def update(*args) Command::Update.new(env, ).exec() end |