aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhenium <rhenium@rhe.jp>2014-03-13 22:34:36 +0900
committerRhenium <rhenium@rhe.jp>2014-03-13 22:34:36 +0900
commitff11dfd29dcf731030f7e640d1a73642d62baab7 (patch)
tree3d28e3524893d4e016be3d6525f32b54855c168c
parentc50b8b97993bd6e168afb34f25dac23c3f85ae6b (diff)
downloadaclog-ff11dfd29dcf731030f7e640d1a73642d62baab7.tar.gz
upgrade Rails to 4.1.0.rc1, add Guard, Spring
-rw-r--r--.gitignore1
-rw-r--r--.rspec1
-rw-r--r--Gemfile31
-rw-r--r--Gemfile.lock142
-rw-r--r--Guardfile24
-rw-r--r--README.md10
-rw-r--r--Rakefile2
-rw-r--r--app/assets/javascripts/application.js.erb1
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--app/views/layouts/_base.html.haml5
-rwxr-xr-xbin/rails4
-rwxr-xr-xbin/rake4
-rwxr-xr-xbin/rspec7
-rwxr-xr-xbin/spring18
-rw-r--r--config.ru4
-rw-r--r--config/application.rb5
-rw-r--r--config/boot.rb2
-rw-r--r--config/database.yml.example29
-rw-r--r--config/environment.rb6
-rw-r--r--config/environments/development.rb12
-rw-r--r--config/environments/production.rb9
-rw-r--r--config/environments/test.rb7
-rw-r--r--config/initializers/ar_mysql.rb2
-rw-r--r--config/initializers/cookies_serializer.rb3
-rw-r--r--config/initializers/haml.rb1
-rw-r--r--config/initializers/omniauth.rb1
-rw-r--r--config/initializers/session_store.rb2
-rw-r--r--config/routes.rb4
-rw-r--r--config/secrets.yml20
-rw-r--r--config/secrets.yml.example (renamed from config/initializers/secret_token.rb.example)12
-rw-r--r--spec/spec_helper.rb4
31 files changed, 252 insertions, 123 deletions
diff --git a/.gitignore b/.gitignore
index ed1c1f0..703fcaa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,4 +19,5 @@
!.gitkeep
!/.coveralls.yml
!/.travis.yml
+!/.rspec
diff --git a/.rspec b/.rspec
new file mode 100644
index 0000000..4e1e0d2
--- /dev/null
+++ b/.rspec
@@ -0,0 +1 @@
+--color
diff --git a/Gemfile b/Gemfile
index a02f2a0..1692d3f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,43 +1,42 @@
source "https://rubygems.org"
-gem "rails", "~> 4.0.3"
+gem "rails", "~> 4.1.0.rc1"
gem "mysql2"
gem "settingslogic"
gem "yajl-ruby", require: "yajl"
gem "grape", github: "intridea/grape"
gem "grape-rabl"
-gem "twitter"
-gem "twitter-text"
-gem "omniauth-twitter"
gem "haml-rails"
gem "sass-rails"
-gem "coffee-rails"
gem "uglifier"
gem "jquery-rails"
gem "bootstrap-sass"
+gem "turbolinks"
+
+gem "puma"
+gem "dalli"
+gem "connection_pool"
+
+gem "omniauth-twitter"
+gem "twitter"
+gem "twitter-text"
gem "daemon-spawn", require: "daemon_spawn"
gem "msgpack"
gem "msgpack-rpc"
gem "em-work_queue"
gem "pry-rails"
-group :production do
- gem "puma"
- gem "dalli"
- gem "connection_pool"
-end
-
-group :development do
- gem "thin"
+group :development, :test do
gem "quiet_assets"
+ gem "spring"
end
group :test do
- gem "rspec"
+ gem "webmock"
gem "rspec-rails"
+ gem "spring-commands-rspec"
+ gem "guard-rspec"
gem "factory_girl_rails"
- gem "webmock"
gem "coveralls", require: false
gem "simplecov", require: false
end
-
diff --git a/Gemfile.lock b/Gemfile.lock
index 066bbfe..52c54db 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -16,40 +16,48 @@ GIT
GEM
remote: https://rubygems.org/
specs:
- actionmailer (4.0.3)
- actionpack (= 4.0.3)
+ actionmailer (4.1.0.rc1)
+ actionpack (= 4.1.0.rc1)
+ actionview (= 4.1.0.rc1)
mail (~> 2.5.4)
- actionpack (4.0.3)
- activesupport (= 4.0.3)
- builder (~> 3.1.0)
- erubis (~> 2.7.0)
+ actionpack (4.1.0.rc1)
+ actionview (= 4.1.0.rc1)
+ activesupport (= 4.1.0.rc1)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
- activemodel (4.0.3)
- activesupport (= 4.0.3)
- builder (~> 3.1.0)
- activerecord (4.0.3)
- activemodel (= 4.0.3)
- activerecord-deprecated_finders (~> 1.0.2)
- activesupport (= 4.0.3)
- arel (~> 4.0.0)
- activerecord-deprecated_finders (1.0.3)
- activesupport (4.0.3)
- i18n (~> 0.6, >= 0.6.4)
- minitest (~> 4.2)
- multi_json (~> 1.3)
+ actionview (4.1.0.rc1)
+ activesupport (= 4.1.0.rc1)
+ builder (~> 3.1)
+ erubis (~> 2.7.0)
+ activemodel (4.1.0.rc1)
+ activesupport (= 4.1.0.rc1)
+ builder (~> 3.1)
+ activerecord (4.1.0.rc1)
+ activemodel (= 4.1.0.rc1)
+ activesupport (= 4.1.0.rc1)
+ arel (~> 5.0.0)
+ activesupport (4.1.0.rc1)
+ i18n (~> 0.6, >= 0.6.9)
+ json (~> 1.7, >= 1.7.7)
+ minitest (~> 5.1)
thread_safe (~> 0.1)
- tzinfo (~> 0.3.37)
+ tzinfo (~> 1.1)
addressable (2.3.5)
- arel (4.0.2)
+ arel (5.0.0)
atomic (1.1.15)
- axiom-types (0.0.5)
- descendants_tracker (~> 0.0.1)
- ice_nine (~> 0.9)
+ axiom-types (0.1.0)
+ descendants_tracker (~> 0.0.3)
+ ice_nine (~> 0.11.0)
+ thread_safe (~> 0.1.3)
bootstrap-sass (3.1.1.0)
sass (~> 3.2)
buftok (0.2.0)
- builder (3.1.4)
+ builder (3.2.2)
+ celluloid (0.15.2)
+ timers (~> 1.1.0)
+ celluloid-io (0.15.0)
+ celluloid (>= 0.15.0)
+ nio4r (>= 0.5.0)
coderay (1.1.0)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
@@ -72,7 +80,6 @@ GEM
crack (0.4.2)
safe_yaml (~> 1.0.0)
daemon-spawn (0.4.2)
- daemons (1.1.9)
dalli (2.7.0)
descendants_tracker (0.0.3)
diff-lcs (1.2.5)
@@ -90,11 +97,22 @@ GEM
railties (>= 3.0.0)
faraday (0.9.0)
multipart-post (>= 1.2, < 3)
+ ffi (1.9.3)
+ formatador (0.2.4)
grape-rabl (0.2.2)
grape
i18n
rabl
tilt
+ guard (2.5.1)
+ formatador (>= 0.2.4)
+ listen (~> 2.6)
+ lumberjack (~> 1.0)
+ pry (>= 0.9.12)
+ thor (>= 0.18.1)
+ guard-rspec (4.2.8)
+ guard (~> 2.1)
+ rspec (>= 2.14, < 4.0)
haml (4.0.5)
tilt
haml-rails (0.5.3)
@@ -114,6 +132,12 @@ GEM
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
+ listen (2.7.0)
+ celluloid (>= 0.15.2)
+ celluloid-io (>= 0.15.0)
+ rb-fsevent (>= 0.9.3)
+ rb-inotify (>= 0.9)
+ lumberjack (1.0.4)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
@@ -121,16 +145,17 @@ GEM
thread_safe (~> 0.1.3)
method_source (0.8.2)
mime-types (1.25.1)
- minitest (4.7.5)
+ minitest (5.3.0)
msgpack (0.5.8)
msgpack-rpc (0.5.2)
cool.io (~> 1.1.1)
msgpack (~> 0.5.8)
- multi_json (1.8.4)
+ multi_json (1.9.0)
multi_xml (0.5.5)
multipart-post (2.0.0)
mysql2 (0.3.15)
naught (1.0.0)
+ nio4r (1.0.0)
oauth (0.4.7)
omniauth (1.2.1)
hashie (>= 1.2, < 3)
@@ -148,7 +173,7 @@ GEM
slop (~> 3.4)
pry-rails (0.3.2)
pry (>= 0.9.10)
- puma (2.8.0)
+ puma (2.8.1)
rack (>= 1.1, < 2.0)
quiet_assets (1.0.2)
railties (>= 3.1, < 5.0)
@@ -161,20 +186,25 @@ GEM
rack (>= 1.0.0)
rack-test (0.6.2)
rack (>= 1.0)
- rails (4.0.3)
- actionmailer (= 4.0.3)
- actionpack (= 4.0.3)
- activerecord (= 4.0.3)
- activesupport (= 4.0.3)
+ rails (4.1.0.rc1)
+ actionmailer (= 4.1.0.rc1)
+ actionpack (= 4.1.0.rc1)
+ actionview (= 4.1.0.rc1)
+ activemodel (= 4.1.0.rc1)
+ activerecord (= 4.1.0.rc1)
+ activesupport (= 4.1.0.rc1)
bundler (>= 1.3.0, < 2.0)
- railties (= 4.0.3)
+ railties (= 4.1.0.rc1)
sprockets-rails (~> 2.0.0)
- railties (4.0.3)
- actionpack (= 4.0.3)
- activesupport (= 4.0.3)
+ railties (4.1.0.rc1)
+ actionpack (= 4.1.0.rc1)
+ activesupport (= 4.1.0.rc1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.1.1)
+ rb-fsevent (0.9.4)
+ rb-inotify (0.9.3)
+ ffi (>= 0.5.0)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.14.1)
@@ -194,7 +224,7 @@ GEM
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
safe_yaml (1.0.1)
- sass (3.2.14)
+ sass (3.3.2)
sass-rails (4.0.1)
railties (>= 4.0.0, < 5.0)
sass (>= 3.1.10)
@@ -206,7 +236,10 @@ GEM
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
- slop (3.4.7)
+ slop (3.5.0)
+ spring (1.1.2)
+ spring-commands-rspec (1.0.1)
+ spring (>= 0.9.1)
sprockets (2.11.0)
hike (~> 1.2)
multi_json (~> 1.0)
@@ -218,19 +251,18 @@ GEM
sprockets (~> 2.8)
term-ansicolor (1.3.0)
tins (~> 1.0)
- thin (1.6.1)
- daemons (>= 1.0.9)
- eventmachine (>= 1.0.0)
- rack (>= 1.0.0)
thor (0.18.1)
thread_safe (0.1.3)
atomic
tilt (1.4.1)
+ timers (1.1.0)
tins (1.0.0)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
- twitter (5.7.1)
+ turbolinks (2.2.1)
+ coffee-rails
+ twitter (5.8.0)
addressable (~> 2.3)
buftok (~> 0.2.0)
equalizer (~> 0.0.9)
@@ -243,18 +275,19 @@ GEM
simple_oauth (~> 0.2.0)
twitter-text (1.8.0)
unf (~> 0.1.0)
- tzinfo (0.3.38)
+ tzinfo (1.1.0)
+ thread_safe (~> 0.1)
uglifier (2.4.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
unf (0.1.3)
unf_ext
unf_ext (0.0.6)
- virtus (1.0.1)
- axiom-types (~> 0.0.5)
+ virtus (1.0.2)
+ axiom-types (~> 0.1)
coercible (~> 1.0)
- descendants_tracker (~> 0.0.1)
- equalizer (~> 0.0.7)
+ descendants_tracker (~> 0.0.3)
+ equalizer (~> 0.0.9)
webmock (1.17.4)
addressable (>= 2.2.7)
crack (>= 0.3.2)
@@ -265,7 +298,6 @@ PLATFORMS
DEPENDENCIES
bootstrap-sass
- coffee-rails
connection_pool
coveralls
daemon-spawn
@@ -274,6 +306,7 @@ DEPENDENCIES
factory_girl_rails
grape!
grape-rabl
+ guard-rspec
haml-rails
jquery-rails
msgpack
@@ -283,13 +316,14 @@ DEPENDENCIES
pry-rails
puma
quiet_assets
- rails (~> 4.0.3)
- rspec
+ rails (~> 4.1.0.rc1)
rspec-rails
sass-rails
settingslogic
simplecov
- thin
+ spring
+ spring-commands-rspec
+ turbolinks
twitter
twitter-text
uglifier
diff --git a/Guardfile b/Guardfile
new file mode 100644
index 0000000..8e24af4
--- /dev/null
+++ b/Guardfile
@@ -0,0 +1,24 @@
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard :rspec, cmd: "spring rspec" do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+
+ # Rails example
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+ watch('config/routes.rb') { "spec/routing" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+
+ # Capybara features specs
+ watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
+
+ # Turnip features and steps
+ watch(%r{^spec/acceptance/(.+)\.feature$})
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
+end
+
diff --git a/README.md b/README.md
index 7a16fad..0caaed8 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ Collects favs and retweets in real time by UserStreams.
* Import tweets from Favstar / Favotter / tweets.zip / ..
## Requirements
-* Ruby 2.1.0/2.0.0
+* Ruby 2.0.0+
* MySQL/MariaDB 5.5.14+ (needs utf8mb4 support)
## Installation
@@ -47,8 +47,8 @@ Collects favs and retweets in real time by UserStreams.
$ vi config/database.yml
$ # Set random secret_token
- $ cp config/initializers/secret_token.rb.example config/initializers/secret_token.rb
- $ sed -i s/replace_here/$(rake secret)/g config/initializers/secret_token.rb
+ $ cp config/secrets.yml.example config/secrets.yml
+ $ sed -i s/replace_here/$(rake secret)/g config/secrets.yml
$ # Setup database. This will create database and tables on MySQL server.
$ rake db:setup
@@ -59,8 +59,8 @@ Collects favs and retweets in real time by UserStreams.
* Start your aclog
- $ # Start Unicorn (Web server)
- $ ./start_unicorn.sh start
+ $ # Start Puma (Web server)
+ $ ./start_webserver.sh start
$ # Start Background server
$ ./start_receiver.sh start
diff --git a/Rakefile b/Rakefile
index e16fef9..ba6b733 100644
--- a/Rakefile
+++ b/Rakefile
@@ -3,4 +3,4 @@
require File.expand_path('../config/application', __FILE__)
-Aclog::Application.load_tasks
+Rails.application.load_tasks
diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb
index a6b0994..f5bc8e5 100644
--- a/app/assets/javascripts/application.js.erb
+++ b/app/assets/javascripts/application.js.erb
@@ -1,5 +1,6 @@
//= require jquery
//= require jquery_ujs
+//= require turbolinks
//= require bootstrap
//= require _widgets
//= require _define_application
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 76c5f8c..11983d1 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,7 +1,7 @@
class ApplicationController < ActionController::Base
include ControllerErrorHandling
- protect_from_forgery
+ protect_from_forgery with: :exception
after_action :tidy_response_body
helper_method :logged_in?, :current_user
diff --git a/app/views/layouts/_base.html.haml b/app/views/layouts/_base.html.haml
index 1cf0631..b509886 100644
--- a/app/views/layouts/_base.html.haml
+++ b/app/views/layouts/_base.html.haml
@@ -8,8 +8,9 @@
%link{rel: "apple-touch-icon-precomposed", href: image_path("apple-touch-icon-precomposed.png")}
%meta{name: "msapplication-TileImage", content: image_path("tile-image.png")}
%meta{name: "msapplication-TileColor", content: "#f0eadb"}
- = stylesheet_link_tag "application", media: nil
- = javascript_include_tag "application"
+ = stylesheet_link_tag "application", media: nil, "data-turbolinks-track" => true
+ = javascript_include_tag "application", "data-turbolinks-track" => true
+ = csrf_meta_tags
- if @next_url
%link{rel: "next", href: @next_url}
- if @prev_url
diff --git a/bin/rails b/bin/rails
index 728cd85..7feb6a3 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,4 +1,8 @@
#!/usr/bin/env ruby
+begin
+ load File.expand_path("../spring", __FILE__)
+rescue LoadError
+end
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
diff --git a/bin/rake b/bin/rake
index 1724048..8017a02 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,4 +1,8 @@
#!/usr/bin/env ruby
+begin
+ load File.expand_path("../spring", __FILE__)
+rescue LoadError
+end
require_relative '../config/boot'
require 'rake'
Rake.application.run
diff --git a/bin/rspec b/bin/rspec
new file mode 100755
index 0000000..41e3708
--- /dev/null
+++ b/bin/rspec
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+begin
+ load File.expand_path("../spring", __FILE__)
+rescue LoadError
+end
+require 'bundler/setup'
+load Gem.bin_path('rspec', 'rspec')
diff --git a/bin/spring b/bin/spring
new file mode 100755
index 0000000..253ec37
--- /dev/null
+++ b/bin/spring
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+
+# This file loads spring without using Bundler, in order to be fast
+# It gets overwritten when you run the `spring binstub` command
+
+unless defined?(Spring)
+ require "rubygems"
+ require "bundler"
+
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
+ ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
+ ENV["GEM_HOME"] = ""
+ Gem.paths = ENV
+
+ gem "spring", match[1]
+ require "spring/binstub"
+ end
+end
diff --git a/config.ru b/config.ru
index 4883d4b..5bc2a61 100644
--- a/config.ru
+++ b/config.ru
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.
-require ::File.expand_path('../config/environment', __FILE__)
-run Aclog::Application
+require ::File.expand_path('../config/environment', __FILE__)
+run Rails.application
diff --git a/config/application.rb b/config/application.rb
index d761e3d..0139ebe 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,15 +1,17 @@
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
+require "active_model/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
+require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
-Bundler.require(:default, Rails.env)
+Bundler.require(*Rails.groups)
module Aclog
class Application < Rails::Application
@@ -30,7 +32,6 @@ module Aclog
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- I18n.enforce_available_locales = true
config.i18n.default_locale = :ja
config.i18n.fallbacks = true
diff --git a/config/boot.rb b/config/boot.rb
index 3596736..5e5f0c1 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,4 +1,4 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
+require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
diff --git a/config/database.yml.example b/config/database.yml.example
index 4688bc4..9c8273d 100644
--- a/config/database.yml.example
+++ b/config/database.yml.example
@@ -1,27 +1,20 @@
-development:
+default: &default
adapter: mysql2
- database: aclog_development
- username: aclog
- password:
- host: localhost
encoding: utf8mb4
collation: utf8mb4_general_ci
+ pool: 5
+ username: root
+ password:
+ host: localhost
+
+development:
+ <<: *default
+ database: aclog_development
test:
- adapter: mysql2
+ <<: *default
database: aclog_test
- username: aclog
- password:
- host: localhost
- encoding: utf8mb4
- collation: utf8mb4_general_ci
production:
- adapter: mysql2
+ <<: *default
database: aclog_production
- username: aclog
- password:
- host: localhost
- encoding: utf8mb4
- collation: utf8mb4_general_ci
-
diff --git a/config/environment.rb b/config/environment.rb
index 79f1d14..ee8d90d 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -1,5 +1,5 @@
-# Load the rails application.
+# Load the Rails application.
require File.expand_path('../application', __FILE__)
-# Initialize the rails application.
-Aclog::Application.initialize!
+# Initialize the Rails application.
+Rails.application.initialize!
diff --git a/config/environments/development.rb b/config/environments/development.rb
index e05367e..ddf0e90 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,4 +1,4 @@
-Aclog::Application.configure do
+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
@@ -19,11 +19,19 @@ Aclog::Application.configure do
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
- # Raise an error on page load if there are pending migrations
+ # Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# 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
+
+ # Adds additional error checking when serving assets at runtime.
+ # Checks for improperly declared sprockets dependencies.
+ # Raises helpful error messages.
+ config.assets.raise_runtime_errors = true
+
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 626154d..a9197f3 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -1,11 +1,11 @@
-Aclog::Application.configure do
+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 thread web servers
+ # 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
@@ -66,7 +66,7 @@ Aclog::Application.configure do
# 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 can not be found).
+ # the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
@@ -77,4 +77,7 @@ Aclog::Application.configure do
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
+
+ # Do not dump schema after migrations.
+ config.active_record.dump_schema_after_migration = false
end
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 60f7f8a..053f5b6 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -1,4 +1,4 @@
-Aclog::Application.configure do
+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
@@ -14,7 +14,7 @@ Aclog::Application.configure do
# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_assets = true
- config.static_cache_control = "public, max-age=3600"
+ config.static_cache_control = 'public, max-age=3600'
# Show full error reports and disable caching.
config.consider_all_requests_local = true
@@ -33,4 +33,7 @@ Aclog::Application.configure do
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
+
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
end
diff --git a/config/initializers/ar_mysql.rb b/config/initializers/ar_mysql.rb
index 3db4669..346e382 100644
--- a/config/initializers/ar_mysql.rb
+++ b/config/initializers/ar_mysql.rb
@@ -5,5 +5,3 @@ ActiveRecord::ConnectionAdapters::Mysql2Adapter::NATIVE_DATABASE_TYPES[:primary_
# MySQL / utf8mb4
ActiveRecord::Base.connection.initialize_schema_migrations_table
-
-
diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb
new file mode 100644
index 0000000..7a06a89
--- /dev/null
+++ b/config/initializers/cookies_serializer.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.action_dispatch.cookies_serializer = :json \ No newline at end of file
diff --git a/config/initializers/haml.rb b/config/initializers/haml.rb
index 2c46c71..7ebe0b8 100644
--- a/config/initializers/haml.rb
+++ b/config/initializers/haml.rb
@@ -2,4 +2,3 @@ Haml::Template.options[:attr_wrapper] = "\""
Haml::Template.options[:format] = :xhtml
Haml::Template.options[:mime_type] = "application/xhtml+xml"
Haml::Template.options[:ugly] = false
-
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index a044813..b5886f3 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -16,4 +16,3 @@ Rails.application.config.middleware.use OmniAuth::Builder do
request_path: "/i/login",
callback_path: "/i/callback"
end
-
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index 39510c5..dd3097d 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file.
-Aclog::Application.config.session_store ActionDispatch::Session::CacheStore, expire_after: 3.days
+Rails.application.config.session_store :cache_store, expire_after: 3.days
diff --git a/config/routes.rb b/config/routes.rb
index d13e635..5e50c84 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,5 +1,5 @@
-Aclog::Application.routes.draw do
- root to: "about#index"
+Rails.application.routes.draw do
+ root "about#index"
mount Api => "/api"
diff --git a/config/secrets.yml b/config/secrets.yml
new file mode 100644
index 0000000..4848f92
--- /dev/null
+++ b/config/secrets.yml
@@ -0,0 +1,20 @@
+# 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 `rake secret` to generate a secure secret key.
+
+# Make sure the secrets in this file are kept private
+# if you're sharing your code publicly.
+
+development:
+ secret_key_base: e932d3f83cbae4958582403ab3aee04d3be7f8fbfb46229b67e4602c49b850c4063e4cfa006bca5061b2846dcbd2c434b3b1e0e1b4e00d5b13c32c3b02f5df52
+
+test:
+ secret_key_base: 2786ae3a48ee889cf63f677a140887bd6401cdc4c7e0d91750313ae220df17cb483d25c5141724cc61d4529849c991be02d2dc1c43617d6f3b27fa34d29c14e7
+
+production:
+ secret_key_base: 4d08e9b0ec419fc768104d202f75b966a7c8778ad7cbae2de9d11861b796d21755cb529c16cb98444a14f6b1a299d4ea046355af3fee231288c467430ea68a00
diff --git a/config/initializers/secret_token.rb.example b/config/secrets.yml.example
index 889d589..c91a5cb 100644
--- a/config/initializers/secret_token.rb.example
+++ b/config/secrets.yml.example
@@ -7,6 +7,14 @@
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.
-# Make sure your secret_key_base is kept private
+# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.
-Aclog::Application.config.secret_key_base = 'replace_here'
+
+development:
+ secret_key_base: replace_here
+
+test:
+ secret_key_base: replace_here
+
+production:
+ secret_key_base: replace_here
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 39d4b0f..60f8103 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -18,7 +18,7 @@ require "webmock/rspec"
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
-Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
@@ -44,7 +44,7 @@ RSpec.configure do |config|
# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
- config.infer_base_class_for_anonymous_controllers = true
+ config.infer_base_class_for_anonymous_controllers = false
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing