diff --git a/.travis.yml b/.travis.yml index 0ea6dcb5..cb130629 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,13 @@ notifications: email: false rvm: - 2.3.0 -- 2.2 -- 2.1 +- 2.2.2 - jruby-9.0.3.0 +- jruby-9.0.4.0 +- jruby-9.0.5.0 +- jruby-9.1.0.0 +- jruby-9.1.1.0 +- jruby-9.1.2.0 before_install: - echo '--colour' > ~/.rspec - 'echo ''gem: --no-document'' > ~/.gemrc' @@ -19,3 +23,5 @@ env: gemfile: - gemfiles/4.1.gemfile - gemfiles/4.2.gemfile + - gemfiles/5.0.0.gemfile + - gemfiles/master.gemfile diff --git a/Appraisals b/Appraisals index ba0f768d..2cd7413f 100644 --- a/Appraisals +++ b/Appraisals @@ -1,7 +1,3 @@ -appraise "3.2" do - gem "rails", git: "https://github.com/rails/rails.git", branch: "3-2-stable" -end - appraise "4.1" do gem "rails", "~> 4.1.1" end @@ -9,3 +5,11 @@ end appraise "4.2" do gem "rails", "~> 4.2.1" end + +appraise "5.0.0" do + gem "rails", "5.0.0" +end + +appraise "master" do + gem "rails", git: "https://github.com/rails/rails.git", branch: "master" +end diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bc2d79b..bbd30d76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ master ------ +* `EmberCli::EmberController` now inherits from `ActionController::Base` instead + of `ApplicationController`. [#400] +* Remove support for Ruby 2.1.x. [#400] * Don't route requests to `/rails/info` through the mounted Ember application. 0.7.4 @@ -33,6 +36,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 diff --git a/Gemfile b/Gemfile index 6e587d71..1232bfdb 100644 --- a/Gemfile +++ b/Gemfile @@ -6,9 +6,13 @@ gem "appraisal" gem "rails", "4.2.4" gem "pry" +if RUBY_ENGINE == "jruby" + gem "json-jruby" +end + group :development, :test do - gem "high_voltage", "~> 2.4.0" - gem "rspec-rails", "~> 3.3.0" + gem "high_voltage", "~> 3.0.0" + gem "rspec-rails", "~> 3.5.0" end group :test do diff --git a/README.md b/README.md index 0f781a73..2ba8e600 100644 --- a/README.md +++ b/README.md @@ -630,7 +630,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]. diff --git a/UPGRADING.md b/UPGRADING.md index 0c75a49c..80c7a1a4 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -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 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/helpers/ember_rails_helper.rb b/app/helpers/ember_rails_helper.rb index e145b3ae..1560c8ad 100644 --- a/app/helpers/ember_rails_helper.rb +++ b/app/helpers/ember_rails_helper.rb @@ -8,6 +8,6 @@ def render_ember_app(name, &block) head, body = markup_capturer.capture - render html: EmberCli[name].index_html(head: head, body: body).html_safe + render text: EmberCli[name].index_html(head: head, body: body).html_safe 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/bin/clean b/bin/clean index 2bf7899b..96c6f547 100755 --- a/bin/clean +++ b/bin/clean @@ -2,4 +2,4 @@ set -e -rm -rf spec/dummy/my-app +rm -rf spec/dummy/{my-app,tmp} diff --git a/bin/setup b/bin/setup index 6c17f614..f66d0f85 100755 --- a/bin/setup +++ b/bin/setup @@ -13,21 +13,6 @@ if ! command -v bower > /dev/null; then npm install -g bower fi -if ! [ -d spec/dummy/my-app ]; then - git clone https://github.com/ember-cli/ember-new-output.git spec/dummy/my-app +bin/setup_ember spec/dummy/my-app - bin/setup_ember -fi - -# Only if this isn't CI -if [ -z "$CI" ]; then - bin/appraisal install -fi - -root="$(pwd)" - -cd ${root}/spec/dummy/my-app && - npm install --save-dev ember-cli-rails-addon@rondale-sc/ember-cli-rails-addon - bower install - -cd ${root}/spec/dummy && bundle exec rake ember:install +cd spec/dummy && bundle exec rake ember:install diff --git a/bin/setup_ember b/bin/setup_ember index 84463ca9..724d8975 100755 --- a/bin/setup_ember +++ b/bin/setup_ember @@ -2,13 +2,25 @@ set -e -# make router catchall routes -sed -i -e 's/auto/hash/' spec/dummy/my-app/config/environment.js +setup_ember() { + local target="${1-spec/dummy/my-app}" -# add text to a template -echo 'Welcome to Ember' >> spec/dummy/my-app/app/templates/application.hbs + if ! [ -d $target ]; then + git clone -b stable https://github.com/ember-cli/ember-new-output.git $target -# add an image to a template -echo '' >> spec/dummy/my-app/app/templates/application.hbs -mkdir -p spec/dummy/my-app/public/assets -cp spec/fixtures/logo.png spec/dummy/my-app/public/assets + # make router catchall routes + sed -i -e 's/auto/hash/' $target/config/environment.js + + # add an image to a template + echo '
Welcome to Ember
' >> $target/app/templates/application.hbs + echo '' >> $target/app/templates/application.hbs + mkdir -p $target/public/assets + cp spec/fixtures/logo.png $target/public/assets + + cd $target && + npm install --save-dev ember-cli-rails-addon@rondale-sc/ember-cli-rails-addon + bower install + fi +} + +setup_ember diff --git a/ember-cli-rails.gemspec b/ember-cli-rails.gemspec index b70040ec..86a8675a 100644 --- a/ember-cli-rails.gemspec +++ b/ember-cli-rails.gemspec @@ -13,10 +13,10 @@ Gem::Specification.new do |spec| spec.license = "MIT" spec.files = Dir["README.md", "CHANGELOG.md", "LICENSE.txt", "{lib,app,config}/**/*"] - spec.required_ruby_version = ">= 2.1.0" + spec.required_ruby_version = ">= 2.2.0" spec.add_dependency "ember-cli-rails-assets", "~> 0.6.2" - spec.add_dependency "railties", ">= 3.2", "< 5" + spec.add_dependency "railties", ">= 3.2" spec.add_dependency "cocaine", "~> 0.5.8" spec.add_dependency "html_page", "~> 0.1.0" end diff --git a/gemfiles/3.2.gemfile b/gemfiles/3.2.gemfile new file mode 100644 index 00000000..335c1f69 --- /dev/null +++ b/gemfiles/3.2.gemfile @@ -0,0 +1,19 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "appraisal" +gem "rails", :git => "https://github.com/rails/rails.git", :branch => "3-2-stable" +gem "pry" + +group :development, :test do + gem "high_voltage", "~> 3.0.0" + gem "rspec-rails", "~> 3.5.0" +end + +group :test do + gem "poltergeist", "~> 1.8.0" + gem "codeclimate-test-reporter", :require => nil +end + +gemspec :path => "../" diff --git a/gemfiles/4.1.gemfile b/gemfiles/4.1.gemfile index e03a704e..4509e1e5 100644 --- a/gemfiles/4.1.gemfile +++ b/gemfiles/4.1.gemfile @@ -7,8 +7,8 @@ gem "rails", "~> 4.1.1" gem "pry" group :development, :test do - gem "high_voltage", "~> 2.4.0" - gem "rspec-rails", "~> 3.3.0" + gem "high_voltage", "~> 3.0.0" + gem "rspec-rails", "~> 3.5.0" end group :test do diff --git a/gemfiles/4.2.gemfile b/gemfiles/4.2.gemfile index bf8203eb..4900e2db 100644 --- a/gemfiles/4.2.gemfile +++ b/gemfiles/4.2.gemfile @@ -7,8 +7,8 @@ gem "rails", "~> 4.2.1" gem "pry" group :development, :test do - gem "high_voltage", "~> 2.4.0" - gem "rspec-rails", "~> 3.3.0" + gem "high_voltage", "~> 3.0.0" + gem "rspec-rails", "~> 3.5.0" end group :test do diff --git a/gemfiles/5.0.0.gemfile b/gemfiles/5.0.0.gemfile new file mode 100644 index 00000000..1382dfb1 --- /dev/null +++ b/gemfiles/5.0.0.gemfile @@ -0,0 +1,19 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "appraisal" +gem "rails", "5.0.0" +gem "pry" + +group :development, :test do + gem "high_voltage", "~> 3.0.0" + gem "rspec-rails", "~> 3.5.0" +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..1216246d --- /dev/null +++ b/gemfiles/master.gemfile @@ -0,0 +1,19 @@ +# 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", "~> 3.0.0" + gem "rspec-rails", "~> 3.5.0" +end + +group :test do + gem "poltergeist", "~> 1.8.0" + gem "codeclimate-test-reporter", :require => nil +end + +gemspec :path => "../" diff --git a/spec/lib/ember_cli/app_spec.rb b/spec/lib/ember_cli/app_spec.rb index a0d7479d..909fd6e0 100644 --- a/spec/lib/ember_cli/app_spec.rb +++ b/spec/lib/ember_cli/app_spec.rb @@ -27,7 +27,7 @@ describe "#compile" do it "exits with exit status of 0" do - passed = silence_stdout { EmberCli["my-app"].compile } + passed = EmberCli["my-app"].compile expect(passed).to be true end @@ -35,7 +35,7 @@ describe "#test" do it "exits with exit status of 0" do - passed = silence_stdout { EmberCli["my-app"].test } + passed = EmberCli["my-app"].test expect(passed).to be true end @@ -65,12 +65,6 @@ end end - def silence_stdout - silence_stream($stdout) do - yield - end - end - def stub_paths(method_to_value) allow_any_instance_of(EmberCli::PathSet). to receive(method_to_value.keys.first).