From fcc295a928e93038767ae822e15552a6bad43401 Mon Sep 17 00:00:00 2001 From: Sean Doyle Date: Fri, 29 Jan 2016 16:00:12 -0500 Subject: [PATCH] Add Rails 5 support 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. Closes [#376]. [#376]: https://github.com/thoughtbot/ember-cli-rails/issues/376 [rails]: https://github.com/rails/rails --- .travis.yml | 2 ++ Appraisals | 8 +++++++ Gemfile | 2 +- app/controller/ember_cli/ember_controller.rb | 5 ----- app/views/ember_cli/ember/index.html.erb | 2 +- gemfiles/3.2.gemfile | 3 +-- gemfiles/4.1.gemfile | 2 +- gemfiles/4.2.gemfile | 2 +- gemfiles/5.0.0.beta2.gemfile | 23 ++++++++++++++++++++ gemfiles/master.gemfile | 23 ++++++++++++++++++++ 10 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 gemfiles/5.0.0.beta2.gemfile create mode 100644 gemfiles/master.gemfile diff --git a/.travis.yml b/.travis.yml index 4719b9c6..08ecfac2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,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 diff --git a/Appraisals b/Appraisals index ba0f768d..c4b39a7c 100644 --- a/Appraisals +++ b/Appraisals @@ -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 diff --git a/Gemfile b/Gemfile index 6e587d71..3a4a422c 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gem "pry" group :development, :test do gem "high_voltage", "~> 2.4.0" - gem "rspec-rails", "~> 3.3.0" + gem "rspec-rails", "~> 3.4.0" end group :test do diff --git a/app/controller/ember_cli/ember_controller.rb b/app/controller/ember_cli/ember_controller.rb index 7c6835f9..24e21cbb 100644 --- a/app/controller/ember_cli/ember_controller.rb +++ b/app/controller/ember_cli/ember_controller.rb @@ -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 diff --git a/app/views/ember_cli/ember/index.html.erb b/app/views/ember_cli/ember/index.html.erb index 6004b207..8ce344e4 100644 --- a/app/views/ember_cli/ember/index.html.erb +++ b/app/views/ember_cli/ember/index.html.erb @@ -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 %> diff --git a/gemfiles/3.2.gemfile b/gemfiles/3.2.gemfile index 5ecbda6f..de0703ce 100644 --- a/gemfiles/3.2.gemfile +++ b/gemfiles/3.2.gemfile @@ -3,13 +3,12 @@ source "https://rubygems.org" gem "appraisal" -gem "test-unit", "~> 3.0" gem "rails", :git => "https://github.com/rails/rails.git", :branch => "3-2-stable" gem "pry" group :development, :test do gem "high_voltage", "~> 2.4.0" - gem "rspec-rails", "~> 3.3.0" + gem "rspec-rails", "~> 3.4.0" end group :test do diff --git a/gemfiles/4.1.gemfile b/gemfiles/4.1.gemfile index e03a704e..1568c255 100644 --- a/gemfiles/4.1.gemfile +++ b/gemfiles/4.1.gemfile @@ -8,7 +8,7 @@ gem "pry" group :development, :test do gem "high_voltage", "~> 2.4.0" - gem "rspec-rails", "~> 3.3.0" + gem "rspec-rails", "~> 3.4.0" end group :test do diff --git a/gemfiles/4.2.gemfile b/gemfiles/4.2.gemfile index bf8203eb..09580d3a 100644 --- a/gemfiles/4.2.gemfile +++ b/gemfiles/4.2.gemfile @@ -8,7 +8,7 @@ gem "pry" group :development, :test do gem "high_voltage", "~> 2.4.0" - gem "rspec-rails", "~> 3.3.0" + gem "rspec-rails", "~> 3.4.0" end group :test do diff --git a/gemfiles/5.0.0.beta2.gemfile b/gemfiles/5.0.0.beta2.gemfile new file mode 100644 index 00000000..f3024ffe --- /dev/null +++ b/gemfiles/5.0.0.beta2.gemfile @@ -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 => "../" diff --git a/gemfiles/master.gemfile b/gemfiles/master.gemfile new file mode 100644 index 00000000..e2276f5e --- /dev/null +++ b/gemfiles/master.gemfile @@ -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 => "../"