Fix Rubocop offenses
This commit is contained in:
@ -12,19 +12,20 @@ class ExecutionEnvironmentsController < ApplicationController
|
||||
end
|
||||
private :authorize!
|
||||
|
||||
def create
|
||||
@execution_environment = ExecutionEnvironment.new(execution_environment_params)
|
||||
def index
|
||||
@execution_environments = ExecutionEnvironment.all.includes(:user).order(:name).paginate(page: params[:page], per_page: per_page_param)
|
||||
authorize!
|
||||
create_and_respond(object: @execution_environment)
|
||||
end
|
||||
|
||||
def destroy
|
||||
destroy_and_respond(object: @execution_environment)
|
||||
def show
|
||||
if @execution_environment.testing_framework?
|
||||
@testing_framework_adapter = TestingFrameworkAdapter.descendants.find {|klass| klass.name == @execution_environment.testing_framework }
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
# Add the current execution_environment if not already present in the list
|
||||
@docker_images |= [@execution_environment.docker_image]
|
||||
def new
|
||||
@execution_environment = ExecutionEnvironment.new
|
||||
authorize!
|
||||
end
|
||||
|
||||
def execute_command
|
||||
@ -122,21 +123,22 @@ class ExecutionEnvironmentsController < ApplicationController
|
||||
end
|
||||
private :execution_environment_params
|
||||
|
||||
def index
|
||||
@execution_environments = ExecutionEnvironment.all.includes(:user).order(:name).paginate(page: params[:page], per_page: per_page_param)
|
||||
authorize!
|
||||
def edit
|
||||
# Add the current execution_environment if not already present in the list
|
||||
@docker_images |= [@execution_environment.docker_image]
|
||||
end
|
||||
|
||||
def new
|
||||
@execution_environment = ExecutionEnvironment.new
|
||||
def create
|
||||
@execution_environment = ExecutionEnvironment.new(execution_environment_params)
|
||||
authorize!
|
||||
create_and_respond(object: @execution_environment)
|
||||
end
|
||||
|
||||
def set_docker_images
|
||||
@docker_images ||= ExecutionEnvironment.pluck(:docker_image)
|
||||
@docker_images += Runner.strategy_class.available_images
|
||||
rescue Runner::Error => e
|
||||
flash[:warning] = html_escape e.message
|
||||
flash.now[:warning] = html_escape e.message
|
||||
ensure
|
||||
@docker_images = @docker_images.sort.uniq
|
||||
end
|
||||
@ -158,16 +160,14 @@ class ExecutionEnvironmentsController < ApplicationController
|
||||
|
||||
def shell; end
|
||||
|
||||
def show
|
||||
if @execution_environment.testing_framework?
|
||||
@testing_framework_adapter = TestingFrameworkAdapter.descendants.find {|klass| klass.name == @execution_environment.testing_framework }
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
update_and_respond(object: @execution_environment, params: execution_environment_params)
|
||||
end
|
||||
|
||||
def destroy
|
||||
destroy_and_respond(object: @execution_environment)
|
||||
end
|
||||
|
||||
def sync_to_runner_management
|
||||
return unless Runner.management_active?
|
||||
|
||||
|
Reference in New Issue
Block a user