Class: Engineyard::Local::Command::Group

Inherits:
Thor
  • Object
show all
Defined in:
lib/engineyard-local/command/group.rb

Overview

TODO move to purely vagrant command based setup

Class Method Summary collapse

Instance Method Summary collapse

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_infoObject



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 << banner(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, options).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, options).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, options).exec(self, *args)
end

#listObject



114
115
116
117
118
119
120
# File 'lib/engineyard-local/command/group.rb', line 114

def list
  if options["format"] && !["short", "full"].include?(options["format"])
    help("list")
  else
    Command::List.new(env, options).exec(options)
  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, options).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, options).exec(*args)
end

#startObject



123
124
125
# File 'lib/engineyard-local/command/group.rb', line 123

def start
  Command::Start.new(env, options).exec()
end

#status(*args) ⇒ Object



133
134
135
# File 'lib/engineyard-local/command/group.rb', line 133

def status(*args)
  Command::Status.new(env, options).exec(env)
end

#stopObject



128
129
130
# File 'lib/engineyard-local/command/group.rb', line 128

def stop
  Command::Stop.new(env, options).exec()
end

#terminate(*args) ⇒ Object



143
144
145
# File 'lib/engineyard-local/command/group.rb', line 143

def terminate(*args)
  Command::Terminate.new(env, options).exec()
end

#up(*args) ⇒ Object



95
96
97
# File 'lib/engineyard-local/command/group.rb', line 95

def up(*args)
  Command::Up.new(env, options).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, options).exec()
end