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:
- db/migrate/**/*
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Style/IndentationConsistency:
EnforcedStyle: rails
Exclude:

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
source 'https://rubygems.org'
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,
# 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
before_action :set_account, only: [:show, :edit, :reveal, :update, :destroy]

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 AuthController < ApplicationController
skip_before_action :verify_session

View File

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

View File

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

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 AppConfig < Settingslogic
source "#{Rails.root}/config/application.yml"
namespace Rails.env

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'openssl'
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.url account_url(account, format: :json)

View File

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

View File

@ -1 +1,2 @@
# frozen_string_literal: true
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.
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
# 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
# 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: '_ftp_manager_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
get 'accounts/reveal/:id', to: 'accounts#reveal', as: :reveal_password
resources :accounts

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 CreateAccounts < ActiveRecord::Migration[5.0]
def change
create_table :accounts do |t|

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'test_helper'
class AppConfigTest < 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
ENV['RAILS_ENV'] ||= 'test'
# https://github.com/colszowka/simplecov

View File

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