Skip to content

Commit

Permalink
Add Rails 5 support
Browse files Browse the repository at this point in the history
Closes [#376].

Required changes
----------------

Run test suite against the latest `5.0.0.betaX` and `master` branches of
[`rails/rails`][rails].

Since `EmberController` extends `ApplicationController`, which can now
extend from either `ActionController::Base` (which implements
`helper_method`) and `ActionController::API` (which doesn't implement
`helper_method`), we can't depend on that API existing.

Remove call to `helper_method` from `EmberController`, as it is no
longer supported.

Support changes
---------------

Rails 5 depends on `rack@2.0.x`, which **requires** Ruby `2.2.2` or
greater.

In order to support Rails 5, we will no longer support versions of Ruby
prior to `2.2.2`.

[#376]: #376
[rails]: https://github.com/rails/rails
  • Loading branch information
seanpdoyle committed Apr 22, 2016
1 parent a97145d commit 82bf147
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ notifications:
email: false
rvm:
- 2.3.0
- 2.2
- 2.1
- 2.2.2
- jruby-9.0.3.0
before_install:
- echo '--colour' > ~/.rspec
Expand All @@ -20,3 +19,5 @@ gemfile:
- gemfiles/3.2.gemfile
- gemfiles/4.1.gemfile
- gemfiles/4.2.gemfile
- gemfiles/5.0.0.beta2.gemfile
- gemfiles/master.gemfile
8 changes: 8 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ end
appraise "4.2" do
gem "rails", "~> 4.2.1"
end

appraise "5.0.0.beta2" do
gem "rails", "5.0.0.beta2"
end

appraise "master" do
gem "rails", git: "https://github.com/rails/rails.git", branch: "master"
end
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
master
------

* Remove support for Ruby 2.1.x. [#400]

0.7.3
-----

Expand All @@ -22,6 +24,7 @@ master
* `EmberCli::Deploy::File` serves assets with Rails' `static_cache_control`
value. [#403]

[#400]: https://github.com/thoughtbot/ember-cli-rails/pull/400
[#396]: https://github.com/thoughtbot/ember-cli-rails/pull/396
[#403]: https://github.com/thoughtbot/ember-cli-rails/pull/403

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ This project supports:

This project supports:

* Ruby versions `>= 2.1.0`
* Ruby versions `>= 2.2.0`
* Rails versions `>=4.1.x`.

To learn more about supported versions and upgrades, read the [upgrading guide].
Expand Down
6 changes: 6 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Additionally, this codebase makes use of [(required) keyword arguments][kwargs].
From `ember-cli-rails@0.4.0` and on, we will no longer support versions of Ruby
prior to `2.1.0`.

`ember-cli-rails@0.8.0` adds support for Rails 5, which depends on `rack@2.0.x`,
which **requires** Ruby `2.2.2` or greater.

From `ember-cli-rails@0.8.0` and on, we will no longer support versions of Ruby
prior to `2.2.2`.

To use `ember-cli-rails` with older versions of Ruby, try the `0.3.x` series.

[kwargs]: https://robots.thoughtbot.com/ruby-2-keyword-arguments
Expand Down
5 changes: 0 additions & 5 deletions app/controller/ember_cli/ember_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,5 @@ class EmberController < ::ApplicationController
def index
render layout: false
end

def ember_app
params[:ember_app]
end
helper_method :ember_app
end
end
2 changes: 1 addition & 1 deletion app/views/ember_cli/ember/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= render_ember_app ember_app do |head| %>
<%= render_ember_app params[:ember_app] do |head| %>
<% head.append do %>
<%= csrf_meta_tags %>
<% end %>
Expand Down
23 changes: 23 additions & 0 deletions gemfiles/5.0.0.beta2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal"
gem "rails", "5.0.0.beta2"
gem "pry"

group :development, :test do
gem "high_voltage", github: "thoughtbot/high_voltage"
gem "rspec-core", github: "rspec/rspec-core"
gem "rspec-support", github: "rspec/rspec-support"
gem "rspec-expectations", github: "rspec/rspec-expectations"
gem "rspec-mocks", github: "rspec/rspec-mocks"
gem "rspec-rails", github: "rspec/rspec-rails"
end

group :test do
gem "poltergeist", "~> 1.8.0"
gem "codeclimate-test-reporter", :require => nil
end

gemspec :path => "../"
23 changes: 23 additions & 0 deletions gemfiles/master.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "appraisal"
gem "rails", :git => "https://github.com/rails/rails.git", :branch => "master"
gem "pry"

group :development, :test do
gem "high_voltage", github: "thoughtbot/high_voltage"
gem "rspec-core", github: "rspec/rspec-core"
gem "rspec-support", github: "rspec/rspec-support"
gem "rspec-expectations", github: "rspec/rspec-expectations"
gem "rspec-mocks", github: "rspec/rspec-mocks"
gem "rspec-rails", github: "rspec/rspec-rails"
end

group :test do
gem "poltergeist", "~> 1.8.0"
gem "codeclimate-test-reporter", :require => nil
end

gemspec :path => "../"

0 comments on commit 82bf147

Please sign in to comment.