Commit Graph

106 Commits

Author SHA1 Message Date
Stan Lo
4c1f7d8328
Register Rails console commands/helpers with its latest extension APIs
This will greatly increase the visibility of Rails console commands and helpers,
and stop rely on IRB's internal components.

Extension API reference: https://github.com/ruby/irb/blob/master/EXTEND_IRB.md

And because we need to create new classes to use the new APIs, I also
moved all the IRB-specific code to a new file, `irb_console.rb`.

Use IRB.conf[:BACKTRACE_FILTER] for backtrace filtering in console

This change uses the new `IRB.conf[:BACKTRACE_FILTER]` to inject the backtrace
filtering logic into IRB. This avoids the need to patch IRB's internal
WorkSpace class.

Update changelog
2024-05-01 22:14:53 +00:00
Jean Boussier
6ba2fdb2fe Bump the required Ruby version to 3.1.0
Until now, Rails only droped compatibility with older
rubies on new majors, but I propose to change this policy
because it causes us to either keep compatibility with long
EOLed rubies or to bump the Rails major more often, and to
drop multiple Ruby versions at once when we bump the major.

In my opinion it's a bad alignments of incentives. And we'd
be much better to just drop support in new minors whenever they
go EOL (so 3 years).

Also Ruby being an upstream dependency, it's not even
a semver violation AFAICT.

Since Rails 7.2 isn't planned before a few months, we
can already drop Ruby 3.0 as it will be EOL in March.
2023-12-31 08:54:03 +01:00
Hartley McGuire
3ae8f4d171
Fix chmod race condition when generating key
Encrypted keys were updated [previously][1] to restrict other users from
reading the file by default. However, there is a brief period of time
between an encrypted key being created and its permissions being set to
0600. This means that it is possible for another user to read that file
during that time.

This commit fixes that issue by setting the desired permissions when the
file is created. The ability to use the `perm` option was added in Thor
1.2.2 so the minimum version was updated in the Railties gemspec.

[1]: 4c6c3575c66ce10043c9ea04023788890a228de8
2023-05-11 16:29:26 -04:00
Stan Lo
4fefed4239
Add irb to railties' dependencies
- Firstly, including irb as a dependency allows users with older versions
  of Ruby to benefit from the latest version of irb, instead of being
  limited to the version bundled with their Ruby installation.

- Additionally, there is an [ongoing discussion](https://bugs.ruby-lang.org/issues/19351) to move irb to bundled gems.
  If this change is implemented, users may need to declare irb in their
  Gemfile in order to use it for Rails console. By adding irb as a dependency,
  users can avoid the extra effort of manually specifying irb in their Gemfile.
2023-03-06 14:55:22 +08:00
zzak
2f634a029e Move RDOC_MAIN from rdoc to markdown 2023-01-29 16:02:31 +09:00
zzak
5c76f94535
Revert "Prefer README.md over railties/RDOC_MAIN" 2023-01-29 14:37:31 +09:00
zzak
6b5f8e8ba4 Prefer README.md over railties/RDOC_MAIN 2023-01-29 14:09:24 +09:00
Samuel Williams
4c58755862
Add rack-session and rackup gems.
Rack 2 includes this code, but in Rack 3 it was extracted into gems. These
gems include a v1 release compatible with Rack 2, and a v2 release
compatible with Rack v3+.
2023-01-21 06:03:41 +13:00
Carl Brasic
effe47c445 Replace method_source gem with Ripper
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
`eval` calls in a loop to do it as method_source does.

It gets a bit trickier when dealing with declarative `test "some test"`
style methods, but ripper can still handle those in a similar way.

This is a second try at a PR (https://github.com/rails/rails/pull/45904)
that got rolled back because the previous effort didn't handle the
declarative test style.
2022-12-05 13:51:56 -06:00
Rafael Mendonça França
ff9739217d
Revert "Replace method_source gem with stdlib equivalent" 2022-09-08 16:58:52 -04: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
Xavier Noria
3bcd48f6d8 Require Zeitwerk 2.6 2022-06-13 23:43:42 +02:00
Rafael Mendonça França
1fde031e89 Fix gemspec 2021-11-15 21:06:21 +00:00
Rafael Mendonça França
9195b7fd0a
Require MFA to release rails 2021-11-15 20:37:42 +00:00
Xavier Noria
bcb2a112c7 Relax dependency on Zeitwerk 2.5 2021-10-21 20:30:36 +02:00
Xavier Noria
8f6f4407ea Depend on Zeitwerk 2.5 2021-10-20 14:21:24 +02:00
Xavier Noria
6baa6d2ca9 Depend on Zeitwerk 2.5.0.beta6 2021-10-14 11:12:20 +02:00
Nate Vick
3ad99c0354 Bump Rake pin
In Rails 6.1, `rake_command.rb` was rewritten with Rake methods only
available in Rake 12.2 and higher.
c2b701e334/railties/lib/rails/commands/rake/rake_command.rb (L18)
68a3f679d9

If there is an older version of Rake installed on a system `rails` and
`rake` commands error with a missing method error.
ae4f78662a
2021-10-11 07:27:17 -07:00
Xavier Noria
d59e729fbf Depend on Zeitwerk 2.5.0.beta5 2021-09-29 09:25:40 +02:00
Xavier Noria
e44ce53f78 Depend on Zeitwerk 2.5.0.beta4 2021-09-22 08:47:21 +02:00
Xavier Noria
1d6355f6e1 Move Zeitwerk to railties
Active Support should not know about Rails. Once classic has been removed,
AS should get anything it needs from the application as usual.
2021-09-05 03:37:46 +02:00
Rafael Mendonça França
d5ee11933f
Make sure the version of rake used in Rails apps work
Since 68a3f679d93a22160cca9a8bd9a869b8c766f860, we are requiring rake
0.13, so we need to specify that is the version we want.
2021-03-15 20:48:38 +00:00
Rafael Mendonça França
6487836af8
Rails 7 requires Ruby 2.7 and prefer Ruby 3+
The code cleanup is comming in later commits but this
already remove support to Ruby < 2.7.
2021-02-04 16:34:53 +00:00
Abhay Nikam
bdfffd1355 Update the Rails mailing list URLs to new discuss discourse URL [ci skip] 2020-04-02 22:00:28 +05:30
Jonathan Hefner
fe9abe4436 Leverage new :env option for Thor::Actions#run
Follow-up to #34980.

Also, refactor tests to be less brittle.
2019-12-15 13:18:06 -06:00
Orien Madgwick
493edf044f Add bug tracker/documentation/mailing list URIs to the gemspecs 2019-10-11 20:47:19 -04:00
Abhay Nikam
476abd403b Updated links from http to https in guides, docs, etc 2019-03-09 16:43:47 +05:30
Kasper Timm Hansen
647d7e6167
Revert "Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json""
I reverted the wrong commit. Damn it.

This reverts commit f66a977fc7ae30d2a07124ad91924c4ee638a703.
2019-01-08 22:19:22 +01:00
Kasper Timm Hansen
f66a977fc7
Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json"
We had a discussion on the Core team and we don't want to expose this information
as a JSON endpoint and not by default.

It doesn't make sense to expose this JSON locally and this controller is only
accessible in dev, so the proposed access from a production app seems off.

This reverts commit 8eaffe7e89719ac62ff29c2e4208cfbeb1cd1c38, reversing
changes made to b6e4305c3bca4c673996d0af9db0f4cfbf50215e.
2019-01-08 22:16:58 +01:00
Kasper Timm Hansen
1b7c3222e8
Require Ruby 2.5 for Rails 6.
Generally followed the pattern for https://github.com/rails/rails/pull/32034

* Removes needless CI configs for 2.4
* Targets 2.5 in rubocop
* Updates existing CHANGELOG entries for fewer merge conflicts
* Removes Hash#slice extension as that's inlined on Ruby 2.5.
* Removes the need for send on define_method in MethodCallAssertions.
2018-12-19 21:47:50 +01:00
David Rodríguez
f173ec77fc Abort early if generator command fails (#34420)
* No need to go through ruby

* Abort early if a generator command fails

* Reuse `rails_command` method

* Bump thor minimum dependency to 0.20.3

* Add some minimal docs

* Add a changelog entry

* Restore original logging
2018-12-07 15:01:32 +09:00
Gannon McGibbon
e74fdbe00c Amend CVE note and security guide section wordings
Reword first sentence of dep management and CVE section of
security guide. Also, reword and move gemspec notes above deps.

[ci skip]
2018-11-06 18:06:57 -05:00
Gannon McGibbon
1c11688b56 Add CVE note to security guide and gemspecs
[ci skip]
2018-11-06 14:25:36 -05:00
Guillermo Iguaran
e10fd57e98 Bump minimum version of Thor to 0.19.0
Thor 0.18 is causing failures in all the generator tests.
2018-05-22 15:58:35 -05:00
Jeremy Daer
d4eb0dc89e Rails 6 requires Ruby 2.4.1+
Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug.

References #32028
2018-02-17 15:34:57 -08:00
Rafael Mendonça França
0ea8e7db1a Remove support to Ruby 2.2
Rails 6 will only support Ruby >= 2.3.
2018-02-16 18:52:10 -05:00
Pat Allan
acea68de02 Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Matthew Draper
3420a14590 Merge pull request #29540 from kirs/rubocop-frozen-string
Enforce frozen string in Rubocop
2017-07-02 01:11:50 +09:30
Koichi ITO
82d0aff2ce Add source code and changelog link to railties.gemspec 2017-07-01 22:33:00 +09:00
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
bogdanvlviv
40bdbce191
Define path with __dir__
".. with __dir__ we can restore order in the Universe." - by @fxn

Related to 5b8738c2df003a96f0e490c43559747618d10f5f
2017-05-23 00:53:51 +03:00
Xavier Noria
adca8154c6 applies new string literal convention in the gemspecs
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:27:12 +02:00
Xavier Noria
1eb27fafa9 revises the homepage URL in the gemspecs [ci skip]
References https://github.com/rails/homepage/issues/46.
2016-03-10 07:55:27 +01:00
Brandon Keepers
1ab3c5a86c Include MIT-LICENSE in railties gem 2015-09-01 14:17:10 -04:00
Guillermo Iguaran
33ea933d7b Merge pull request #19753 from jonatack/use-ruby-2-2-2
Upgrade to Ruby 2.2.2
2015-04-13 22:56:47 -05:00
Jon Atack
32f7491808 Upgrade to Ruby 2.2.2
and fix the grammar in the ruby_version_check.rb user message.
2015-04-14 08:41:56 +05:30
Islam Wazery
4521aadae0 Rename railties/bin to railties/exe
That will match the new Bundler executables convention.
Bundler Blog Post: http://bundler.io/blog/2015/03/20/moving-bins-to-exe.html
Also updated the necessary tests.
2015-04-11 19:26:34 +02:00
Arthur Neves
9afd9d232c method_source needs to be a hard dependency on railties 2015-03-19 10:15:03 -04:00
Peter Suschlik
f0768eba28 Target Ruby 2.2.1 in gemspecs
This is a follow-up to #19257
2015-03-09 09:56:26 +01:00