Skip to content

Commit

Permalink
Make bundle exec blade build success with Ruby 3.3.0dev at 7-0-stable
Browse files Browse the repository at this point in the history
This commit addresses the CI failure at 7-0-stable branch since ruby/ruby#7039
https://buildkite.com/rails/rails/builds/94361#0186a504-e06f-4f75-bcb6-df93822f78ed/3283-3286

- Without this commit

```ruby
$ ruby -v
ruby 3.3.0dev (2023-03-28T07:26:46Z master d766d5346b) [x86_64-linux]
$ bundle exec blade build
bundler: failed to load command: blade (/home/yahonda/.rbenv/versions/3.3.0-dev/bin/blade)
/home/yahonda/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/cookiejar-0.3.3/lib/cookiejar/cookie_validation.rb:48:in `initialize': wrong number of arguments (given 3, expected 1..2) (ArgumentError)

    PARAM2 = Regexp.new "(#{PATTERN::TOKEN})(?:=(#{PATTERN::VALUE2}))?(?:\\Z|;)", '', 'n'
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	from /home/yahonda/.rbenv/versions/3.3.0-dev/lib/ruby/gems/3.3.0+0/gems/cookiejar-0.3.3/lib/cookiejar/cookie_validation.rb:48:in `new'
```

- With this commit

```ruby
$ ruby -v
ruby 3.3.0dev (2023-03-28T07:26:46Z master d766d5346b) [x86_64-linux]
$ bundle exec blade build
Building assets…
$
```

This commit has been made on top of `7-0-stable` not `main` branch
because `blade` has been removed from main branch via rails#46206

`blade` gem depends on `cookiejar` indirectly as follows.
`blade` depending on `faye` depending on `em-http-request` depending on `cookiejar`

To use `cookiejar` with Ruby 3.3 it needs dwaite/cookiejar#52 merged.
Instead of using `https://github.com/koic/cookiejar/tree/suppress_deprecation_warning_for_regexp_n_flag` branch cherry-pick the commit a73e526 because the this pull request may be changed like addressing RuboCop offenses.

blade is only used for testing this change should be enough.

Co-authored-by: Koichi ITO <koic.ito@gmail.com>
  • Loading branch information
yahonda and koic committed Mar 28, 2023
1 parent 0fec953 commit 960feca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ end
# Action View
group :view do
gem "blade", require: false, platforms: [:ruby]
gem "cookiejar", github: "yahonda/cookiejar", branch: "ruby33", require: false, platforms: [:ruby]
gem "sprockets-export", require: false
end

Expand Down
9 changes: 8 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ GIT
event_emitter
websocket

GIT
remote: https://github.com/yahonda/cookiejar.git
revision: ebcde134a62ec9dccbc81b71d62e0f6f91b2571f
branch: ruby33
specs:
cookiejar (0.3.3)

PATH
remote: .
specs:
Expand Down Expand Up @@ -187,7 +194,6 @@ GEM
coffee-script-source (1.12.2)
concurrent-ruby (1.1.10)
connection_pool (2.3.0)
cookiejar (0.3.3)
crack (0.4.5)
rexml
crass (1.0.6)
Expand Down Expand Up @@ -585,6 +591,7 @@ DEPENDENCIES
capybara (>= 3.26)
cgi (>= 0.3.6)
connection_pool
cookiejar!
cssbundling-rails
dalli (>= 3.0.1)
debug (>= 1.1.0)
Expand Down

0 comments on commit 960feca

Please sign in to comment.