string literals; why not.
This commit is contained in:
parent
371a279d9e
commit
12332cc6bf
@ -19,6 +19,10 @@ Style/ExtraSpacing:
|
||||
Exclude:
|
||||
- db/migrate/**/*
|
||||
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: true
|
||||
EnforcedStyle: always
|
||||
|
||||
Style/IndentationConsistency:
|
||||
EnforcedStyle: rails
|
||||
Exclude:
|
||||
|
1
Gemfile
1
Gemfile
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'figaro', '~> 1.1.1'
|
||||
|
1
Rakefile
1
Rakefile
@ -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.
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class AccountsController < ApplicationController
|
||||
before_action :set_account, only: [:show, :edit, :reveal, :update, :destroy]
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class AuthController < ApplicationController
|
||||
skip_before_action :verify_session
|
||||
|
||||
|
@ -1,2 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
module ApplicationHelper
|
||||
end
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class Account < ApplicationRecord
|
||||
serialize :password, CryptSerializer
|
||||
end
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class ApplicationRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class AppConfig < Settingslogic
|
||||
source "#{Rails.root}/config/application.yml"
|
||||
namespace Rails.env
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
require 'openssl'
|
||||
require 'base64'
|
||||
|
||||
|
@ -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)
|
||||
|
@ -1 +1,2 @@
|
||||
# frozen_string_literal: true
|
||||
json.array! @accounts, partial: 'accounts/account', as: :account
|
||||
|
@ -1 +1,2 @@
|
||||
# frozen_string_literal: true
|
||||
json.partial! "accounts/account", account: @account
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
# This file is used by Rack-based servers to start the application.
|
||||
|
||||
require_relative 'config/environment'
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
require_relative 'boot'
|
||||
|
||||
require 'rails/all'
|
||||
|
@ -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.
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
# Load the Rails application.
|
||||
require_relative 'application'
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# ApplicationController.renderer.defaults.merge!(
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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.
|
||||
|
@ -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'
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
%w(
|
||||
.ruby-version
|
||||
.rbenv-vars
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
class CreateAccounts < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :accounts do |t|
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
require 'test_helper'
|
||||
|
||||
class AccountsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
require 'test_helper'
|
||||
|
||||
class AuthControllerTest < ActionDispatch::IntegrationTest
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
require 'test_helper'
|
||||
|
||||
class AccountTest < ActiveSupport::TestCase
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
require 'test_helper'
|
||||
|
||||
class AppConfigTest < ActiveSupport::TestCase
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
require 'test_helper'
|
||||
|
||||
class CryptSerializerTest < ActiveSupport::TestCase
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
ENV['RAILS_ENV'] ||= 'test'
|
||||
|
||||
# https://github.com/colszowka/simplecov
|
||||
|
@ -1,3 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
module TestAuthHelper
|
||||
## Monkey patch AuthController, because...auth.
|
||||
AuthController.class_eval do
|
||||
|
Loading…
Reference in New Issue
Block a user