Skip to content

Commit

Permalink
Merge branch 'master' into deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Pellizzon committed Feb 16, 2023
2 parents f9a5c3f + bcf653a commit 223d9f3
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 21 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["2.5", "2.6"]
rails: ["5.2", "6.0"]
ruby: ["2.7", "3.0", "3.1"]
rails: ["6.0", "6.1", "7.0"]
include:
- ruby: "2.7"
rails: "5.2"
- ruby: "3.2"
rails: "7.0"
- ruby: "3.2"
rails: "main"

env:
RAILS_ENV: "test"
Expand All @@ -23,10 +30,10 @@ jobs:
steps:
- uses: "actions/checkout@v1"

- name: "Install NodeJS 12.x"
- name: "Install NodeJS 18.x"
uses: "actions/setup-node@v1"
with:
node-version: "12.x"
node-version: "18.x"

- name: "Install Ruby ${{ matrix.ruby }}"
uses: "ruby/setup-ruby@v1"
Expand Down
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
master
------

0.12.1
------

* Drop explicit dependency to rexml (#602)
* Remove note for PhantomJS (#604)
* Allow rspec-rails 6.x (#603)
* Allow ember-cli-rails-assets < 1.0 (#599)
* Update webdrivers gem (#600)
* Disallow rack 3 to be compatible with capybara (#601)

0.12.0
------

* Redirecting with trailing slash with query parameters
* Recognize Building notice as not an error
* Use keyword argument for options
* Add Ruby 2.7 & 3.0 into CI matrix
* Add missing gems that removed from stdlibs in Ruby 3.0.0
* Fix autoload deprecation in Rails 6
* Drop support for Rails versions 4.2, 5.0, 5.1, and 5.2
* Drop support for End-of-Lifed Ruby versions 2.3 and 2.4

0.11.0
------

Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ issue trackers, chatrooms, and mailing lists.

## Setup

After cloning the repository, install [PhantomJS](http://phantomjs.org/)
if you don't already have it, and execute the setup script:
After cloning the repository, execute the setup script:

$ bin/setup

Expand Down
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ gemspec

rails_version = ENV.fetch("RAILS_VERSION", "6.0")

if rails_version == "master"
if rails_version == "main"
rails_constraint = { github: "rails/rails" }
gem "rack", "< 3" # To compatible with capybara. https://github.com/teamcapybara/capybara/issues/2640
else
rails_constraint = "~> #{rails_version}.0"
end

gem "rails", rails_constraint
gem "ember-cli-rails-assets", github: "seanpdoyle/ember-cli-rails-assets" if rails_version == "main" || Gem::Version.new(rails_version) >= Gem::Version.new("7.0")
gem "high_voltage", "~> 3.0.0"
gem "webdrivers", "~> 4.0"
gem "webdrivers", "~> 5.0"
gem "webrick"
2 changes: 1 addition & 1 deletion bin/setup_ember
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ setup_ember() {
local target="${1-spec/dummy/my-app}"

if ! [ -d $target ]; then
git clone -b stable https://github.com/ember-cli/ember-new-output.git $target
git clone -b 'v4.0.0' https://github.com/ember-cli/ember-new-output.git $target

echo '-- Make router catchall routes'
sed -i -e 's/auto/hash/' $target/config/environment.js
Expand Down
4 changes: 2 additions & 2 deletions ember-cli-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = ">= 2.5.0"

spec.add_dependency "ember-cli-rails-assets", "~> 0.6.2"
spec.add_dependency "ember-cli-rails-assets", ">= 0.6.2", "< 1.0"
spec.add_dependency "railties", ">= 4.2"
spec.add_dependency "terrapin", "~> 0.6.0"
spec.add_dependency "html_page", "~> 0.1.0"

spec.add_development_dependency "generator_spec", "~> 0.9.0"
spec.add_development_dependency "rspec-rails", "~> 3.6.0"
spec.add_development_dependency "rspec-rails", ">= 3.6.0", "< 7.0"

spec.add_development_dependency "capybara-selenium"
spec.add_development_dependency "codeclimate-test-reporter", "~> 0.6.0"
Expand Down
7 changes: 6 additions & 1 deletion lib/ember_cli/build_monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def error_file_exists?
def build_errors
error_lines.
reject { |line| is_blank_or_backtrace?(line) }.
reject { |line| is_deprecation_warning?(line) }
reject { |line| is_deprecation_warning?(line) }.
reject { |line| is_building_notice?(line) }
end

def has_build_errors?
Expand All @@ -57,6 +58,10 @@ def is_deprecation_warning?(line)
line =~ /^(\e[^\s]+)?DEPRECATION:/
end

def is_building_notice?(line)
line =~ /^(\e[^\s]+)?.\s(\e[^\s]+)?Building/
end

def error_lines
if error_file_exists?
error_file.readlines
Expand Down
2 changes: 1 addition & 1 deletion lib/ember_cli/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Configuration
attr_accessor :watcher

def app(name, **options)
app = App.new(name, options)
app = App.new(name, **options)
apps.store(name, app)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/ember_cli/route_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def mount_ember_app(app_name, to:, **options)
redirect_if_missing_trailing_slash = {
constraints: EmberCli::TrailingSlashConstraint.new,
to: redirect(-> (_, request) {
File.join(request.original_fullpath, "")
File.join(request.path, "/?#{request.query_parameters.to_query}")
}),
}

Expand Down
2 changes: 1 addition & 1 deletion lib/ember_cli/trailing_slash_constraint.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module EmberCli
class TrailingSlashConstraint
def matches?(request)
!request.original_fullpath.to_s.ends_with?("/")
!request.original_fullpath.to_s.split("?").first.end_with?("/")
end
end
end
2 changes: 1 addition & 1 deletion lib/ember_cli/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module EmberCli
VERSION = "0.11.0".freeze
VERSION = "0.12.1".freeze
end
16 changes: 16 additions & 0 deletions spec/features/user_views_ember_app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@
expect(current_path).to eq("/asset-helpers/")
end

scenario "is redirected with trailing slash with query params", js: false do
expect(embedded_path(query: "foo")).to eq("/asset-helpers?query=foo")

visit embedded_path(query: "foo")

expect(page).to have_current_path("/asset-helpers/?query=foo")
end

scenario "is not redirected with trailing slash with params", js: false do
expect(embedded_path(query: "foo")).to eq("/asset-helpers?query=foo")

visit "/asset-helpers/?query=foo"

expect(page).to have_current_path("/asset-helpers/?query=foo")
end

def have_client_side_asset
have_css %{img[src*="logo.png"]}
end
Expand Down
4 changes: 2 additions & 2 deletions spec/generators/ember/heroku/heroku_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def package_json_contents
end
end

def configure_application(options = {})
EmberCli.configure { |c| c.app("my-app", options) }
def configure_application(**options)
EmberCli.configure { |c| c.app("my-app", **options) }
end

def setup_destination
Expand Down
13 changes: 13 additions & 0 deletions spec/lib/ember_cli/build_monitor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@
end
end

context "when the error file contains an ASCII colored Building notice" do
it "does not raise a BuildError" do
error_file = error_file_with_contents(
[
"- \e[32mBuilding\e[39m"
])
paths = build_paths(error_file)
monitor = EmberCli::BuildMonitor.new(nil, paths)

expect(monitor.check!).to be true
end
end

context "when the error file contains both errors & deprecation warnings" do
it "raises a BuildError" do
error_file = error_file_with_contents(
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/ember_cli/command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ def build_paths(**options)
end

def build_command(**options)
EmberCli::Command.new(options)
EmberCli::Command.new(**options)
end
end
2 changes: 1 addition & 1 deletion spec/lib/ember_cli/path_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def stub_which(program_to_path)

def build_path_set(**options)
EmberCli::PathSet.new(
options.reverse_merge(
**options.reverse_merge(
app: build_app,
rails_root: rails_root,
ember_cli_root: ember_cli_root,
Expand Down

0 comments on commit 223d9f3

Please sign in to comment.