changed literal array syntax, as suggested by RuboCop
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
module FileParameters
|
module FileParameters
|
||||||
def file_attributes
|
def file_attributes
|
||||||
%w[content context_id feedback_message file_id file_type_id hidden id name native_file path read_only role weight]
|
%w(content context_id feedback_message file_id file_type_id hidden id name native_file path read_only role weight)
|
||||||
end
|
end
|
||||||
private :file_attributes
|
private :file_attributes
|
||||||
end
|
end
|
||||||
|
@ -5,7 +5,7 @@ module Lti
|
|||||||
|
|
||||||
MAXIMUM_SCORE = 1
|
MAXIMUM_SCORE = 1
|
||||||
MAXIMUM_SESSION_AGE = 60.minutes
|
MAXIMUM_SESSION_AGE = 60.minutes
|
||||||
SESSION_PARAMETERS = %w[launch_presentation_return_url lis_outcome_service_url lis_result_sourcedid]
|
SESSION_PARAMETERS = %w(launch_presentation_return_url lis_outcome_service_url lis_result_sourcedid)
|
||||||
|
|
||||||
def build_tool_provider(options = {})
|
def build_tool_provider(options = {})
|
||||||
if options[:consumer] && options[:parameters]
|
if options[:consumer] && options[:parameters]
|
||||||
|
@ -3,8 +3,8 @@ require File.expand_path('../../../uploaders/file_uploader', __FILE__)
|
|||||||
module CodeOcean
|
module CodeOcean
|
||||||
class File < ActiveRecord::Base
|
class File < ActiveRecord::Base
|
||||||
DEFAULT_WEIGHT = 1.0
|
DEFAULT_WEIGHT = 1.0
|
||||||
ROLES = %w[main_file reference_implementation regular_file teacher_defined_test user_defined_file user_defined_test]
|
ROLES = %w(main_file reference_implementation regular_file teacher_defined_test user_defined_file user_defined_test)
|
||||||
TEACHER_DEFINED_ROLES = ROLES - %w[user_defined_file]
|
TEACHER_DEFINED_ROLES = ROLES - %w(user_defined_file)
|
||||||
|
|
||||||
after_initialize :set_default_values
|
after_initialize :set_default_values
|
||||||
before_validation :set_ancestor_values, if: :incomplete_descendent?
|
before_validation :set_ancestor_values, if: :incomplete_descendent?
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
module User
|
module User
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
ROLES = %w[admin teacher]
|
ROLES = %w(admin teacher)
|
||||||
|
|
||||||
included do
|
included do
|
||||||
belongs_to :consumer
|
belongs_to :consumer
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
class FileType < ActiveRecord::Base
|
class FileType < ActiveRecord::Base
|
||||||
include Creation
|
include Creation
|
||||||
|
|
||||||
AUDIO_FILE_EXTENSIONS = %w[.aac .flac .m4a .mp3 .ogg .wav .wma]
|
AUDIO_FILE_EXTENSIONS = %w(.aac .flac .m4a .mp3 .ogg .wav .wma)
|
||||||
IMAGE_FILE_EXTENSIONS = %w[.bmp .gif .jpeg .jpg .png]
|
IMAGE_FILE_EXTENSIONS = %w(.bmp .gif .jpeg .jpg .png)
|
||||||
VIDEO_FILE_EXTENSIONS = %w[.avi .flv .mkv .mp4 .m4v .ogv .webm]
|
VIDEO_FILE_EXTENSIONS = %w(.avi .flv .mkv .mp4 .m4v .ogv .webm)
|
||||||
|
|
||||||
after_initialize :set_default_values
|
after_initialize :set_default_values
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ class Submission < ActiveRecord::Base
|
|||||||
include Context
|
include Context
|
||||||
include Creation
|
include Creation
|
||||||
|
|
||||||
CAUSES = %w[assess download file render run save submit test]
|
CAUSES = %w(assess download file render run save submit test)
|
||||||
FILENAME_URL_PLACEHOLDER = '{filename}'
|
FILENAME_URL_PLACEHOLDER = '{filename}'
|
||||||
|
|
||||||
belongs_to :exercise
|
belongs_to :exercise
|
||||||
|
@ -5,8 +5,8 @@ set :application, 'code_ocean'
|
|||||||
set :config_example_suffix, '.example'
|
set :config_example_suffix, '.example'
|
||||||
set :deploy_to, '/var/www/app'
|
set :deploy_to, '/var/www/app'
|
||||||
set :keep_releases, 3
|
set :keep_releases, 3
|
||||||
set :linked_dirs, %w[bin log public/uploads tmp/cache tmp/files tmp/pids tmp/sockets]
|
set :linked_dirs, %w(bin log public/uploads tmp/cache tmp/files tmp/pids tmp/sockets)
|
||||||
set :linked_files, %w[config/action_mailer.yml config/database.yml config/secrets.yml config/sendmail.yml config/smtp.yml]
|
set :linked_files, %w(config/action_mailer.yml config/database.yml config/secrets.yml config/sendmail.yml config/smtp.yml)
|
||||||
set :log_level, :info
|
set :log_level, :info
|
||||||
set :puma_threads, [0, 16]
|
set :puma_threads, [0, 16]
|
||||||
set :repo_url, 'git@github.com:openHPI/codeocean.git'
|
set :repo_url, 'git@github.com:openHPI/codeocean.git'
|
||||||
|
@ -3,7 +3,7 @@ FactoryGirl.create(:consumer)
|
|||||||
FactoryGirl.create(:consumer, name: 'openSAP')
|
FactoryGirl.create(:consumer, name: 'openSAP')
|
||||||
|
|
||||||
# users
|
# users
|
||||||
%w[admin external_user teacher].each { |factory_name| FactoryGirl.create(factory_name) }
|
%w(admin external_user teacher).each { |factory_name| FactoryGirl.create(factory_name) }
|
||||||
|
|
||||||
# execution environments
|
# execution environments
|
||||||
ExecutionEnvironment.create_factories
|
ExecutionEnvironment.create_factories
|
||||||
|
@ -181,7 +181,7 @@ FactoryGirl.define do
|
|||||||
singleton_file_type
|
singleton_file_type
|
||||||
end
|
end
|
||||||
|
|
||||||
%w[binary executable renderable].each do |attribute|
|
%w(binary executable renderable).each do |attribute|
|
||||||
trait(attribute) do
|
trait(attribute) do
|
||||||
self.send(attribute, true)
|
self.send(attribute, true)
|
||||||
end
|
end
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
%w[admin external_user teacher].each do |factory_name|
|
%w(admin external_user teacher).each do |factory_name|
|
||||||
trait :"created_by_#{factory_name}" do
|
trait :"created_by_#{factory_name}" do
|
||||||
association :user, factory: factory_name
|
association :user, factory: factory_name
|
||||||
end
|
end
|
||||||
|
@ -18,7 +18,7 @@ describe Submission do
|
|||||||
expect(Submission.create.errors[:user_type]).to be_present
|
expect(Submission.create.errors[:user_type]).to be_present
|
||||||
end
|
end
|
||||||
|
|
||||||
%w[download render run test].each do |action|
|
%w(download render run test).each do |action|
|
||||||
describe "##{action}_url" do
|
describe "##{action}_url" do
|
||||||
let(:url) { @submission.send(:"#{action}_url") }
|
let(:url) { @submission.send(:"#{action}_url") }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user