Skip to content

Commit

Permalink
Import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nygrenh committed Jul 29, 2024
1 parent d2566d6 commit e88df6a
Show file tree
Hide file tree
Showing 34 changed files with 51 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/api/beta/participant_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'course_list'

class Api::Beta::ParticipantController < Api::Beta::BaseController
before_action :doorkeeper_authorize!, scopes: [:public]

Expand Down
1 change: 1 addition & 0 deletions app/controllers/api/v8/base_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'json'
require 'version'

module Api
module V8
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v8/core/courses/reviews_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'natsort'

module Api
module V8
module Core
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'submission_processor'

module Api
module V8
module Core
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v8/core/exercises_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'submission_list'

module Api
module V8
module Core
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v8/core/submissions/reviews_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'natsort'

module Api
module V8
module Core
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/courses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require 'course_list'
require 'exercise_completion_status_generator'
require 'json'
require 'course_list'
require 'course_info'

class CoursesController < ApplicationController
before_action :set_organization
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/exercises_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'submission_list'

class ExercisesController < ApplicationController
def show
@exercise = Exercise.find(params[:id])
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/full_zip_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'submission_packager'

class FullZipController < ApplicationController
def index
submission = Submission.find(params[:submission_id])
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/migrate_to_other_course_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'student_submission_migrator'

class MigrateToOtherCourseController < ApplicationController
def show
@old_course = Course.find(params[:course_id])
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/setup/course_details_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'course_refresh_database_updater'

class Setup::CourseDetailsController < Setup::SetupController
before_action :set_course, except: %i[new create]

Expand Down
1 change: 1 addition & 0 deletions app/models/course_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Course stub to be copied by teachers for their own organisations

require 'net/http'
require 'system_commands'

class CourseTemplate < ApplicationRecord
include SystemCommands
Expand Down
2 changes: 2 additions & 0 deletions app/models/deadline_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'date_and_time_utils'

# Parses and abstracts specification in the "deadline" field of a `metadata.yml` file.
class DeadlineSpec # (the name of this class is unfortunate as it confuses IDEs when jumping to tests)
class InvalidSyntaxError < StandardError; end
Expand Down
2 changes: 2 additions & 0 deletions app/models/exercise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

require 'shellwords'

require 'date_and_time_utils'

class Exercise < ApplicationRecord
self.include_root_in_json = false
include Swagger::Blocks
Expand Down
1 change: 1 addition & 0 deletions app/models/submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'zlib'
require 'securerandom'
require 'submission_packager'

class Submission < ApplicationRecord
include Swagger::Blocks
Expand Down
2 changes: 2 additions & 0 deletions app/models/unlock_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'date_and_time_utils'

# Parses and abstracts specification in the "unlocked_after" field of a `metadata.yml` file.
class UnlockSpec # (the name of this class is unfortunate as it confuses IDEs when jumping to tests)
class InvalidSyntaxError < StandardError; end
Expand Down
2 changes: 2 additions & 0 deletions config/site_tailoring.example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

# Optionally copy this file to site_tailoring.rb and
# override methods defined in lib/tailoring.rb here.
require 'tailoring'

class SiteTailoring < Tailoring
end
1 change: 1 addition & 0 deletions lib/course_info.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'natsort'
require 'course_list'

# Builds /courses/:id.json
class CourseInfo
Expand Down
2 changes: 2 additions & 0 deletions lib/course_list.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require 'natsort'

# Builds /courses.json
class CourseList
def initialize(user, helpers)
Expand Down
1 change: 1 addition & 0 deletions lib/course_refresh_database_updater.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'benchmark'
require 'system_commands'

class CourseRefreshDatabaseUpdater
def refresh_course(course, refreshed_course_data)
Expand Down
1 change: 1 addition & 0 deletions lib/doc_gen/shell_session.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'cgi' # for escapeHTML
require 'doc_gen'

class DocGen
# A shell session where the interaction can be printed to the generated document.
Expand Down
2 changes: 2 additions & 0 deletions lib/sandbox_results_saver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Saves results from a remote sandbox to the database.
#
# See also: TestRunGrader
require 'test_run_grader'

module SandboxResultsSaver
class InvalidTokenError < RuntimeError; end

Expand Down
1 change: 1 addition & 0 deletions lib/submission_packager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'tmpdir'
require 'fileutils'
require 'rust_langs_cli_executor'

# Takes a submission zip and makes a tar file suitable for the sandbox
class SubmissionPackager
Expand Down
1 change: 1 addition & 0 deletions spec/integration/admin_usecases_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'spec_helper'
require 'submission_processor'

describe 'The system (used by an instructor for administration)', type: :request, integration: true do
include IntegrationTestActions
Expand Down
1 change: 1 addition & 0 deletions spec/lib/course_refresh_database_updater_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'spec_helper'
require 'course_refresh_database_updater'

describe CourseRefreshDatabaseUpdater do
include GitTestActions
Expand Down
1 change: 1 addition & 0 deletions spec/lib/date_and_time_utils_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'spec_helper'
require 'date_and_time_utils'

describe DateAndTimeUtils do
describe '#to_time' do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/file_tree_hasher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'spec_helper'
require 'fileutils'
require 'file_tree_hasher'

describe FileTreeHasher do
def write_file(path, content)
Expand Down
2 changes: 2 additions & 0 deletions spec/lib/submission_packager/java_maven_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require 'tmpdir'
require 'shellwords'
require 'system_commands'
require 'submission_packager'
require 'rust_langs_cli_executor'

# There is some functionality in common with JavaSimple. We mostly only test that in java_simple_spec.rb.
describe SubmissionPackager do
Expand Down
1 change: 1 addition & 0 deletions spec/lib/submission_processor_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'spec_helper'
require 'submission_processor'

describe SubmissionProcessor do
def expect_processing
Expand Down
1 change: 1 addition & 0 deletions spec/lib/test_run_grader_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'spec_helper'
require 'test_run_grader'

describe TestRunGrader do
include GitTestActions
Expand Down
1 change: 1 addition & 0 deletions spec/lib/version_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'spec_helper'
require 'version'

describe Version do
it 'splits the version string into components' do
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
require 'fileutils'
require 'capybara/poltergeist'
require 'simplecov'
require 'tailoring'
# require 'rspec_remote_formatter'
SimpleCov.start 'rails' do
add_filter '/bin/'
Expand Down
1 change: 1 addition & 0 deletions spec/support/remote_sandbox_for_testing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'fileutils'
require 'system_commands'
require 'sandbox_results_saver'

class RemoteSandboxForTesting
@server_pids = nil
Expand Down
1 change: 1 addition & 0 deletions spec/usermanual/usermanual_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'spec_helper'
require 'doc_gen'

describe 'User manual', type: :request, usermanual: true, integration: true do
def make_page(name)
Expand Down

0 comments on commit e88df6a

Please sign in to comment.