Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Rails 5.0.0.beta3 #271

Merged
merged 4 commits into from
Apr 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ sudo: false
addons:
apt:
sources:
ubuntu-toolchain-r-test
- ubuntu-toolchain-r-test
- travis-ci/sqlite3
packages:
g++-4.9
- g++-4.9
- sqlite3
env:
global:
- RAILS_ENV=test
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ruby "2.3.0"

#
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
gem "rails", "~>4.2"
gem "rails", "5.0.0.beta3"

# Note: We're using sqllite3 for development and testing
gem "sqlite3", group: [:development, :test]
Expand Down Expand Up @@ -102,7 +102,7 @@ group :test do
gem "generator_spec"
gem "launchy"
gem "poltergeist"
gem "rspec-rails"
gem "rspec-rails", "3.5.0.beta3"
gem "rspec-retry"
gem "selenium-webdriver", require: !["poltergeist", "poltergeist_errors_ok", "webkit"].include?(ENV["DRIVER"])
end
128 changes: 67 additions & 61 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
actioncable (5.0.0.beta3)
actionpack (= 5.0.0.beta3)
nio4r (~> 1.2)
websocket-driver (~> 0.6.1)
actionmailer (5.0.0.beta3)
actionpack (= 5.0.0.beta3)
actionview (= 5.0.0.beta3)
activejob (= 5.0.0.beta3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.6)
actionview (= 4.2.6)
activesupport (= 4.2.6)
rack (~> 1.6)
rack-test (~> 0.6.2)
actionpack (5.0.0.beta3)
actionview (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
rack (~> 2.x)
rack-test (~> 0.6.3)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.6)
activesupport (= 4.2.6)
actionview (5.0.0.beta3)
activesupport (= 5.0.0.beta3)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.6)
activesupport (= 4.2.6)
globalid (>= 0.3.0)
activemodel (4.2.6)
activesupport (= 4.2.6)
builder (~> 3.1)
activerecord (4.2.6)
activemodel (= 4.2.6)
activesupport (= 4.2.6)
arel (~> 6.0)
activesupport (4.2.6)
activejob (5.0.0.beta3)
activesupport (= 5.0.0.beta3)
globalid (>= 0.3.6)
activemodel (5.0.0.beta3)
activesupport (= 5.0.0.beta3)
activerecord (5.0.0.beta3)
activemodel (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
arel (~> 7.0)
activesupport (5.0.0.beta3)
concurrent-ruby (~> 1.0)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
archive-zip (0.7.0)
io-like (~> 0.3.0)
arel (6.0.3)
arel (7.0.0)
ast (2.2.0)
autoprefixer-rails (6.3.6)
execjs
Expand All @@ -60,8 +62,8 @@ GEM
bundler-audit (0.5.0)
bundler (~> 1.2)
thor (~> 0.18)
byebug (8.2.2)
capybara (2.6.2)
byebug (8.2.3)
capybara (2.7.0)
addressable
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
Expand All @@ -71,8 +73,8 @@ GEM
capybara-screenshot (1.0.12)
capybara (>= 1.0, < 3)
launchy
capybara-webkit (1.9.0)
capybara (>= 2.3.0, < 2.7.0)
capybara-webkit (1.10.0)
capybara (>= 2.3.0, < 2.8.0)
json
childprocess (0.5.9)
ffi (~> 1.0, >= 1.0.11)
Expand Down Expand Up @@ -139,6 +141,7 @@ GEM
mini_portile2 (2.0.0)
minitest (5.8.4)
multi_json (1.11.2)
nio4r (1.2.1)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
parser (2.3.0.7)
Expand Down Expand Up @@ -168,21 +171,23 @@ GEM
pry-stack_explorer (0.4.9.2)
binding_of_caller (>= 0.7)
pry (>= 0.9.11)
puma (3.3.0)
rack (1.6.4)
puma (3.4.0)
rack (2.0.0.alpha)
json
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.6)
actionmailer (= 4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
activemodel (= 4.2.6)
activerecord (= 4.2.6)
activesupport (= 4.2.6)
rails (5.0.0.beta3)
actioncable (= 5.0.0.beta3)
actionmailer (= 5.0.0.beta3)
actionpack (= 5.0.0.beta3)
actionview (= 5.0.0.beta3)
activejob (= 5.0.0.beta3)
activemodel (= 5.0.0.beta3)
activerecord (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.6)
sprockets-rails
railties (= 5.0.0.beta3)
sprockets-rails (>= 2.0.0)
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
Expand All @@ -196,9 +201,10 @@ GEM
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (4.2.6)
actionpack (= 4.2.6)
activesupport (= 4.2.6)
railties (5.0.0.beta3)
actionpack (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.1.0)
Expand All @@ -212,25 +218,25 @@ GEM
rails (>= 3.2)
rainbow (~> 2.1)
ref (2.0.0)
rspec-core (3.4.4)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
rspec-core (3.5.0.beta3)
rspec-support (= 3.5.0.beta3)
rspec-expectations (3.5.0.beta3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-mocks (3.4.1)
rspec-support (= 3.5.0.beta3)
rspec-mocks (3.5.0.beta3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-rails (3.4.2)
actionpack (>= 3.0, < 4.3)
activesupport (>= 3.0, < 4.3)
railties (>= 3.0, < 4.3)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-support (~> 3.4.0)
rspec-support (= 3.5.0.beta3)
rspec-rails (3.5.0.beta3)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (= 3.5.0.beta3)
rspec-expectations (= 3.5.0.beta3)
rspec-mocks (= 3.5.0.beta3)
rspec-support (= 3.5.0.beta3)
rspec-retry (0.4.5)
rspec-core
rspec-support (3.4.1)
rspec-support (3.5.0.beta3)
rubocop (0.39.0)
parser (>= 2.3.0.7, < 3.0)
powerpack (~> 0.1)
Expand Down Expand Up @@ -343,12 +349,12 @@ DEPENDENCIES
pry-rescue
pry-stack_explorer
puma
rails (~> 4.2)
rails (= 5.0.0.beta3)
rails-html-sanitizer
rails_12factor
rainbow
react_on_rails (~> 5.1.1)
rspec-rails
rspec-rails (= 3.5.0.beta3)
rspec-retry
rubocop
ruby-lint
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In no particular order:
- Example of using the [react_on_rails gem](https://github.com/shakacode/react_on_rails) for easy react/webpack integration with Rails.
- Example of React with [CSS Modules](http://glenmaddern.com/articles/css-modules) inside of Rails using Webpack as described in [Smarter CSS builds with Webpack](http://bensmithett.com/smarter-css-builds-with-webpack/).
- Example of enabling hot reloading of both JS and CSS (modules) from your Rails app in development mode. Change your code. Save. Browser updates without a refresh!
- Example of Rails 4.2 with ReactJs/Redux/React-Router with Webpack and ES7.
- Example of Rails 5 with ReactJs/Redux/React-Router with Webpack and ES7.
- Enabling development of a JS client independently from Rails using the [Webpack Dev Server](https://webpack.github.io/docs/webpack-dev-server.html). You can see this by starting the app and visiting http://localhost:4000
- Enabling the use of npm modules and [Babel](https://babeljs.io/) with a Rails application using [Webpack](https://webpack.github.io/).
- Easily enable retrofitting such a JS framework into an existing Rails app. You don't need a brand new single page app!
Expand All @@ -60,8 +60,8 @@ See package.json and Gemfile for versions
1. [react-router-redux](https://github.com/reactjs/react-router-redux)
1. [Webpack with hot-reload](https://github.com/webpack/docs/wiki/hot-module-replacement-with-webpack) (for local dev)
1. [Babel transpiler](https://github.com/babel/babel)
1. [Ruby on Rails 4.2](http://rubyonrails.org/) for backend app and comparision with plain HTML
1. [Heroku for Rails 4.2 deployment](https://devcenter.heroku.com/articles/getting-started-with-rails4)
1. [Ruby on Rails 5](http://rubyonrails.org/) for backend app and comparison with plain HTML
1. [Heroku for Rails 5 deployment](https://devcenter.heroku.com/articles/getting-started-with-rails5)
1. [Turbolinks 5](https://github.com/turbolinks/turbolinks)

# Basic Setup
Expand Down
5 changes: 0 additions & 5 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
5 changes: 0 additions & 5 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require_relative '../config/boot'
require 'rake'
Rake.application.run
29 changes: 17 additions & 12 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,29 +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__)
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)

Dir.chdir APP_ROOT do
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:
# Add necessary setup steps to this file.

puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') or system!('bundle install')

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

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

puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
system! 'bin/rails log:clear tmp:clear'

puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
system! 'bin/rails restart'
end
29 changes: 29 additions & 0 deletions bin/update
Original file line number Diff line number Diff line change
@@ -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' or 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
11 changes: 0 additions & 11 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,5 @@ class Application < Rails::Application
# 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.

# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = "Central Time (US & Canada)"

# 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]
# config.i18n.default_locale = :de

# For not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
end
end
10 changes: 10 additions & 0 deletions config/cable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Action Cable uses Redis by default to administer connections, channels, and sending/receiving messages over the WebSocket.
production:
adapter: redis
url: redis://localhost:6379/1

development:
adapter: async

test:
adapter: async
Loading