changed literal array syntax, as suggested by RuboCop
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
module FileParameters
|
||||
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
|
||||
private :file_attributes
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ module Lti
|
||||
|
||||
MAXIMUM_SCORE = 1
|
||||
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 = {})
|
||||
if options[:consumer] && options[:parameters]
|
||||
|
@ -3,8 +3,8 @@ require File.expand_path('../../../uploaders/file_uploader', __FILE__)
|
||||
module CodeOcean
|
||||
class File < ActiveRecord::Base
|
||||
DEFAULT_WEIGHT = 1.0
|
||||
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]
|
||||
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)
|
||||
|
||||
after_initialize :set_default_values
|
||||
before_validation :set_ancestor_values, if: :incomplete_descendent?
|
||||
|
@ -1,7 +1,7 @@
|
||||
module User
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
ROLES = %w[admin teacher]
|
||||
ROLES = %w(admin teacher)
|
||||
|
||||
included do
|
||||
belongs_to :consumer
|
||||
|
@ -1,9 +1,9 @@
|
||||
class FileType < ActiveRecord::Base
|
||||
include Creation
|
||||
|
||||
AUDIO_FILE_EXTENSIONS = %w[.aac .flac .m4a .mp3 .ogg .wav .wma]
|
||||
IMAGE_FILE_EXTENSIONS = %w[.bmp .gif .jpeg .jpg .png]
|
||||
VIDEO_FILE_EXTENSIONS = %w[.avi .flv .mkv .mp4 .m4v .ogv .webm]
|
||||
AUDIO_FILE_EXTENSIONS = %w(.aac .flac .m4a .mp3 .ogg .wav .wma)
|
||||
IMAGE_FILE_EXTENSIONS = %w(.bmp .gif .jpeg .jpg .png)
|
||||
VIDEO_FILE_EXTENSIONS = %w(.avi .flv .mkv .mp4 .m4v .ogv .webm)
|
||||
|
||||
after_initialize :set_default_values
|
||||
|
||||
|
@ -2,7 +2,7 @@ class Submission < ActiveRecord::Base
|
||||
include Context
|
||||
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}'
|
||||
|
||||
belongs_to :exercise
|
||||
|
@ -5,8 +5,8 @@ set :application, 'code_ocean'
|
||||
set :config_example_suffix, '.example'
|
||||
set :deploy_to, '/var/www/app'
|
||||
set :keep_releases, 3
|
||||
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_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 :log_level, :info
|
||||
set :puma_threads, [0, 16]
|
||||
set :repo_url, 'git@github.com:openHPI/codeocean.git'
|
||||
|
@ -3,7 +3,7 @@ FactoryGirl.create(:consumer)
|
||||
FactoryGirl.create(:consumer, name: 'openSAP')
|
||||
|
||||
# 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
|
||||
ExecutionEnvironment.create_factories
|
||||
|
@ -181,7 +181,7 @@ FactoryGirl.define do
|
||||
singleton_file_type
|
||||
end
|
||||
|
||||
%w[binary executable renderable].each do |attribute|
|
||||
%w(binary executable renderable).each do |attribute|
|
||||
trait(attribute) do
|
||||
self.send(attribute, true)
|
||||
end
|
||||
|
@ -1,5 +1,5 @@
|
||||
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
|
||||
association :user, factory: factory_name
|
||||
end
|
||||
|
@ -18,7 +18,7 @@ describe Submission do
|
||||
expect(Submission.create.errors[:user_type]).to be_present
|
||||
end
|
||||
|
||||
%w[download render run test].each do |action|
|
||||
%w(download render run test).each do |action|
|
||||
describe "##{action}_url" do
|
||||
let(:url) { @submission.send(:"#{action}_url") }
|
||||
|
||||
|
Reference in New Issue
Block a user