Class: Maestro::Command::Init
- Inherits:
-
Maestro::Command
- Object
- Maestro::Command
- Maestro::Command::Init
- Defined in:
- lib/commands/project_commands.rb
Instance Method Summary collapse
-
#initialize(project) ⇒ Init
constructor
A new instance of Init.
- #invoke ⇒ Object
Methods inherited from Maestro::Command
Constructor Details
#initialize(project) ⇒ Init
Returns a new instance of Init.
13 14 15 |
# File 'lib/commands/project_commands.rb', line 13 def initialize(project) @project = project end |
Instance Method Details
#invoke ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/commands/project_commands.rb', line 17 def invoke project = Maestro::Project.find(@project, :params => { :context => 'user' }) File.open(".maestro.yml", "w") do |io| io.puts "project_id: #{project.id}" end Dir.pwd + "/.maestro.yml written successfully" rescue ActiveResource::ResourceNotFound raise RuntimeError.new("Could not find project \"#{@project}\". Please double-check the name on Maestro.") end |