Commit Graph

668 Commits

Author SHA1 Message Date
Yasuo Honda e29db960b2 Lock redis version to v4 until #45913 is resolved
Refer to https://github.com/rails/rails/issues/45913
https://github.com/redis/redis-rb/issues/1142
2022-08-31 15:42:21 +09:00
Carl Brasic 7690290068 Replace `method_source` gem with stdlib equivalent
The `method_source` gem was added in
https://github.com/rails/rails/pull/19216. It was used to determine the
last line number of a given test method to support running tests by line
number. But this is not something that requires an external dependency:
Ripper can do this easily, and it has the added advantage of not using
repeated calls to `eval` to do it.

Drop `method_source` and replace it with a simple handler for Ripper's
`on_def` parser event.

I don't believe that there are any mainstream rubies at this point that
can run Rails and don't support Ripper but correct me if I'm wrong.
2022-08-30 08:52:11 -05:00
Yasuo Honda a4c4ee1b11 Lock que version to v1 until #45899 is resolved
Refer to https://github.com/rails/rails/issues/45899

https://github.com/rails/rails/issues/45899
2022-08-29 14:49:12 +09:00
Yusuke Endoh 3beb2aff3b Use error_highlight gem to locate the columns where an error was raised
This change incorporates to Rails a feature called error_highlight that
has been available since Ruby 3.1. This allow Rails' error report screen
to display the fine-grained location where an error occurred (not only a
line number but also beginning and end column numbers of the code
fragment).

For ErrorHighlight, see https://bugs.ruby-lang.org/issues/17930 in
detail.

To use error_highlight, ExceptionWrapper now prefers
`Exception#backtrace_locations` (since Ruby 2.1), which returns an array
of `Thread::Backtrace::Location`s, instead of `Exception#backtrace`.
This is because error_highlight requires `Thread::Backtrace::Location`
to locate the column where an error was raised.

Co-Authored-By: John Hawthorn <john@hawthorn.email>
Co-Authored-By: Jean Boussier <jean.boussier@gmail.com>
2022-08-24 00:28:50 +09:00
Jean Boussier f2ab66da73 Stop testing hiredis
The driver being used is an implementation detail of `redis-rb`.
If somehow something break on one driver but not the other, it should
be reported to redis-rb and fixed there.

Also `redis-rb` `5.0` has a totally new client and hiredis binding
so all this code no longer works with redis-rb 5.0.
2022-08-22 09:01:27 +02:00
John Hawthorn 85db5be358 Fix "unmarshalable" test for minitest 5.16.3 2022-08-18 09:47:50 -07:00
Eileen M. Uchitelle 914ac17156
Merge pull request #45539 from geongeorge/feature/updates-guide-generation-epub
Feature/updates guide generation - EPUB
2022-08-04 15:03:56 -04:00
Geon George 56e96d9344 Replaces mobi guide with epub for docs because of discontinued support
Removes kindlerb logic

Adds template for epub generator

Renames the kindle dir to /epub

Adds epub module to generator and replaces kindle

Fixes mimetype

Creates basic epub book

Deletes old kindle module

Adds zip package

Updates rubyzip gem name

Removes now unused gepub gem

Adds the required container file for epubs

Fixes media type

Adds new epub generation logic

Removes all buttons from output html

Refactors and generates valid epub files

Removes frontmatter logic used for kindlegen

Filters out epub files in zip

Updates link to kindle doc on sidebar

Fixes rubocop issues

Adds deprecation warning for the old kindle task

Refactors and cleans up epub module

Cleans up epub code

Cleans up private internal method code style

Removes unnecessary imagemagick check
2022-08-05 00:18:20 +05:30
Jean Boussier 476aeda794 Avoid explictly freezing literals strings when possible
Ref: https://github.com/jeremyevans/erubi/pull/33

If the template is compiled with `frozen_string_literals: true`,
then explicitly freezing string is slightly wasteful as it will be
compiled as `opt_str_freeze` instead of a simple `putobject`.

The former has to check wether `String#freeze` was redefined every
time, which while fast is useless extra work.
2022-08-03 11:15:36 +02:00
Yasuo Honda 2e8381c8b2 Bump strscan to 3.0.4
This commit addresses bug_report_templates/action_controller_gem.rb failures.

```
% ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin22]
% cd guides/bug_report_templates
% ruby action_controller_gem.rb
Fetching gem metadata from https://rubygems.org/...........
... snip ...
Using rails 7.0.3.1
/Users/yahonda/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.14/lib/bundler/runtime.rb:309:in `check_for_activated_spec!': You have already activated strscan 3.0.2, but your Gemfile requires strscan 3.0.4. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
	from /Users/yahonda/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.14/lib/bundler/runtime.rb:25:in `block in setup'
	from /Users/yahonda/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.14/lib/bundler/spec_set.rb:138:in `each'
	from /Users/yahonda/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.14/lib/bundler/spec_set.rb:138:in `each'
	from /Users/yahonda/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.14/lib/bundler/runtime.rb:24:in `map'
	from /Users/yahonda/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.14/lib/bundler/runtime.rb:24:in `setup'
	from /Users/yahonda/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.14/lib/bundler/inline.rb:71:in `block in gemfile'
	from /Users/yahonda/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.14/lib/bundler/settings.rb:131:in `temporary'
	from /Users/yahonda/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.14/lib/bundler/inline.rb:55:in `gemfile'
	from action_controller_gem.rb:5:in `<main>'
%
```

strscan 3.0.4 has been released on July 23, 2022.
https://rubygems.org/gems/strscan/versions/3.0.4

Refer to https://github.com/rails/rails/pull/45052 for the similar change.
https://github.com/rubygems/rubygems/pull/5529
https://github.com/rubygems/rubygems/pull/5535
2022-07-25 17:41:00 +09:00
Étienne Barrié 889886d6ad Allow rack-test >= 2 2022-07-06 14:54:39 +02:00
Yasuo Honda 767c8391f7 Lock rack-test version to v1 until #45467 is resolved
Action Pack CI has been failing since rack-test v2.0.0.
Refer to https://github.com/rails/rails/pull/45177
2022-06-28 09:46:39 +09:00
Rafael Mendonça França fb9e9ef5d7
Upgrade sqlite3 to fix broken ext compilation
See https://github.com/sparklemotion/sqlite3-ruby/pull/324
2022-06-26 17:10:50 +00:00
eileencodes 9766eb4a83
Fix tests for minitest 5.16
In minitest/minitest@6e06ac9 minitest changed such that it now accepts
`kwargs` instead of requiring kwargs to be shoved into the args array.
This is a good change but required some updates to our test code to get
the new version of minitest passing.

Changes are as follows:

1) Lock minitest to 5.15 for Ruby 2.7. We don't love this change but
it's pretty difficult to get 2.7 and 3.0 to play nicely together with
the new kwargs changes. Dropping 2.7 support isn't an option right
now for Rails. This is safe because all of the code changes here are
internal methods to Rails like assert_called_with. Applications
shouldn't be consuming them as they are no-doc'd.
2) Update the `assert_called_with` method to take any kwargs but also
the returns kwarg.
3) Update callers of `assert_called_with` to move the kwargs outside the
args array.
4) Update the message from marshaled exceptions. In 5.16 the exception
message is "result not reported" instead of "Wrapped undumpable
exception".

Co-authored-by: Matthew Draper <matthew@trebex.net>
2022-06-23 08:32:11 -04:00
eileencodes 7f93661551
Lock minitest for now
CI runs bundle update so minitest got updated and my PR started failing
due to this change 6e06ac9d3e

I will relax the minitest requirement once the failing specs can be
fixed, but I don't want that to block this. It wasn't immediately
obvious to me what needs to change in our tests to get them passing.
There is also an open issue here
https://github.com/minitest/minitest/issues/912 regarding this change.
2022-06-15 12:24:41 -04:00
fatkodima 21a6dbd313 Enable strict strings mode for `SQLite3Adapter`
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2022-06-14 23:59:17 +03:00
Xavier Noria 3bcd48f6d8 Require Zeitwerk 2.6 2022-06-13 23:43:42 +02:00
fatkodima 799b5c1df4 Enable connection pooling by default for MemCacheStore and `RedisCacheStore` 2022-06-07 11:40:17 +03:00
Jonathan Hefner 48c9b48284 Bump `timeout` gem to 0.3.0
This fixes the build for `guides/bug_report_templates/*_gem.rb` files.

Example failure: https://buildkite.com/rails/rails/builds/86750#0180fae4-9e78-4f61-9d12-630c7e1519f9/1158-1267

This is similar to #45052.  Eventually, this should be fixed permanently
by either https://github.com/rubygems/rubygems/pull/5529 or
https://github.com/rubygems/rubygems/pull/5535.
2022-05-25 16:10:57 -05:00
Rafael Mendonça França 804a861162
Upgrade bundler version 2022-05-18 22:11:16 +00:00
Yasuo Honda 133fe10083 Use queue_classic 4.0.0
Refer to https://github.com/QueueClassic/queue_classic/pull/339
2022-05-18 14:04:43 +09:00
Ryuta Kamizono 3b4e476221
Merge pull request #45052 from yahonda/strscan_302
Bump strscan to 3.0.2 to address bug_report_templates/action_controller_gem.rb
2022-05-11 07:11:23 +09:00
Petrik 55073ac10f Use the CSS badge for the API docs as well
Sdoc 2.4.0 supports a CSS badge that can be set by passing the version
as the HORO_BADGE_VERSION env variable.

The old badge image can be removed, as it no longer needs to be copied
by the docs server: https://github.com/rails/rails-docs-server/pull/28
2022-05-10 21:05:59 +02:00
Yasuo Honda 76ac6e9a98 Bump strscan to 3.0.2 to address bug_report_templates/action_controller_gem.rb
This commit addresses the following error.

```
% ruby -v
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [arm64-darwin21]
% cd guides/bug_report_templates
% ruby action_controller_gem.rb
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
... snip ...
Fetching strscan 3.0.2
Installing strscan 3.0.2 with native extensions
Traceback (most recent call last):
	9: from action_controller_gem.rb:5:in `<main>'
	8: from /Users/yahonda/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/inline.rb:54:in `gemfile'
	7: from /Users/yahonda/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/settings.rb:124:in `temporary'
	6: from /Users/yahonda/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/inline.rb:70:in `block in gemfile'
	5: from /Users/yahonda/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/runtime.rb:26:in `setup'
	4: from /Users/yahonda/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/runtime.rb:26:in `map'
	3: from /Users/yahonda/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/spec_set.rb:147:in `each'
	2: from /Users/yahonda/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/spec_set.rb:147:in `each'
	1: from /Users/yahonda/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/runtime.rb:31:in `block in setup'
/Users/yahonda/.rbenv/versions/2.7.6/lib/ruby/2.7.0/bundler/runtime.rb:312:in `check_for_activated_spec!': You have already activated strscan 3.0.1, but your Gemfile requires strscan 3.0.2. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
%
```

Background:
- It has been failing since this build
https://buildkite.com/rails/rails/builds/86305#9be4d24a-2944-4660-b5f0-03aac7992131

- strscan  3.0.2 has been released on May 9, 2022
https://rubygems.org/gems/strscan/versions/3.0.2
2022-05-10 08:47:26 +09:00
Jean Boussier d7ac149f5f Use mysql2 0.5.4 2022-05-04 13:21:24 +02:00
Petrik dc9c7cf1fa Update sdoc to 2.3.2 to support latest rdoc 2022-04-22 10:04:34 +02:00
Yasuo Honda 75d104fbb0 Use blade 0.7.3 to support Ruby 3.2
blade 0.7.3 includes https://github.com/javan/blade/pull/12

Related to https://github.com/rails/rails/pull/44152
18e3226c9b
2022-04-13 08:31:38 +09:00
Yasuo Honda dae605c764 Address bug_report_templates/action_controller_gem.rb
This commit addresses the following error.

```ruby
$ ruby -v
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux]
$ cd guides/bug_report_templates
$ ruby action_controller_gem.rb
Fetching gem metadata from https://rubygems.org/...........
... snip ...
Fetching net-protocol 0.1.3
... snip ...
/home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/runtime.rb:309:in `check_for_activated_spec!': You have already activated net-protocol 0.1.2, but your Gemfile requires net-protocol 0.1.3. Since net-protocol is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports net-protocol as a default gem. (Gem::LoadError)
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/runtime.rb:25:in `block in setup'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/spec_set.rb:136:in `each'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/spec_set.rb:136:in `each'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/runtime.rb:24:in `map'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/runtime.rb:24:in `setup'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/inline.rb:71:in `block in gemfile'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/settings.rb:131:in `temporary'
	from /home/yahonda/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/bundler-2.3.4/lib/bundler/inline.rb:55:in `gemfile'
	from action_controller_gem.rb:5:in `<main>'
$
```

Background:

- This test fails since net-protocol 0.1.3 has been released on Apr 1, 2022
https://rubygems.org/gems/net-protocol/versions/0.1.3

- Gemfile.lock specifies `net-protocol` 0.1.2, I assume it means "You
  have already activated net-protocol 0.1.2,".

  https://buildkite.com/rails/rails/builds/85716#dec4bf21-ae22-41db-8cf6-b91ab93b31b5/140-734
  ```ruby
    net-protocol (0.1.2)
  ```

- Actually, I do not know why this `action_controller_gem.rb` only fails with Ruby
  3.0 or higher, Ruby 2.7 works fine.
2022-04-02 00:27:45 +09:00
Damir Zekić 637616153c Upgrade que to 1.3.1
The point of this commit is to ensure no deprecation warnings related to
`job_options` show up when running ActiveJob integration tests.
2022-03-21 13:27:59 +01:00
Xavier Noria b7ae3cba6d Load with Zeitwerk 2022-03-05 08:19:49 +01:00
Yasuo Honda c689263e2b Bump jsbindling-rails and cssbundling-rails
When both jsbundling-rails v1.0.1 and cssbundling-rails v1.1.0
are used at the same time, thor shows the prompt to replace `bin/dev` or
not.

jsbundling-rails v1.0.2 addresses this issue.
https://github.com/rails/jsbundling-rails/releases/tag/v1.0.2
https://github.com/rails/jsbundling-rails/pull/95
2022-03-01 15:18:59 +09:00
Edouard CHIN 7253cac513 Bump Nokogiri to 1.13.3, previous version don't support Ruby 3.1:
- I was trying to work on Rails using Ruby 3.1 but the locked
  bundler dependencies didn't resolve. The previously locked
  version of Nokogiri (v1.12.5) has a constraint on Ruby
  `[">= 2.5".freeze, "< 3.1.dev".freeze]`.

  Things works correctly on CI now because the Gemfile.lock get
  deleted ed61405b4b/Dockerfile (L134)

  Bumping to 1.13.3 as that's what CI uses anyway
2022-02-28 20:00:22 +01:00
Matthew Draper e0edc1aa1d Switch from fork to queue_classic beta release 2022-02-27 22:55:41 +10:30
Ghouse Mohamed 715f117ac9 Bumps rubocop version to 1.25.1 2022-02-23 21:18:33 +05:30
Petrik 569d4ed196 Upgrade to sdoc 2.3.1
Fixes the following error in Firefox/Linux:

    Ctrl-C broken (Uncaught TypeError: $.browser is undefined)
2022-02-14 19:36:22 +01:00
Yasuo Honda 65f350e176 Released version of rbtree 0.4.5 supports Ruby 3.2.0dev
https://github.com/mame/rbtree is mirror of rbtree gem
and rbtree 0.4.5 has been released to support Ruby 3.2.0dev.
https://rubygems.org/gems/rbtree/versions/0.4.5

Related to https://github.com/rails/rails/pull/44152
2022-02-07 13:00:58 +09:00
Hartley McGuire f83f5c81af fix Que integration tests for Active Job
Replace Que.* settings that were removed in Que 1.0 with options passed
to Que::Locker. The Locker class creates its own thread for managing
work distribution, so the Thread created in the QueJobsManager was also
removed.
2022-01-27 16:24:16 -05:00
Yasuo Honda cc86e13fc9 Use released version of pg 1.3
pg 1.3.0 which supports Ruby 3.2.0dev has been released.
https://rubygems.org/gems/pg/versions/1.3.0

Follow up #44007
2022-01-25 21:15:48 +09:00
Azzen Abidi 3f13828392
[ci skip] Added a note about Github Codespaces' warning (#44148)
* Added a note about Github Codespaces warning

Related discussion: https://discuss.rubyonrails.org/t/issues-with-github-codespaces-setup-to-contribute-to-rails/79731

* updated docs to omit Codespace's warning 

[Original answer](https://github.com/rails/rails/pull/44148#issuecomment-1015022184)

* updated gems delayed_job to 4.1.10 && delayed_job_active record to 4.1.7

[Azzen Abidi + Rafael Mendonça França]
2022-01-21 09:08:50 -05:00
Jean Boussier 18e3226c9b Point blade to the official repository 2022-01-12 14:52:41 +01:00
Jean Boussier c2da0add54 Fork rbtree and blade to fix ruby-head CI
They both need very minor fixes.
2022-01-12 11:07:28 +01:00
Yasuo Honda f1f3ef5f90 Use `pg` gem 1.3.0.rc1 to support Ruby 3.2
Ruby 3.2.0dev removed `rb_cData`, `pg` gem cannot be installed with Ruby 3.2.0dev.

Refer Rails CI build failure at:
https://buildkite.com/rails/rails/builds/83631#fbe41b47-08d3-4b4a-8f17-692da1ab1ddf

This fix has been released as `1.3.0.rc1`

Refer:
https://github.com/ged/ruby-pg/issues/413
7c738ce5e6
2022-01-06 14:53:38 +09:00
Rafael Mendonça França b65a3054e6
Merge pull request #44083 from rails/rm-temporary-mail-fix
Temporarily add net-gems as dependencies of frameworks that use mail
2022-01-05 18:42:47 -05:00
Petrik 199b66027b Update sdoc to 2.3.0
With the migration of SDoc to a frameless layout, the URLs to assets
were made absolute instead of relative because of Turbolinks asset
tracking.  But absolute URLs fail when we have multiple versions of the
docs in subdirectories like: https://api.rubyonrails.org/v6.1/

This version of sdoc restores relative URLs by disabling the Turbolinks
asset tracking.

Fixes #44042
2022-01-05 22:55:21 +01:00
Rafael Mendonça França 5dd292f551
Temporarily add net-gems as dependencies of frameworks that use mail
In Ruby 3.1 those gems were dropped from the stdlib, so they need to be
explicitly installed. Mail should be doing this for us, but since it
cares about Ruby < 2.6, and those gems can't be installed there, they
can't add them to the gemspec without dropping support to old rubies.

Since we don't care about Ruby < 2.7, we can just require them in all
frameworks that use mail.
2022-01-05 17:42:40 +00:00
Rafael Mendonça França 55765121ad
Update development dependencies 2022-01-04 23:48:41 +00:00
Rafael Mendonça França 0afa65723a
Make sure test pass with minitest 5.15 2021-12-15 21:20:38 +00:00
Rafael Mendonça França 1d08b63e5b
Upgrade capybara to work with Ruby 3.1 and earlier 2021-12-08 21:44:11 +00:00
Rafael Mendonça França 83d85b2207
Start Rails 7.1 development 2021-12-07 15:52:30 +00:00
Rafael Mendonça França 5fa7049856
Use `ActiveRecord::FixtureSet.signed_global_id` defined by the globalid gem
Also make explicit that actiontext depends on the globalid gem.
2021-11-24 22:34:37 +00:00