Permalink
Browse files

Update to rails 5.0 \o/

  • Loading branch information...
1 parent 83ab8ea commit b95aa94bea4d7f661d97f8c3ac7a6cf427964985 @nanaya nanaya committed Aug 15, 2016
View
@@ -1,13 +1,13 @@
source "https://rubygems.org"
-gem "rails", "~> 4.2.0"
+gem "rails", "~> 5.0.0"
-gem "coffee-rails", "~> 4.1.0" # Rails 4.2 default
+gem "coffee-rails", "~> 4.2.0" # Rails 5.0 default
gem "jquery-rails"
gem "jquery-ui-rails"
-gem "uglifier", ">= 1.3.0" # Rails 4.2 default
+gem "uglifier", ">= 1.3.0" # Rails 5.0 default
-gem "sass-rails", "~> 5.0" # Rails 4.2 default
+gem "sass-rails", "~> 5.0" # Rails 5.0 default
source "https://rails-assets.org" do
gem "rails-assets-js-cookie"
@@ -39,10 +39,6 @@ gem "mini_magick"
gem "image_size"
gem "i18n-js", ">= 3.0.0.rc7"
-group :development do
- gem "quiet_assets"
-end
-
group :standalone do
platform :mri do
gem "unicorn"
@@ -60,7 +56,7 @@ gem "pry", :group => [:development, :test]
gem "oj", :platforms => :mri
gem "multi_json"
-gem "jbuilder", "~> 2.0" # Rails 4.2 default
+gem "jbuilder", "~> 2.5" # Rails 5.0 default
# Must be last.
gem "rack-mini-profiler", :group => :development
View
@@ -2,55 +2,57 @@ GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
specs:
- actionmailer (4.2.7.1)
- actionpack (= 4.2.7.1)
- actionview (= 4.2.7.1)
- activejob (= 4.2.7.1)
+ actioncable (5.0.0.1)
+ actionpack (= 5.0.0.1)
+ nio4r (~> 1.2)
+ websocket-driver (~> 0.6.1)
+ actionmailer (5.0.0.1)
+ actionpack (= 5.0.0.1)
+ actionview (= 5.0.0.1)
+ activejob (= 5.0.0.1)
mail (~> 2.5, >= 2.5.4)
- rails-dom-testing (~> 1.0, >= 1.0.5)
- actionpack (4.2.7.1)
- actionview (= 4.2.7.1)
- activesupport (= 4.2.7.1)
- rack (~> 1.6)
- rack-test (~> 0.6.2)
- rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-dom-testing (~> 2.0)
+ actionpack (5.0.0.1)
+ actionview (= 5.0.0.1)
+ activesupport (= 5.0.0.1)
+ rack (~> 2.0)
+ rack-test (~> 0.6.3)
+ rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (4.2.7.1)
- activesupport (= 4.2.7.1)
+ actionview (5.0.0.1)
+ activesupport (= 5.0.0.1)
builder (~> 3.1)
erubis (~> 2.7.0)
- rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
- activejob (4.2.7.1)
- activesupport (= 4.2.7.1)
- globalid (>= 0.3.0)
- activemodel (4.2.7.1)
- activesupport (= 4.2.7.1)
- builder (~> 3.1)
- activerecord (4.2.7.1)
- activemodel (= 4.2.7.1)
- activesupport (= 4.2.7.1)
- arel (~> 6.0)
+ activejob (5.0.0.1)
+ activesupport (= 5.0.0.1)
+ globalid (>= 0.3.6)
+ activemodel (5.0.0.1)
+ activesupport (= 5.0.0.1)
+ activerecord (5.0.0.1)
+ activemodel (= 5.0.0.1)
+ activesupport (= 5.0.0.1)
+ arel (~> 7.0)
activerecord-jdbc-adapter (1.3.20)
activerecord (>= 2.2)
activerecord-jdbcpostgresql-adapter (1.3.20)
activerecord-jdbc-adapter (~> 1.3.20)
jdbc-postgres (>= 9.1)
- activesupport (4.2.7.1)
+ activesupport (5.0.0.1)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
- json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
- thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
acts_as_versioned_rails3 (0.6.2)
activerecord (>= 3.0.9)
addressable (2.4.0)
- arel (6.0.3)
+ arel (7.1.1)
builder (3.2.2)
coderay (1.1.1)
- coffee-rails (4.1.1)
+ coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
- railties (>= 4.0.0, < 5.1.x)
+ railties (>= 4.0.0, < 5.2.x)
coffee-script (2.4.1)
coffee-script-source
execjs
@@ -88,8 +90,8 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.5)
railties (>= 3.2.16)
- json (1.8.3)
- json (1.8.3-java)
+ json (2.0.2)
+ json (2.0.2-java)
kgio (2.10.0)
loofah (2.0.3)
nokogiri (>= 1.5.9)
@@ -107,6 +109,8 @@ GEM
minitest (5.9.0)
multi_json (1.12.1)
newrelic_rpm (3.16.0.318)
+ nio4r (1.2.1)
+ nio4r (1.2.1-java)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
@@ -131,40 +135,37 @@ GEM
spoon (~> 0.0)
puma (3.6.0)
puma (3.6.0-java)
- quiet_assets (1.1.0)
- railties (>= 3.1, < 5.0)
- rack (1.6.4)
+ rack (2.0.1)
rack-mini-profiler (0.10.1)
rack (>= 1.2.0)
rack-test (0.6.3)
rack (>= 1.0)
- rails (4.2.7.1)
- actionmailer (= 4.2.7.1)
- actionpack (= 4.2.7.1)
- actionview (= 4.2.7.1)
- activejob (= 4.2.7.1)
- activemodel (= 4.2.7.1)
- activerecord (= 4.2.7.1)
- activesupport (= 4.2.7.1)
+ rails (5.0.0.1)
+ actioncable (= 5.0.0.1)
+ actionmailer (= 5.0.0.1)
+ actionpack (= 5.0.0.1)
+ actionview (= 5.0.0.1)
+ activejob (= 5.0.0.1)
+ activemodel (= 5.0.0.1)
+ activerecord (= 5.0.0.1)
+ activesupport (= 5.0.0.1)
bundler (>= 1.3.0, < 2.0)
- railties (= 4.2.7.1)
- sprockets-rails
+ railties (= 5.0.0.1)
+ sprockets-rails (>= 2.0.0)
rails-assets-js-cookie (2.1.2)
rails-assets-mousetrap (1.6.0)
- rails-deprecated_sanitizer (1.0.3)
- activesupport (>= 4.2.0.alpha)
- rails-dom-testing (1.0.7)
- activesupport (>= 4.2.0.beta, < 5.0)
+ rails-dom-testing (2.0.1)
+ activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6.0)
- rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
- rails-i18n (4.0.9)
+ rails-i18n (5.0.0)
i18n (~> 0.7)
- railties (~> 4.0)
- railties (4.2.7.1)
- actionpack (= 4.2.7.1)
- activesupport (= 4.2.7.1)
+ railties (~> 5.0)
+ railties (5.0.0.1)
+ actionpack (= 5.0.0.1)
+ activesupport (= 5.0.0.1)
+ method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.17.0)
@@ -202,6 +203,11 @@ GEM
unicorn-worker-killer (0.4.4)
get_process_mem (~> 0)
unicorn (>= 4, < 6)
+ websocket-driver (0.6.4)
+ websocket-extensions (>= 0.1.0)
+ websocket-driver (0.6.4-java)
+ websocket-extensions (>= 0.1.0)
+ websocket-extensions (0.1.2)
will-paginate-i18n (0.1.15)
will_paginate (3.1.0)
@@ -214,7 +220,7 @@ DEPENDENCIES
activerecord-jdbcpostgresql-adapter (>= 1.3.0)
acts_as_versioned_rails3
addressable
- coffee-rails (~> 4.1.0)
+ coffee-rails (~> 4.2.0)
connection_pool
daemons
dalli
@@ -225,7 +231,7 @@ DEPENDENCIES
geoip
i18n-js (>= 3.0.0.rc7)
image_size
- jbuilder (~> 2.0)
+ jbuilder (~> 2.5)
jquery-rails
jquery-ui-rails
json
@@ -239,9 +245,8 @@ DEPENDENCIES
pg
pry
puma
- quiet_assets
rack-mini-profiler
- rails (~> 4.2.0)
+ rails (~> 5.0.0)
rails-assets-js-cookie!
rails-assets-mousetrap!
rails-i18n
@@ -214,7 +214,7 @@ def generic_text_field_tag(name, value = nil, options = {})
end
# Cache with locale. Only works when the name is an array or string.
- def local_cache(name = {}, options = nil, &block)
+ def local_cache(name = {}, options = {}, &block)
if (name.is_a? String) || (name.is_a? Array)
name = Array(name)
name << I18n.locale
@@ -11,7 +11,9 @@
<% end %>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="top" title="<%= CONFIG["app_name"] %>" href="/">
- <%= tag 'link', :rel => 'canonical', :href => @canonical_url ? @canonical_url : url_for(params.merge :only_path => false) %>
+ <% if @canonical_url.present? %>
+ <%= tag 'link', :rel => 'canonical', :href => @canonical_url %>
+ <% end %>
<%# The javascript-hide class is used to hide elements (eg. blacklisted posts) from JavaScript. %>
<script type="text/javascript">
var css = ".javascript-hide { display: none !important; }";
@@ -24,7 +26,7 @@
</script>
<%= yield :html_header %>
- <%= auto_discovery_link_tag :atom, controller: '/post', :action => "atom", :tags => params[:tags] %>
+ <%= auto_discovery_link_tag :atom, :controller => "post", :action => "atom", :tags => params[:tags] %>
<%= stylesheet_link_tag :application %>
<script id="user-blacklisted-tags" type="application/json">
@@ -1,5 +1,5 @@
<% provide :title, @pool.pretty_name %>
-<%= render 'shared/twitter_card/gallery', description: @pool.description, posts: @posts %>
+<%= render 'shared/twitter_card/gallery', :description => @pool.description, :posts => @posts, :url => url_for %>
<div id="pool-show">
<h4><%= t('.title', :name => @pool.pretty_name) %></h4>
<% unless @pool.description.blank? %>
@@ -1,7 +1,7 @@
<% provide :title, t(".title", :tags => params[:tags].to_s.tr("_", " ")) %>
<% provide :title, " | #{t("basic.page", :page => page_number)}" if page_number > 1 %>
<% @canonical_url = url_for(:controller => "/post", :action => :index, :tags => params[:tags], :page => params[:page], :only_path => false) %>
-<%= render 'shared/twitter_card/gallery', posts: @posts %>
+<%= render "shared/twitter_card/gallery", :posts => @posts, :url => @canonical_url %>
<div id="post-list">
<% if @tag_suggestions && @tag_suggestions.any? %>
<div class="status-notice">
@@ -4,7 +4,7 @@
# Reference: https://developers.facebook.com/docs/opengraphprotocol/
%>
<%= tag :meta, :property => "og:title", :content => html_title %>
- <%= tag :meta, :property => "og:url", :content => url_for(params) %>
+ <%= tag :meta, :property => "og:url", :content => url %>
<% if defined? description %>
<%= tag :meta, property: "og:description", content: description %>
<% else %>
View
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
-load Gem.bin_path("bundler", "bundle")
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+load Gem.bin_path('bundler', 'bundle')
View
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
-APP_PATH = File.expand_path("../../config/application", __FILE__)
-require_relative "../config/boot"
-require "rails/commands"
+APP_PATH = File.expand_path('../config/application', __dir__)
+require_relative '../config/boot'
+require 'rails/commands'
View
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
-require_relative "../config/boot"
-require "rake"
+require_relative '../config/boot'
+require 'rake'
Rake.application.run
View
@@ -0,0 +1,34 @@
+#!/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)
+ system(*args) || abort("\n== Command #{args} failed ==")
+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')
+
+ # puts "\n== Copying sample files =="
+ # unless File.exist?('config/database.yml')
+ # cp 'config/database.yml.sample', 'config/database.yml'
+ # end
+
+ puts "\n== Preparing database =="
+ system! 'bin/rails db:setup'
+
+ puts "\n== Removing old logs and tempfiles =="
+ system! 'bin/rails log:clear tmp:clear'
+
+ puts "\n== Restarting application server =="
+ system! 'bin/rails restart'
+end
View
@@ -0,0 +1,29 @@
+#!/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)
+ system(*args) || abort("\n== Command #{args} failed ==")
+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')
+
+ puts "\n== Updating database =="
+ system! 'bin/rails db:migrate'
+
+ puts "\n== Removing old logs and tempfiles =="
+ system! 'bin/rails log:clear tmp:clear'
+
+ puts "\n== Restarting application server =="
+ system! 'bin/rails restart'
+end
Oops, something went wrong.

0 comments on commit b95aa94

Please sign in to comment.