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

Testing against other jruby versions #476

Closed
Closed
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
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -19,3 +23,5 @@ env:
gemfile:
- gemfiles/4.1.gemfile
- gemfiles/4.2.gemfile
- gemfiles/5.0.0.gemfile
- gemfiles/master.gemfile
12 changes: 8 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
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

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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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].
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 `[email protected]` and on, we will no longer support versions of Ruby
prior to `2.1.0`.

`[email protected]` adds support for Rails 5, which depends on `[email protected]`,
which **requires** Ruby `2.2.2` or greater.

From `[email protected]` 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/helpers/ember_rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
2 changes: 1 addition & 1 deletion bin/clean
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -e

rm -rf spec/dummy/my-app
rm -rf spec/dummy/{my-app,tmp}
19 changes: 2 additions & 17 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 20 additions & 8 deletions bin/setup_ember
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<img src="assets/logo.png">' >> 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 '<p>Welcome to Ember</p>' >> $target/app/templates/application.hbs
echo '<img src="assets/logo.png">' >> $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
4 changes: 2 additions & 2 deletions ember-cli-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions gemfiles/3.2.gemfile
Original file line number Diff line number Diff line change
@@ -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 => "../"
4 changes: 2 additions & 2 deletions gemfiles/4.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/4.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions gemfiles/5.0.0.gemfile
Original file line number Diff line number Diff line change
@@ -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 => "../"
19 changes: 19 additions & 0 deletions gemfiles/master.gemfile
Original file line number Diff line number Diff line change
@@ -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 => "../"
10 changes: 2 additions & 8 deletions spec/lib/ember_cli/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@

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
end

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
Expand Down Expand Up @@ -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).
Expand Down