Skip to content

Instantly share code, notes, and snippets.

@dskecse
Created April 7, 2017 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dskecse/5a2081c117142692fb2c25fd229515a0 to your computer and use it in GitHub Desktop.
Save dskecse/5a2081c117142692fb2c25fd229515a0 to your computer and use it in GitHub Desktop.
diff --git a/.gitignore b/.gitignore
index 82701fe..9b10e17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,19 +1,8 @@
-# See https://help.github.com/articles/ignoring-files for more about ignoring files.
-#
-# If you find yourself ignoring temporary files generated by your text editor
-# or operating system, you probably want to add a global ignore instead:
-# git config --global core.excludesfile '~/.gitignore_global'
-
-# Ignore bundler config.
/.bundle
-
-# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
-
/node_modules
/yarn-error.log
-
.byebug_history
diff --git a/Gemfile b/Gemfile
index fe46e64..a395486 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,36 +1,20 @@
source 'https://rubygems.org'
git_source(:github) do |repo_name|
- repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
"https://github.com/#{repo_name}.git"
end
-
-# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.0.rc1'
-# Use Puma as the app server
+gem 'pg', '~> 0.18'
gem 'puma', '~> 3.7'
-# Use SCSS for stylesheets
-gem 'sass-rails', github: "rails/sass-rails"
+gem 'sass-rails', github: 'rails/sass-rails'
-# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
-# See https://github.com/rails/execjs#readme for more supported runtimes
-# gem 'therubyracer', platforms: :ruby
-# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
-# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
-# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
-# Use Redis adapter to run Action Cable in production
-# gem 'redis', '~> 3.0'
-# Use ActiveModel has_secure_password
-# gem 'bcrypt', '~> 3.1.7'
-
-# Use Capistrano for deployment
-# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
@@ -44,10 +28,6 @@ group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
- # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
-
-# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
-gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
diff --git a/README.md b/README.md
index 7db80e4..c3c2e55 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,5 @@
-# README
+# Therapists App
-This README would normally document whatever steps are necessary to get the
-application up and running.
+## Setup
-Things you may want to cover:
-
-* Ruby version
-
-* System dependencies
-
-* Configuration
-
-* Database creation
-
-* Database initialization
-
-* How to run the test suite
-
-* Services (job queues, cache servers, search engines, etc.)
-
-* Deployment instructions
-
-* ...
+## Testing
diff --git a/Rakefile b/Rakefile
index e85f913..ed646b6 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,6 +1,3 @@
-# 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.
-
require_relative 'config/application'
Rails.application.load_tasks
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 968d733..7416e47 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -1,15 +1,3 @@
-// This is a manifest file that'll be compiled into application.js, which will include all the files
-// listed below.
-//
-// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
-// vendor/assets/javascripts directory can be referenced here using a relative path.
-//
-// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
-// compiled file. JavaScript code in this file should be added after the last require_* statement.
-//
-// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
-// about supported directives.
-//
//= require rails-ujs
//= require turbolinks
//= require_tree .
diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js
index 739aa5f..dc21442 100644
--- a/app/assets/javascripts/cable.js
+++ b/app/assets/javascripts/cable.js
@@ -1,13 +1,9 @@
-// Action Cable provides the framework to deal with WebSockets in Rails.
-// You can generate new channels where WebSocket features live using the `rails generate channel` command.
-//
//= require action_cable
//= require_self
//= require_tree ./channels
(function() {
- this.App || (this.App = {});
-
- App.cable = ActionCable.createConsumer();
+ this.App || (this.App = {});
+ App.cable = ActionCable.createConsumer();
}).call(this);
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index 865300b..38fa2fb 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -1,15 +1,4 @@
/*
- * This is a manifest file that'll be compiled into application.css, which will include all the files
- * listed below.
- *
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
- * vendor/assets/stylesheets directory can be referenced here using a relative path.
- *
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
- * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
- * files in this directory. Styles in this file should be added after the last require_* statement.
- * It is generally better to create a new file per style scope.
- *
*= require_tree .
*= require_self
*/
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 2d4c89d..2e4667d 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -1,9 +1,10 @@
<!DOCTYPE html>
<html>
<head>
+ <meta charset="utf-8">
<title>TherapistsApp</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
<%= csrf_meta_tags %>
-
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb
index cbd34d2..9ca003f 100644
--- a/app/views/layouts/mailer.html.erb
+++ b/app/views/layouts/mailer.html.erb
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta charset="utf-8">
<style>
/* Email styles need to be inline */
</style>
diff --git a/bin/bundle b/bin/bundle
index 66e9889..a169c9d 100755
--- a/bin/bundle
+++ b/bin/bundle
@@ -1,3 +1,4 @@
#!/usr/bin/env ruby
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
diff --git a/bin/rails b/bin/rails
index 0739660..b93066a 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
diff --git a/bin/rake b/bin/rake
index 1724048..8dbbadb 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+
require_relative '../config/boot'
require 'rake'
Rake.application.run
diff --git a/bin/setup b/bin/setup
index 4abd7fe..a67f7c3 100755
--- a/bin/setup
+++ b/bin/setup
@@ -1,9 +1,9 @@
#!/usr/bin/env ruby
+
require 'pathname'
require 'fileutils'
include FileUtils
-# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
def system!(*args)
@@ -11,21 +11,15 @@ def system!(*args)
end
chdir APP_ROOT do
- # This script is a starting point to setup your application.
- # Add necessary setup steps to this file.
-
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
- system('bundle check') || system!('bundle install')
-
- # Install JavaScript dependencies if using Yarn
- # system('bin/yarn')
-
+ system('bundle check') || system!('bundle install --without production')
+ system('bin/yarn')
- puts "\n== Removing old logs and tempfiles =="
+ puts '\n== Removing old logs and tempfiles =='
system! 'bin/rails log:clear tmp:clear'
- puts "\n== Restarting application server =="
+ puts '\n== Restarting application server =='
system! 'bin/rails restart'
end
diff --git a/bin/update b/bin/update
index dc15867..7e51eca 100755
--- a/bin/update
+++ b/bin/update
@@ -1,9 +1,9 @@
#!/usr/bin/env ruby
+
require 'pathname'
require 'fileutils'
include FileUtils
-# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
def system!(*args)
@@ -11,16 +11,13 @@ def system!(*args)
end
chdir APP_ROOT do
- # This script is a way to update your development environment automatically.
- # Add necessary update steps to this file.
-
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
- system('bundle check') || system!('bundle install')
+ system('bundle check') || system!('bundle install --without production')
- puts "\n== Removing old logs and tempfiles =="
+ puts '\n== Removing old logs and tempfiles =='
system! 'bin/rails log:clear tmp:clear'
- puts "\n== Restarting application server =="
+ puts '\n== Restarting application server =='
system! 'bin/rails restart'
end
diff --git a/bin/yarn b/bin/yarn
index 3ccb9c4..9daafe4 100755
--- a/bin/yarn
+++ b/bin/yarn
@@ -1,10 +1,12 @@
#!/usr/bin/env ruby
+
VENDOR_PATH = File.expand_path('..', __dir__)
+
Dir.chdir(VENDOR_PATH) do
begin
- exec "yarnpkg #{ARGV.join(" ")}"
+ exec "yarnpkg #{ARGV.join(' ')}"
rescue Errno::ENOENT
- puts "Yarn executable was not detected in the system."
- puts "Download Yarn at https://yarnpkg.com/en/docs/install"
+ puts 'Yarn executable was not detected in the system.'
+ puts 'Download Yarn at https://yarnpkg.com/en/docs/install'
end
end
diff --git a/config.ru b/config.ru
index f7ba0b5..b5f2923 100644
--- a/config.ru
+++ b/config.ru
@@ -1,5 +1,3 @@
-# This file is used by Rack-based servers to start the application.
-
require_relative 'config/environment'
run Rails.application
diff --git a/config/application.rb b/config/application.rb
index 8a50934..ebdfaed 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,28 +1,18 @@
require_relative 'boot'
-require "rails"
-# Pick the frameworks you want:
-require "active_model/railtie"
-require "active_job/railtie"
-# require "active_record/railtie"
-require "action_controller/railtie"
-require "action_mailer/railtie"
-require "action_view/railtie"
-require "action_cable/engine"
-require "sprockets/railtie"
-# require "rails/test_unit/railtie"
+require 'rails'
+require 'active_model/railtie'
+require 'active_job/railtie'
+require 'action_controller/railtie'
+require 'action_mailer/railtie'
+require 'action_view/railtie'
+require 'action_cable/engine'
+require 'sprockets/railtie'
-# Require the gems listed in Gemfile, including any gems
-# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module TherapistsApp
class Application < Rails::Application
- # Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.1
-
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration should go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded.
end
end
diff --git a/config/boot.rb b/config/boot.rb
index 30f5120..5cea2ab 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,3 +1,3 @@
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
-require 'bundler/setup' # Set up gems listed in the Gemfile.
+require 'bundler/setup'
diff --git a/config/environment.rb b/config/environment.rb
index 426333b..875ab0f 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -1,5 +1,3 @@
-# Load the Rails application.
require_relative 'application'
-# Initialize the Rails application.
Rails.application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
index c2c04cb..376b5e4 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,18 +1,10 @@
Rails.application.configure do
- # Settings specified here will take precedence over those in config/application.rb.
-
- # In the development environment your application's code is reloaded on
- # every request. This slows down response time but is perfect for development
- # since you don't have to restart the web server when you make code changes.
config.cache_classes = false
- # Do not eager load code on boot.
config.eager_load = false
- # Show full error reports.
config.consider_all_requests_local = true
- # Enable/disable caching. By default caching is disabled.
if Rails.root.join('tmp/caching-dev.txt').exist?
config.action_controller.perform_caching = true
@@ -26,26 +18,18 @@ Rails.application.configure do
config.cache_store = :null_store
end
- # Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false
- # Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
- # Debug mode disables concatenation and preprocessing of assets.
- # This option may cause significant delays in view rendering with a large
- # number of complex assets.
config.assets.debug = true
- # Suppress logger output for asset requests.
config.assets.quiet = true
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
- # Use an evented file watcher to asynchronously detect changes in source code,
- # routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index c4b65b5..e0f433f 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,37 +1,20 @@
Rails.application.configure do
- # Settings specified here will take precedence over those in config/application.rb.
-
- # Code is not reloaded between requests.
config.cache_classes = true
- # Eager load code on boot. This eager loads most of Rails and
- # your application in memory, allowing both threaded web servers
- # and those relying on copy on write to perform better.
- # Rake tasks automatically ignore this option for performance.
config.eager_load = true
- # Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
- # Attempt to read encrypted secrets from `config/secrets.yml.enc`.
- # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
- # `config/secrets.yml.key`.
config.read_encrypted_secrets = true
- # Disable serving static files from the `/public` folder by default since
- # Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
- # Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
- # Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
- # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
@@ -47,12 +30,9 @@ Rails.application.configure do
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
- # Use the lowest log level to ensure availability of diagnostic information
- # when problems arise.
config.log_level = :debug
- # Prepend all log lines with the following tags.
- config.log_tags = [ :request_id ]
+ config.log_tags = [:request_id]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
@@ -60,27 +40,24 @@ Rails.application.configure do
# Use a real queuing backend for Active Job (and separate queues per environment)
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "therapists_app_#{Rails.env}"
+
config.action_mailer.perform_caching = false
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
- # the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
- # Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
- # Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Use a different logger for distributed setups.
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
- if ENV["RAILS_LOG_TO_STDOUT"].present?
+ if ENV['RAILS_LOG_TO_STDOUT'].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 8e5cbde..ed65c2b 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -1,40 +1,23 @@
Rails.application.configure do
- # Settings specified here will take precedence over those in config/application.rb.
-
- # The test environment is used exclusively to run your application's
- # test suite. You never need to work with it otherwise. Remember that
- # your test database is "scratch space" for the test suite and is wiped
- # and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
- # Do not eager load code on boot. This avoids loading your whole application
- # just for the purpose of running a single test. If you are using a tool that
- # preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
- # Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
}
- # Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
- # Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
- # Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
config.action_mailer.perform_caching = false
- # Tell Action Mailer not to deliver emails to the real world.
- # The :test delivery method accumulates sent emails in the
- # ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- # Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
# Raises error for missing translations
diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb
index 51639b6..58d1035 100644
--- a/config/initializers/application_controller_renderer.rb
+++ b/config/initializers/application_controller_renderer.rb
@@ -1,5 +1,3 @@
-# Be sure to restart your server when you modify this file.
-
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index 4b828e8..8b684fb 100644
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -1,6 +1,3 @@
-# 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.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path.
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
index 59385cd..b6fbfde 100644
--- a/config/initializers/backtrace_silencers.rb
+++ b/config/initializers/backtrace_silencers.rb
@@ -1,5 +1,3 @@
-# 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.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb
index 5a6a32d..d6ddeb1 100644
--- a/config/initializers/cookies_serializer.rb
+++ b/config/initializers/cookies_serializer.rb
@@ -1,5 +1,3 @@
-# Be sure to restart your server when you modify this file.
-
# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails.application.config.action_dispatch.cookies_serializer = :json
diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb
index 4a994e1..e203fce 100644
--- a/config/initializers/filter_parameter_logging.rb
+++ b/config/initializers/filter_parameter_logging.rb
@@ -1,4 +1,2 @@
-# Be sure to restart your server when you modify this file.
-
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
index ac033bf..1d5fa98 100644
--- a/config/initializers/inflections.rb
+++ b/config/initializers/inflections.rb
@@ -1,5 +1,3 @@
-# Be sure to restart your server when you modify this file.
-
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
index dc18996..1a52c0b 100644
--- a/config/initializers/mime_types.rb
+++ b/config/initializers/mime_types.rb
@@ -1,4 +1,2 @@
-# Be sure to restart your server when you modify this file.
-
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
index 633c1c8..7129ac6 100644
--- a/config/initializers/wrap_parameters.rb
+++ b/config/initializers/wrap_parameters.rb
@@ -1,8 +1,3 @@
-# Be sure to restart your server when you modify this file.
-
-# This file contains settings for ActionController::ParamsWrapper which
-# is enabled by default.
-
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json]
diff --git a/config/locales/en.yml b/config/locales/en.yml
index decc5a8..a9f72ec 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1,33 +1,2 @@
-# Files in the config/locales directory are used for internationalization
-# and are automatically loaded by Rails. If you want to use locales other
-# than English, add the necessary files in this directory.
-#
-# To use the locales, use `I18n.t`:
-#
-# I18n.t 'hello'
-#
-# In views, this is aliased to just `t`:
-#
-# <%= t('hello') %>
-#
-# To use a different locale, set it with `I18n.locale`:
-#
-# I18n.locale = :es
-#
-# This would use the information in config/locales/es.yml.
-#
-# The following keys must be escaped otherwise they will not be retrieved by
-# the default I18n backend:
-#
-# true, false, on, off, yes, no
-#
-# Instead, surround them with single quotes.
-#
-# en:
-# 'true': 'foo'
-#
-# To learn more, please read the Rails Internationalization guide
-# available at http://guides.rubyonrails.org/i18n.html.
-
en:
hello: "Hello world"
diff --git a/config/puma.rb b/config/puma.rb
index 1e19380..4699130 100644
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -1,56 +1,19 @@
-# 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
-# the maximum value specified for Puma. Default is set to 5 threads for minimum
-# and maximum; this matches the default thread size of Active Record.
-#
-threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
+threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
threads threads_count, threads_count
-# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
-#
-port ENV.fetch("PORT") { 3000 }
+port ENV.fetch('PORT') { 3000 }
-# Specifies the `environment` that Puma will run in.
-#
-environment ENV.fetch("RAILS_ENV") { "development" }
+environment ENV.fetch('RAILS_ENV') { 'development' }
-# Specifies the number of `workers` to boot in clustered mode.
-# Workers are forked webserver processes. If using threads and workers together
-# the concurrency of the application would be max `threads` * `workers`.
-# Workers do not work on JRuby or Windows (both of which do not support
-# processes).
-#
-# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
-
-# Use the `preload_app!` method when specifying a `workers` number.
-# This directive tells Puma to first boot the application and load code
-# before forking the application. This takes advantage of Copy On Write
-# process behavior so workers use less memory. If you use this option
-# you need to make sure to reconnect any threads in the `on_worker_boot`
-# block.
-#
+# workers ENV.fetch('WEB_CONCURRENCY') { 2 }
# preload_app!
-# If you are preloading your application and using Active Record, it's
-# recommended that you close any connections to the database before workers
-# are forked to prevent connection leakage.
-#
# before_fork do
# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
# end
-# The code in the `on_worker_boot` will be called if you are using
-# clustered mode by specifying a number of `workers`. After each worker
-# process is booted, this block will be run. If you are using the `preload_app!`
-# option, you will want to use this block to reconnect to any threads
-# or connections that may have been created at application boot, as Ruby
-# cannot share connections between processes.
-#
# on_worker_boot do
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
# end
-#
-# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart
diff --git a/config/routes.rb b/config/routes.rb
index 787824f..1daf9a4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,3 +1,2 @@
Rails.application.routes.draw do
- # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
diff --git a/config/secrets.yml b/config/secrets.yml
index 4f396f7..d3683a2 100644
--- a/config/secrets.yml
+++ b/config/secrets.yml
@@ -1,32 +1,11 @@
-# Be sure to restart your server when you modify this file.
-
-# Your secret key is used for verifying the integrity of signed cookies.
-# If you change this key, all old signed cookies will become invalid!
-
-# Make sure the secret is at least 30 characters and all random,
-# no regular words or you'll be exposed to dictionary attacks.
-# You can use `rails secret` to generate a secure secret key.
-
-# Make sure the secrets in this file are kept private
-# if you're sharing your code publicly.
-
-# Shared secrets are available across all environments.
-
shared:
api_key: 123
-# Environmental secrets are only available for that specific environment.
-
development:
secret_key_base: 238066857e472d414426062efb277009dcc909bc9ebd263826c6742b0c53f31806773a68464b0dfbf5e7ee681e5c378c93bb540a87d8361f8d83fadb6dfa6f99
test:
secret_key_base: e86de0564b92f77148a2c4a6905e0138ce3b6089d05e51b7272e7fae712f184fad0fdf28c375b809ac57b56a2a28491bde255f7029d7f39b7583fcf402c7d0af
-# Do not keep production secrets in the unencrypted secrets file.
-# Instead, either read values from the environment.
-# Or, use `bin/rails secrets:setup` to configure encrypted secrets
-# and move the `production:` environment over there.
-
production:
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
+ secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment