Skip to content

Commit

Permalink
Upgrade to Rails 4.2.0. Closes #107
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie committed Jan 26, 2015
1 parent 9f083f7 commit a0512b8
Show file tree
Hide file tree
Showing 12 changed files with 141 additions and 66 deletions.
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
ruby "2.2.0"

gem 'rails', '4.1.9'
gem 'rails', '4.2.0'
gem 'haml'
gem 'pg'
gem 'kaminari'
Expand Down Expand Up @@ -37,6 +37,10 @@ gem 'turbolinks'

gem 'rails_12factor', :group => :production

group :development do
gem 'web-console', '~> 2.0'
end

group :test, :development do
gem 'rspec-rails'
gem "parallel_tests"
Expand Down
112 changes: 73 additions & 39 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,55 @@ GIT

GIT
remote: git://github.com/hexorx/countries.git
revision: 20e03f4387ea243e8a050adb4882c8e809f9f6aa
revision: 9cd73ec9e014be6082cc47374cae928c1d823f90
specs:
countries (0.10.0)
currencies (~> 0.4.2)
i18n_data (~> 0.6.0)

GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.0)
actionmailer (4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
actionmailer (4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
activejob (= 4.2.0)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.9)
actionview (= 4.1.9)
activesupport (= 4.1.9)
rack (~> 1.5.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.0)
actionview (= 4.2.0)
activesupport (= 4.2.0)
rack (~> 1.6.0)
rack-test (~> 0.6.2)
actionview (4.1.9)
activesupport (= 4.1.9)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
actionview (4.2.0)
activesupport (= 4.2.0)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.9)
activesupport (= 4.1.9)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
activejob (4.2.0)
activesupport (= 4.2.0)
globalid (>= 0.3.0)
activemodel (4.2.0)
activesupport (= 4.2.0)
builder (~> 3.1)
activerecord (4.1.9)
activemodel (= 4.1.9)
activesupport (= 4.1.9)
arel (~> 5.0.0)
activesupport (4.1.9)
i18n (~> 0.6, >= 0.6.9)
activerecord (4.2.0)
activemodel (= 4.2.0)
activesupport (= 4.2.0)
arel (~> 6.0)
activesupport (4.2.0)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.6)
arel (5.0.1.20140414130214)
arel (6.0.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.2)
capybara (2.4.4)
mime-types (>= 1.16)
Expand All @@ -78,6 +90,7 @@ GEM
coffee-script-source (1.8.0)
currencies (0.4.2)
database_cleaner (1.4.0)
debug_inspector (0.0.2)
deep_merge (1.0.1)
diff-lcs (1.2.5)
dotenv (1.0.2)
Expand Down Expand Up @@ -113,7 +126,7 @@ GEM
fog-atmos (0.1.0)
fog-core
fog-xml
fog-aws (0.0.6)
fog-aws (0.0.7)
fog-core (~> 1.27)
fog-json (~> 1.0)
fog-xml (~> 0.1)
Expand Down Expand Up @@ -170,17 +183,21 @@ GEM
dotenv (~> 1.0.2)
thor (~> 0.19.1)
formatador (0.2.5)
geocoder (1.2.6)
geocoder (1.2.7)
globalid (0.3.0)
activesupport (>= 4.1.0)
haml (4.0.6)
tilt
hash-deep-merge (0.1.1)
hike (1.2.3)
hirefire-resource (0.3.4)
i18n (0.7.0)
i18n_data (0.6.0)
inflecto (0.0.2)
ipaddress (0.8.0)
jquery-rails (3.1.2)
railties (>= 3.0, < 5.0)
jquery-rails (4.0.3)
rails-dom-testing (~> 1.0)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.2)
jwt (1.0.0)
Expand All @@ -193,6 +210,8 @@ GEM
lazy_high_charts (1.5.4)
bundler (>= 1.0)
hash-deep-merge
loofah (2.0.1)
nokogiri (>= 1.5.9)
macaddr (1.7.1)
systemu (~> 2.6.2)
mail (2.6.3)
Expand All @@ -208,37 +227,46 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
netrc (0.10.2)
nokogiri (1.6.6.1)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
parallel (1.3.3)
parallel_tests (1.0.9)
parallel
pg (0.18.1)
phony (2.10.2)
rack (1.5.2)
rack (1.6.0)
rack-protection (1.5.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
rack-timeout (0.2.0)
rails (4.1.9)
actionmailer (= 4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
activemodel (= 4.1.9)
activerecord (= 4.1.9)
activesupport (= 4.1.9)
rails (4.2.0)
actionmailer (= 4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
activejob (= 4.2.0)
activemodel (= 4.2.0)
activerecord (= 4.2.0)
activesupport (= 4.2.0)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.9)
sprockets-rails (~> 2.0)
railties (= 4.2.0)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.5)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.1)
loofah (~> 2.0)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.3)
rails_stdout_logging (0.0.3)
railties (4.1.9)
actionpack (= 4.1.9)
activesupport (= 4.1.9)
railties (4.2.0)
actionpack (= 4.2.0)
activesupport (= 4.2.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.13.0)
Expand Down Expand Up @@ -330,6 +358,11 @@ GEM
vcr (2.9.3)
vegas (0.1.11)
rack (>= 1.0.0)
web-console (2.0.0)
activemodel (~> 4.0)
binding_of_caller (>= 0.7.2)
railties (~> 4.0)
sprockets-rails (>= 2.0, < 4.0)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand Down Expand Up @@ -361,7 +394,7 @@ DEPENDENCIES
pg
phony
rack-timeout
rails (= 4.1.9)
rails (= 4.2.0)
rails_12factor
redis
resque!
Expand All @@ -378,3 +411,4 @@ DEPENDENCIES
unicorn
uuid
vcr
web-console (~> 2.0)
2 changes: 1 addition & 1 deletion bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application', __FILE__)
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
29 changes: 29 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env ruby
require 'pathname'

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)

Dir.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 || bundle install"

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# end

puts "\n== Preparing database =="
system "bin/rake db:setup"

puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"

puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
end
4 changes: 3 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ class Application < Rails::Application
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de

config.time_zone = 'Bangkok'
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true

config.time_zone = 'Bangkok'
config.i18n.available_locales = [:kh, :en, :ph]
config.i18n.fallbacks = true
config.i18n.enforce_available_locales = false
Expand Down
3 changes: 1 addition & 2 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
require 'bundler/setup' # Set up gems listed in the Gemfile.
4 changes: 4 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
# number of complex assets.
config.assets.debug = true

# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true

# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
Expand Down
31 changes: 14 additions & 17 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# For large-scale production use, consider using a caching reverse proxy like
# NGINX, varnish or squid.
# config.action_dispatch.rack_cache = true

# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
Expand All @@ -29,20 +31,22 @@
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false

# Generate digests for assets URLs.
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true

# `config.assets.precompile` has moved to config/initializers/assets.rb
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb

# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true

# Set to :debug to see everything in the log.
config.log_level = :info
# 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 = [ :subdomain, :uuid ]
Expand All @@ -54,11 +58,7 @@
# config.cache_store = :mem_cache_store

# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# config.assets.precompile += %w( search.js )
# config.action_controller.asset_host = 'http://assets.example.com'

# 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.
Expand All @@ -71,9 +71,6 @@
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify

# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false

# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new

Expand Down
7 changes: 5 additions & 2 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false

# Configure static asset server for tests with Cache-Control for performance.
config.serve_static_assets = true
# Configure static file server for tests with Cache-Control for performance.
config.serve_static_files = true
config.static_cache_control = 'public, max-age=3600'

# Show full error reports and disable caching.
Expand All @@ -31,6 +31,9 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test

# Randomize the order test cases are executed.
config.active_support.test_order = :random

# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr

Expand Down
3 changes: 3 additions & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# 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
# Rails.application.config.assets.paths << Emoji.images_path

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )
Loading

0 comments on commit a0512b8

Please sign in to comment.