2017-07-09 20:06:36 +08:00
# frozen_string_literal: true
2017-07-10 21:39:13 +08:00
2017-05-15 22:17:28 +08:00
version = File . read ( File . expand_path ( " ../RAILS_VERSION " , __dir__ ) ) . strip
2010-03-02 12:36:54 +08:00
2009-09-01 08:20:44 +08:00
Gem :: Specification . new do | s |
2010-02-04 09:59:39 +08:00
s . platform = Gem :: Platform :: RUBY
2016-08-07 01:23:48 +08:00
s . name = " activesupport "
2010-03-05 11:41:39 +08:00
s . version = version
2016-08-07 01:23:48 +08:00
s . summary = " A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. "
s . description = " A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. Rich support for multibyte strings, internationalization, time zones, and testing. "
2010-04-02 04:46:04 +08:00
2023-12-31 02:46:43 +08:00
s . required_ruby_version = " >= 3.1.0 "
2009-09-01 08:20:44 +08:00
2016-08-07 01:23:48 +08:00
s . license = " MIT "
2012-11-09 03:51:18 +08:00
2016-08-07 01:23:48 +08:00
s . author = " David Heinemeier Hansson "
s . email = " david@loudthinking.com "
2019-03-09 20:08:03 +08:00
s . homepage = " https://rubyonrails.org "
2009-12-28 07:59:20 +08:00
2016-08-07 01:23:48 +08:00
s . files = Dir [ " CHANGELOG.md " , " MIT-LICENSE " , " README.rdoc " , " lib/**/* " ]
s . require_path = " lib "
2011-04-19 22:34:34 +08:00
2016-08-07 01:23:48 +08:00
s . rdoc_options . concat [ " --encoding " , " UTF-8 " ]
2012-01-04 00:18:05 +08:00
2017-06-27 18:06:28 +08:00
s . metadata = {
2019-10-12 08:47:19 +08:00
" bug_tracker_uri " = > " https://github.com/rails/rails/issues " ,
" changelog_uri " = > " https://github.com/rails/rails/blob/v #{ version } /activesupport/CHANGELOG.md " ,
" documentation_uri " = > " https://api.rubyonrails.org/v #{ version } / " ,
2020-03-26 14:21:37 +08:00
" mailing_list_uri " = > " https://discuss.rubyonrails.org/c/rubyonrails-talk " ,
2019-10-12 08:47:19 +08:00
" source_code_uri " = > " https://github.com/rails/rails/tree/v #{ version } /activesupport " ,
2021-11-16 05:06:21 +08:00
" rubygems_mfa_required " = > " true " ,
2017-06-27 18:06:28 +08:00
}
2019-01-09 05:19:22 +08:00
# NOTE: Please read our dependency guidelines before updating versions:
# https://edgeguides.rubyonrails.org/security.html#dependency-management-and-cves
2019-11-22 03:59:22 +08:00
s . add_dependency " i18n " , " >= 1.6 " , " < 2 "
2023-11-09 23:55:14 +08:00
s . add_dependency " tzinfo " , " ~> 2.0 " , " >= 2.0.5 "
2024-05-29 15:26:08 +08:00
s . add_dependency " concurrent-ruby " , " ~> 1.0 " , " >= 1.3.1 "
2022-06-03 03:21:35 +08:00
s . add_dependency " connection_pool " , " >= 2.2.5 "
2024-02-08 19:41:04 +08:00
s . add_dependency " minitest " , " >= 5.1 "
Add `drb`, `mutex_m` and `base64` that are bundled gem candidates for Ruby 3.4
This commit adds `drb`, `mutex_m` and `base64` to `activesupport/activesupport.gemspec`
because 3.3.0dev shows warnings if bundled gem candidates are required
like `mutex_m will be not part of the default gems since Ruby 3.4.0. Add it to your Gemfile.`
- Example
```
$ ruby -v ; ruby generic_main.rb
ruby 3.3.0dev (2023-08-07T23:09:02Z master 0e5da05a32) [x86_64-linux]
Fetching https://github.com/rails/rails.git
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.......
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/bundler/gems/rails-2942958827f1/activesupport/lib/active_support/notifications/fanout.rb:3: warning: mutex_m will be not part of the default gems since Ruby 3.4.0. Add it to your Gemfile.
/home/yahonda/.rbenv/versions/trunk/lib/ruby/gems/3.3.0+0/bundler/gems/rails-2942958827f1/activesupport/lib/active_support/message_encryptor.rb:4: warning: base64 will be not part of the default gems since Ruby 3.4.0. Add it to your Gemfile.
generic_main.rb:16: warning: drb will be not part of the default gems since Ruby 3.4.0. Add it to your inline Gemfile.
$
```
- generic_main.rb
```
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: "rails/rails", branch: "main"
end
require "active_support"
require "minitest/autorun"
require "drb"
require "base64"
require "mutex_m"
```
These gems are chosen as follows.
- Bundled gems candidates for Ruby 3.4
```ruby
$ ruby -v ; ruby -e 'pp Gem::BUNDLED_GEMS::SINCE.select { |k,v| v == "3.4.0" }'
ruby 3.3.0dev (2023-08-07T23:09:02Z master 0e5da05a32) [x86_64-linux]
{"abbrev"=>"3.4.0",
"observer"=>"3.4.0",
"getoptlong"=>"3.4.0",
"resolv-replace"=>"3.4.0",
"rinda"=>"3.4.0",
"nkf"=>"3.4.0",
"syslog"=>"3.4.0",
"drb"=>"3.4.0",
"mutex_m"=>"3.4.0",
"csv"=>"3.4.0",
"base64"=>"3.4.0"}
$
```
- `drb`, `mutex_m` and `base64` are required by Rails
- "drb"
```ruby
$ git grep 'require "drb"'
activesupport/lib/active_support/testing/parallelization.rb:require "drb"
activesupport/lib/active_support/testing/parallelization/server.rb:require "drb"
```
- "mutex_m"
```ruby
$ git grep 'require "mutex_m"'
actionpack/lib/action_controller/metal/params_wrapper.rb: require "mutex_m"
activerecord/lib/active_record/attribute_methods.rb:require "mutex_m"
activerecord/lib/active_record/relation/delegation.rb:require "mutex_m"
activesupport/lib/active_support/notifications/fanout.rb:require "mutex_m"
```
- "base64" usage
```ruby
$ git grep 'require "base64"'
actioncable/Rakefile:require "base64"
actionmailer/lib/action_mailer/inline_preview_interceptor.rb:require "base64"
actionpack/lib/action_controller/metal/http_authentication.rb:require "base64"
actionview/Rakefile:require "base64"
activerecord/lib/active_record/encryption/message_serializer.rb:require "base64"
activerecord/lib/active_record/fixture_set/render_context.rb:require "base64"
activerecord/test/cases/encryption/message_serializer_test.rb:require "base64"
activesupport/lib/active_support/message_encryptor.rb:require "base64"
activesupport/lib/active_support/message_verifier.rb:require "base64"
activesupport/lib/active_support/xml_mini.rb:require "base64"
railties/test/application/mailer_previews_test.rb:require "base64"
```
- Dependency between Rails related modules
- "drb" is only required by Active Support
- "mutex_m" is required by Action Pack, Active Record and Active Support
Action Pack and Active Record depend on Active Support. Therefore, adding dependency to Active Support is fine.
https://github.com/rails/rails/blob/2942958827f1934dfcba284d074e6d61104d3e7c/actionpack/actionpack.gemspec#L36
https://github.com/rails/rails/blob/2942958827f1934dfcba284d074e6d61104d3e7c/activerecord/activerecord.gemspec#L38
- "base64" is required by Action Cable, Action Mailer, Action Pack, Action View,
Active Record, Active Support and Raillties.
Action Cable, Action Mailer, Action Pack, Action View and Active Record and Railties depend
on Active Support. Therefore, adding dependency to Active Support is fine.
https://github.com/rails/rails/blob/2942958827f1934dfcba284d074e6d61104d3e7c/actioncable/actioncable.gemspec#L35
https://github.com/rails/rails/blob/2942958827f1934dfcba284d074e6d61104d3e7c/actionmailer/actionmailer.gemspec#L36
https://github.com/rails/rails/blob/2942958827f1934dfcba284d074e6d61104d3e7c/actionpack/actionpack.gemspec#L36
https://github.com/rails/rails/blob/2942958827f1934dfcba284d074e6d61104d3e7c/actionview/actionview.gemspec#L36
https://github.com/rails/rails/blob/2942958827f1934dfcba284d074e6d61104d3e7c/actionpack/actionpack.gemspec#L36
https://github.com/rails/rails/blob/2942958827f1934dfcba284d074e6d61104d3e7c/railties/railties.gemspec#L40
Refer to:
https://bugs.ruby-lang.org/issues/19776
https://github.com/ruby/ruby/pull/8126
https://github.com/rubygems/rubygems/pull/6840
2023-08-08 15:46:50 +08:00
s . add_dependency " base64 "
s . add_dependency " drb "
2023-12-17 14:05:47 +08:00
s . add_dependency " bigdecimal "
2009-09-01 08:20:44 +08:00
end