Class: EPC::Command::UnarchiveProjectCommand
- Inherits:
-
UnarchiveCommand
- Object
- BaseCommand
- UnarchiveCommand
- EPC::Command::UnarchiveProjectCommand
- Defined in:
- lib/epc/command/project/unarchive_project_command.rb
Constant Summary
Constants inherited from BaseCommand
BaseCommand::GIVEUP_TICKS, BaseCommand::SLEEP_TIME, BaseCommand::TICKER_TICKS
Instance Attribute Summary
Attributes inherited from BaseCommand
Instance Method Summary collapse
Methods inherited from BaseCommand
#go, inherited, #initialize, required_options
Methods included from PersistentAttributes
#auth_token, #caller_id, #target_url
Constructor Details
This class inherits a constructor from EPC::Command::BaseCommand
Instance Method Details
#execute(project = nil) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/epc/command/project/unarchive_project_command.rb', line 4 def execute(project = nil) path = File.(":") solution_name, project_name = project.split(".") rescue [nil, nil] solution_id, solution_name = infer_solution_context(solution_name, path, {:get_solution_name => true}) project_id, project_name = infer_project_context(project_name, path, solution_id, {:get_solution_name => true}) raise FatalError, "Project could not be inferred." if project_id.nil? status, response, = client.put(EPC::Config::PROJECTS_PATH + "/#{project_id}", {:archived => false}) if status.successful? say("Project has been unarchived.") else say("Project could not be unarchived. Request failed with: [#{response[:message]}]") end return status end |