Class: CommandProposal::RunnerController

Inherits:
EngineController
  • Object
show all
Includes:
ParamsHelper, PermissionsHelper
Defined in:
app/controllers/command_proposal/runner_controller.rb

Instance Method Summary collapse

Methods included from PermissionsHelper

#approval_required?, #can_approve?, #can_command?, #cmd_config, #command_user, #current_is_author?, #has_approval?, #permitted_to_use?

Methods included from ParamsHelper

#command_paginate, #current_params, #current_path, #div, #humanized_duration, #sort_order, #toggled_param, #toggled_sort_order, #true_param?, #truthy?

Methods included from ApplicationHelper

#cmd_path, #cmd_url, #engine, #runner_path, #runner_url, #string_path

Instance Method Details

#createObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/controllers/command_proposal/runner_controller.rb', line 25

def create
  @task = ::CommandProposal::Task.find_by!(friendly_id: params[:task_id])
  # Error unless @task.function?
  # Error unless iteration is ready to be run
  @iteration = @task.current_iteration

  begin
    @iteration = run_iteration
  rescue ::CommandProposal::Services::CommandInterpreter::Error => e
    return render(text: e.message, status: :bad_request)
  end

  iteration_response
end

#showObject



18
19
20
21
22
23
# File 'app/controllers/command_proposal/runner_controller.rb', line 18

def show
  @task = ::CommandProposal::Task.find_by!(friendly_id: params[:task_id])
  @iteration = ::CommandProposal::Iteration.find(params[:id])

  iteration_response
end