string literals; why not.
This commit is contained in:
parent
371a279d9e
commit
12332cc6bf
@ -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:
|
||||||
|
1
Gemfile
1
Gemfile
@ -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'
|
||||||
|
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,
|
# 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.
|
||||||
|
|
||||||
|
@ -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]
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
class AuthController < ApplicationController
|
class AuthController < ApplicationController
|
||||||
skip_before_action :verify_session
|
skip_before_action :verify_session
|
||||||
|
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
class Account < ApplicationRecord
|
class Account < ApplicationRecord
|
||||||
serialize :password, CryptSerializer
|
serialize :password, CryptSerializer
|
||||||
end
|
end
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
class ApplicationRecord < ActiveRecord::Base
|
class ApplicationRecord < ActiveRecord::Base
|
||||||
self.abstract_class = true
|
self.abstract_class = true
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'openssl'
|
require 'openssl'
|
||||||
require 'base64'
|
require 'base64'
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
@ -1 +1,2 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
json.array! @accounts, partial: 'accounts/account', as: :account
|
json.array! @accounts, partial: 'accounts/account', as: :account
|
||||||
|
@ -1 +1,2 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
json.partial! "accounts/account", account: @account
|
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.
|
# This file is used by Rack-based servers to start the application.
|
||||||
|
|
||||||
require_relative 'config/environment'
|
require_relative 'config/environment'
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require_relative 'boot'
|
require_relative 'boot'
|
||||||
|
|
||||||
require 'rails/all'
|
require 'rails/all'
|
||||||
|
@ -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.
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
# Load the Rails application.
|
# Load the Rails application.
|
||||||
require_relative 'application'
|
require_relative 'application'
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
|
||||||
|
@ -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!(
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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
|
||||||
|
@ -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:
|
||||||
|
@ -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.
|
||||||
|
@ -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'
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
%w(
|
%w(
|
||||||
.ruby-version
|
.ruby-version
|
||||||
.rbenv-vars
|
.rbenv-vars
|
||||||
|
@ -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|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class AccountsControllerTest < ActionDispatch::IntegrationTest
|
class AccountsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class AuthControllerTest < ActionDispatch::IntegrationTest
|
class AuthControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class AccountTest < ActiveSupport::TestCase
|
class AccountTest < ActiveSupport::TestCase
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class AppConfigTest < ActiveSupport::TestCase
|
class AppConfigTest < ActiveSupport::TestCase
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class CryptSerializerTest < ActiveSupport::TestCase
|
class CryptSerializerTest < ActiveSupport::TestCase
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user