Skip to content

Commit

Permalink
Merge pull request #171 from fluent/rails_4_2
Browse files Browse the repository at this point in the history
Upgrade Rails 4.2
  • Loading branch information
yoshihara committed Apr 2, 2015
2 parents 4ac6605 + 9d942da commit 5e61a1e
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 66 deletions.
112 changes: 66 additions & 46 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PATH
kramdown (> 1.0.0)
kramdown-haml
puma
rails (~> 4.1.7)
rails (~> 4.2.0)
rubyzip (~> 1.1)
sass-rails (~> 4.0.3)
settingslogic
Expand All @@ -25,50 +25,57 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
actionmailer (4.2.1)
actionpack (= 4.2.1)
actionview (= 4.2.1)
activejob (= 4.2.1)
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.1)
actionview (= 4.2.1)
activesupport (= 4.2.1)
rack (~> 1.6)
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.1)
activesupport (= 4.2.1)
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.1)
activesupport (= 4.2.1)
globalid (>= 0.3.0)
activemodel (4.2.1)
activesupport (= 4.2.1)
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.1)
activemodel (= 4.2.1)
activesupport (= 4.2.1)
arel (~> 6.0)
activesupport (4.2.1)
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)
addressable (2.3.8)
arel (6.0.0)
builder (3.2.2)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
capybara-screenshot (1.0.4)
capybara-screenshot (1.0.7)
capybara (>= 1.0, < 3)
colored
launchy
celluloid (0.15.2)
timers (~> 1.1.0)
cliver (0.3.2)
coderay (1.1.0)
colored (1.2)
cool.io (1.3.0)
crack (0.4.2)
safe_yaml (~> 1.0.0)
Expand Down Expand Up @@ -99,6 +106,8 @@ GEM
yajl-ruby (~> 1.0)
font-awesome-rails (4.3.0.0)
railties (>= 3.2, < 5.0)
globalid (0.3.3)
activesupport (>= 4.1.0)
haml (4.0.6)
tilt
haml-rails (0.5.3)
Expand Down Expand Up @@ -127,6 +136,8 @@ GEM
haml
launchy (2.4.3)
addressable (~> 2.3)
loofah (2.0.1)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mechanize (2.7.3)
Expand All @@ -143,13 +154,13 @@ GEM
mini_portile (0.6.2)
minitest (5.5.1)
msgpack (0.5.11)
multi_json (1.10.1)
multi_json (1.11.0)
net-http-digest_auth (1.4)
net-http-persistent (2.9.4)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
ntlm-http (0.1.1)
poltergeist (1.5.1)
poltergeist (1.6.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
Expand All @@ -158,26 +169,35 @@ GEM
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-rails (0.3.2)
pry-rails (0.3.4)
pry (>= 0.9.10)
puma (2.11.1)
rack (>= 1.1, < 2.0)
rack (1.5.2)
rack (1.6.0)
rack-test (0.6.3)
rack (>= 1.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.1)
actionmailer (= 4.2.1)
actionpack (= 4.2.1)
actionview (= 4.2.1)
activejob (= 4.2.1)
activemodel (= 4.2.1)
activerecord (= 4.2.1)
activesupport (= 4.2.1)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.9)
sprockets-rails (~> 2.0)
railties (4.1.9)
actionpack (= 4.1.9)
activesupport (= 4.1.9)
railties (= 4.2.1)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.6)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.2)
loofah (~> 2.0)
railties (4.2.1)
actionpack (= 4.2.1)
activesupport (= 4.2.1)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.4.2)
Expand All @@ -187,9 +207,9 @@ GEM
rspec-expectations (3.2.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-its (1.0.1)
rspec-core (>= 2.99.0.beta1)
rspec-expectations (>= 2.99.0.beta1)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.2.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
Expand Down Expand Up @@ -232,7 +252,7 @@ GEM
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
timecop (0.7.1)
timecop (0.7.3)
timers (1.1.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
Expand All @@ -245,9 +265,9 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
webrobots (0.1.1)
websocket-driver (0.5.1)
websocket-driver (0.5.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.1)
websocket-extensions (0.1.2)
xpath (2.0.0)
nokogiri (~> 1.3)
yajl-ruby (1.2.1)
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/api/settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ class Api::SettingsController < ApplicationController
before_action :set_config
before_action :set_section, only: [:show, :update, :destroy]
helper_method :element_id
respond_to :json

def index
respond_to do |format|
format.json
end
end

def update
Expand Down
6 changes: 1 addition & 5 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
4 changes: 0 additions & 4 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require_relative '../config/boot'
require 'rake'
Rake.application.run
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
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.
11 changes: 8 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@

# 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 serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.serve_static_files = true


# 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
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 @@ -32,6 +32,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
2 changes: 1 addition & 1 deletion config/initializers/cookies_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file.

Rails.application.config.action_dispatch.cookies_serializer = :json
Rails.application.config.action_dispatch.cookies_serializer = :json
2 changes: 1 addition & 1 deletion config/initializers/session_store.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file.

Rails.application.config.session_store :cookie_store, key: '_fluentd-ui_session'
Rails.application.config.session_store :cookie_store, key: '_fluentd_ui_session'
2 changes: 1 addition & 1 deletion fluentd-ui.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "fluentd", [">= 0.10.56", "< 2"]
spec.add_dependency 'rails', '~> 4.1.7'
spec.add_dependency 'rails', '~> 4.2.0'
spec.add_dependency 'sucker_punch', "~> 1.0.5"
spec.add_dependency 'addressable'
spec.add_dependency "font-awesome-rails"
Expand Down

0 comments on commit 5e61a1e

Please sign in to comment.