string literals; why not.

This commit is contained in:
Mark Moser 2016-09-18 09:41:51 -05:00
parent 371a279d9e
commit 12332cc6bf
42 changed files with 45 additions and 0 deletions

View File

@ -19,6 +19,10 @@ Style/ExtraSpacing:
Exclude: Exclude:
- db/migrate/**/* - db/migrate/**/*
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Style/IndentationConsistency: Style/IndentationConsistency:
EnforcedStyle: rails EnforcedStyle: rails
Exclude: Exclude:

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class AccountsController < ApplicationController class AccountsController < ApplicationController
before_action :set_account, only: [:show, :edit, :reveal, :update, :destroy] before_action :set_account, only: [:show, :edit, :reveal, :update, :destroy]

View File

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

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class AuthController < ApplicationController class AuthController < ApplicationController
skip_before_action :verify_session skip_before_action :verify_session

View File

@ -1,2 +1,3 @@
# frozen_string_literal: true
module ApplicationHelper module ApplicationHelper
end end

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
class Account < ApplicationRecord class Account < ApplicationRecord
serialize :password, CryptSerializer serialize :password, CryptSerializer
end end

View File

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

View File

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

View File

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

View File

@ -1,2 +1,3 @@
# frozen_string_literal: true
json.extract! account, :id, :username, :password, :home, :site, :created_at, :updated_at json.extract! account, :id, :username, :password, :home, :site, :created_at, :updated_at
json.url account_url(account, format: :json) json.url account_url(account, format: :json)

View File

@ -1 +1,2 @@
# frozen_string_literal: true
json.array! @accounts, partial: 'accounts/account', as: :account json.array! @accounts, partial: 'accounts/account', as: :account

View File

@ -1 +1,2 @@
# frozen_string_literal: true
json.partial! "accounts/account", account: @account json.partial! "accounts/account", account: @account

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
Rails.application.configure do Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # 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 Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # 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 Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb. # 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. # Be sure to restart your server when you modify this file.
# ApplicationController.renderer.defaults.merge!( # 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. # 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. # 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. # 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. # 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. # Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars. # Specify a serializer for the signed and encrypted cookie jars.

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log 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. # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections # Add new inflection rules using the following format. Inflections

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks: # 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. # Be sure to restart your server when you modify this file.
# #
# This file contains migration options to ease your Rails 5.0 upgrade. # 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. # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_ftp_manager_session' Rails.application.config.session_store :cookie_store, key: '_ftp_manager_session'

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which # 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. # Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum. # The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match # 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 Rails.application.routes.draw do
get 'accounts/reveal/:id', to: 'accounts#reveal', as: :reveal_password get 'accounts/reveal/:id', to: 'accounts#reveal', as: :reveal_password
resources :accounts resources :accounts

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
module TestAuthHelper module TestAuthHelper
## Monkey patch AuthController, because...auth. ## Monkey patch AuthController, because...auth.
AuthController.class_eval do AuthController.class_eval do