rubocop noise: fixes FrozenStringLiteralComment

Adding the .ruby-verison file triggered previously un-run cops, specifically:

  This cop is designed to help upgrade to Ruby 3.0. It will add the
  comment `# frozen_string_literal: true` to the top of files to enable
  frozen string literals. Frozen string literals will be default in Ruby
  3.0. The comment will be added below a shebang and encoding comment. The
  frozen string literal comment is only valid in Ruby 2.3+.

More info on rubocop [Automatic-Corrections](https://github.com/bbatsov/rubocop/wiki/Automatic-Corrections)
This commit is contained in:
Mark Moser 2016-09-08 10:25:33 -05:00
parent 20614a7fce
commit 4bbd93ded1
114 changed files with 114 additions and 2 deletions

View File

@ -1 +1 @@
rvm --ruby-version use 2.3.1
2.3.1

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
source 'https://rubygems.org'
gem 'figaro', '~> 1.1.1'

View File

@ -268,7 +268,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
unicode-display_width (1.1.0)
unicode-display_width (1.1.1)
web-console (3.3.1)
actionview (>= 5.0)
activemodel (>= 5.0)

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module ApplicationCable
class Channel < ActionCable::Channel::Base
end

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module ApplicationCable
class Connection < ActionCable::Connection::Base
end

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Admin
class AuthController < AdminController
skip_before_action :authorize_admin

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Admin
class ProfileController < AdminController
def view

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Admin
class QuestionController < AdminController
def index

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Admin
class QuizController < AdminController
def index

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module Admin
class UserController < AdminController
def index

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class AdminController < ApplicationController
layout 'admin'
before_action :authorize_admin

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class CandidateController < ApplicationController
before_action :authorize_candidate, except: [:login, :validate, :live_coder]
before_action :send_to_oops, only: [:login]

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class QuizController < ApplicationController
before_action :authorize_candidate

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class RecruiterController < ApplicationController
before_action :authorize_recruiter, except: [:login, :auth]

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class ReviewController < ApplicationController
before_action :authorize_reviewer, except: [:login, :auth]

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module ApplicationHelper
def experience_options val
options_for_select([

View File

@ -1,2 +1,3 @@
# frozen_string_literal: true
class ApplicationJob < ActiveJob::Base
end

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
default from: ENV['default_mail_from']
layout 'mailer'

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class CandidateMailer < ApplicationMailer
def welcome candidate
@candidate = candidate

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class RecruiterMailer < ApplicationMailer
def candidate_created candidate
@candidate = candidate

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class ReviewerMailer < ApplicationMailer
def candidate_submission candidate
@candidate = candidate

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class UserMailer < ApplicationMailer
def password_reset user
@user = user

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Answer < ApplicationRecord
serialize :answer

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Candidate < ApplicationRecord
belongs_to :quiz
has_many :questions, -> { order("sort") }, through: :quiz

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Question < ApplicationRecord
serialize :input_options

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Quiz < ApplicationRecord
has_many :questions, -> { order(:sort) }
has_many :candidates

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class User < ApplicationRecord
has_secure_password
has_many :candidates, foreign_key: "recruiter_id"

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'openssl'
require 'base64'

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class SkillConfig < Settingslogic
source "#{Rails.root}/config/application.yml"
namespace Rails.env

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class AnswerFormatValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
send(record.question.input_type, record, attribute, value)

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class EmailFormatValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
# EMAIL regex test

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class InputOptionsPresenceValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
return true unless record.input_type =~ /radio|check/i

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class CandidateQuiz
attr_reader :candidate_id

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class CandidateQuizQuestion
attr_reader :row

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class QuizStatus
attr_reader :candidate

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Reminder
def initialize
@collection = reminder_collection

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# This file is used by Rack-based servers to start the application.
require_relative 'config/environment'

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative 'boot'
require 'rails/all'

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' # Set up gems listed in the Gemfile.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Load the Rails application.
require_relative 'application'

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# ApplicationController.renderer.defaults.merge!(

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# TODO: needs better wrapping instead of nuking
# https://rubyplus.com/articles/3401
ActionView::Base.field_error_proc = proc do |html_tag, _instance|

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
Mailjet.configure do |config|
config.api_key = ENV['mailjet_key']
config.secret_key = ENV['mailjet_secret']

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.0 upgrade.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_skill-assessment-app_session'

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.routes.draw do
post "/admin/login", to: "admin/auth#auth", as: :admin_auth
get "/admin/login", to: "admin/auth#login", as: :admin_login

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
%w(
.ruby-version
.rbenv-vars

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class DbInit < ActiveRecord::Migration[5.0]
def change
create_table :candidates do |t|

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class AddQuizToCandidate < ActiveRecord::Migration[5.0]
def change
add_column :candidates, :quiz_id, :integer

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class AddAttachmentsToQuestions < ActiveRecord::Migration[5.0]
def change
add_column :questions, :attachment, :string

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class AddNameToQuiz < ActiveRecord::Migration[5.0]
def change
add_column :quizzes, :name, :string, after: :id

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class AddResetsToUsers < ActiveRecord::Migration[5.0]
def change
add_column :users, :reset_token, :string

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class EncodeCandidateEmails < ActiveRecord::Migration[5.0]
def change
sql = "select id, email from candidates;"

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
namespace :reminders do
desc "send reminders to stagnate quizes"
task send_all: :environment do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
module Admin

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
module Admin

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
module Admin

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
module Admin

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
module Admin

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class AdminControllerTest < ActionDispatch::IntegrationTest

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class ApplicationControllerTest < ActionDispatch::IntegrationTest

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class CandidateControllerTest < ActionDispatch::IntegrationTest

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class QuizControllerTest < ActionDispatch::IntegrationTest

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class RecruiterControllerTest < ActionDispatch::IntegrationTest

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class ReviewControllerTest < ActionDispatch::IntegrationTest

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class QuestionAttachmentsTest < ActionDispatch::IntegrationTest

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class QuestionFlowTest < ActionDispatch::IntegrationTest

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class QuestionLiveCoderTest < ActionDispatch::IntegrationTest

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class CandidateMailerTest < ActionMailer::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Preview all emails at http://localhost:3000/rails/mailers/candidate_mailer
class CandidateMailerPreview < ActionMailer::Preview
def welcome

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Preview all emails at http://localhost:3000/rails/mailers/recruiter_mailer
class RecruiterMailerPreview < ActionMailer::Preview
def candidate_created

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Preview all emails at http://localhost:3000/rails/mailers/reviewer_mailer
class ReviewerMailerPreview < ActionMailer::Preview
def candidate_submission

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Preview all emails at http://localhost:3000/rails/mailers/user_mailer
class UserMailerPreview < ActionMailer::Preview
def password_reset

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class RecruiterMailerTest < ActionMailer::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class ReviewerMailerTest < ActionMailer::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class UserMailerTest < ActionMailer::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class AnswerTest < ActiveSupport::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class CandidateTest < ActiveSupport::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class QuestionTest < ActiveSupport::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class QuizTest < ActiveSupport::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class UserTest < ActiveSupport::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class CryptSerializerTest < ActiveSupport::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class SkillConfigTest < ActiveSupport::TestCase

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
ENV['RAILS_ENV'] ||= 'test'
# https://github.com/colszowka/simplecov

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class AnswerValidatable
include ActiveModel::Validations

Some files were not shown because too many files have changed in this diff Show More