2017-08-13 21:14:22 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-07 01:23:19 +08:00
|
|
|
source "https://rubygems.org"
|
2010-12-19 02:42:03 +08:00
|
|
|
gemspec
|
|
|
|
|
2022-06-16 00:44:11 +08:00
|
|
|
if RUBY_VERSION < "3"
|
|
|
|
gem "minitest", ">= 5.15.0", "< 5.16"
|
|
|
|
else
|
|
|
|
gem "minitest", ">= 5.15.0"
|
|
|
|
end
|
2021-12-16 05:20:38 +08:00
|
|
|
|
2014-09-14 16:21:55 +08:00
|
|
|
# We need a newish Rake since Active Job sets its test tasks' descriptions.
|
2022-12-15 15:14:22 +08:00
|
|
|
gem "rake", ">= 13"
|
2014-09-14 16:21:55 +08:00
|
|
|
|
2021-10-09 23:03:05 +08:00
|
|
|
gem "sprockets-rails", ">= 2.0.0"
|
|
|
|
gem "propshaft", ">= 0.1.7"
|
2023-07-29 18:35:47 +08:00
|
|
|
gem "capybara", ">= 3.39"
|
2023-08-02 21:56:08 +08:00
|
|
|
if RUBY_VERSION < "3"
|
|
|
|
gem "selenium-webdriver", "<= 4.9.0"
|
|
|
|
gem "webdrivers"
|
|
|
|
else
|
|
|
|
gem "selenium-webdriver", ">= 4.11.0"
|
|
|
|
end
|
2017-02-20 00:50:42 +08:00
|
|
|
|
2016-08-07 01:23:19 +08:00
|
|
|
gem "rack-cache", "~> 1.2"
|
2021-08-26 16:39:36 +08:00
|
|
|
gem "stimulus-rails"
|
|
|
|
gem "turbo-rails"
|
2021-09-06 22:44:44 +08:00
|
|
|
gem "jsbundling-rails"
|
2021-09-07 23:48:13 +08:00
|
|
|
gem "cssbundling-rails"
|
2021-08-26 16:39:36 +08:00
|
|
|
gem "importmap-rails"
|
2021-09-07 23:48:13 +08:00
|
|
|
gem "tailwindcss-rails"
|
2023-03-01 13:51:29 +08:00
|
|
|
gem "dartsass-rails"
|
2014-02-22 04:58:09 +08:00
|
|
|
# require: false so bcrypt is loaded only when has_secure_password is used.
|
2015-10-12 19:48:04 +08:00
|
|
|
# This is to avoid Active Model (and by extension the entire framework)
|
2014-02-22 04:58:09 +08:00
|
|
|
# being dependent on a binary library.
|
2016-08-07 01:23:19 +08:00
|
|
|
gem "bcrypt", "~> 3.1.11", require: false
|
2014-02-22 04:58:09 +08:00
|
|
|
|
2015-10-12 19:48:04 +08:00
|
|
|
# This needs to be with require false to avoid it being automatically loaded by
|
|
|
|
# sprockets.
|
2021-06-28 12:48:56 +08:00
|
|
|
gem "terser", ">= 1.1.4", require: false
|
2015-09-30 22:42:31 +08:00
|
|
|
|
2016-11-15 08:26:03 +08:00
|
|
|
# Explicitly avoid 1.x that doesn't support Ruby 2.4+
|
|
|
|
gem "json", ">= 2.0.0"
|
|
|
|
|
2022-11-28 12:53:28 +08:00
|
|
|
# Workaround until Ruby ships with cgi version 0.3.6 or higher.
|
|
|
|
gem "cgi", ">= 0.3.6", require: false
|
|
|
|
|
2023-05-13 14:48:04 +08:00
|
|
|
group :lint do
|
|
|
|
gem "syntax_tree", "6.1.1", require: false
|
|
|
|
end
|
|
|
|
|
2020-03-28 07:55:26 +08:00
|
|
|
group :rubocop do
|
2022-02-23 23:48:33 +08:00
|
|
|
gem "rubocop", ">= 1.25.1", require: false
|
2021-06-24 18:46:21 +08:00
|
|
|
gem "rubocop-minitest", require: false
|
2020-09-06 09:07:04 +08:00
|
|
|
gem "rubocop-packaging", require: false
|
2020-03-28 07:55:26 +08:00
|
|
|
gem "rubocop-performance", require: false
|
|
|
|
gem "rubocop-rails", require: false
|
2023-03-15 09:37:11 +08:00
|
|
|
gem "rubocop-md", require: false
|
2020-03-28 07:55:26 +08:00
|
|
|
end
|
2016-11-28 11:12:33 +08:00
|
|
|
|
2023-03-27 11:14:18 +08:00
|
|
|
group :mdl do
|
|
|
|
gem "mdl", require: false
|
|
|
|
end
|
|
|
|
|
2011-01-13 04:15:57 +08:00
|
|
|
group :doc do
|
2023-08-28 23:29:58 +08:00
|
|
|
gem "sdoc", git: "https://github.com/rails/sdoc.git", branch: "main"
|
2023-02-06 15:28:56 +08:00
|
|
|
gem "rdoc", "~> 6.5"
|
2016-08-07 01:23:19 +08:00
|
|
|
gem "redcarpet", "~> 3.2.3", platforms: :ruby
|
2020-09-21 13:19:59 +08:00
|
|
|
gem "w3c_validators", "~> 1.3.6"
|
2020-07-04 16:59:08 +08:00
|
|
|
gem "rouge"
|
2022-07-06 14:59:06 +08:00
|
|
|
gem "rubyzip", "~> 2.0"
|
2011-01-13 04:15:57 +08:00
|
|
|
end
|
2009-11-11 06:59:22 +08:00
|
|
|
|
2018-12-25 04:16:22 +08:00
|
|
|
# Active Support
|
2021-10-15 01:48:04 +08:00
|
|
|
gem "dalli", ">= 3.0.1"
|
2020-11-10 23:52:20 +08:00
|
|
|
gem "listen", "~> 3.3", require: false
|
2016-11-19 23:46:28 +08:00
|
|
|
gem "libxml-ruby", platforms: :ruby
|
2017-12-14 23:05:13 +08:00
|
|
|
gem "connection_pool", require: false
|
2020-09-25 06:41:04 +08:00
|
|
|
gem "rexml", require: false
|
Add ActiveSupport::MessagePack
`ActiveSupport::MessagePack` is a serializer that integrates with the
`msgpack` gem to serialize a variety of Ruby objects. `AS::MessagePack`
supports several types beyond the base types that `msgpack` supports,
including `Time` and `Range`, as well as Active Support types such as
`AS::TimeWithZone` and `AS::HashWithIndifferentAccess`.
Compared to `JSON` and `Marshal`, `AS::MessagePack` can provide a
performance improvement and message size reduction. For example, when
used with `MessageVerifier`:
```ruby
# frozen_string_literal: true
require "benchmark/ips"
require "active_support/all"
require "active_support/message_pack"
marshal_verifier = ActiveSupport::MessageVerifier.new("secret", serializer: Marshal)
json_verifier = ActiveSupport::MessageVerifier.new("secret", serializer: JSON)
asjson_verifier = ActiveSupport::MessageVerifier.new("secret", serializer: ActiveSupport::JSON)
msgpack_verifier = ActiveSupport::MessageVerifier.new("secret", serializer: ActiveSupport::MessagePack)
ActiveSupport::Messages::Metadata.use_message_serializer_for_metadata = true
expiry = 1.year.from_now
data = { bool: true, num: 123456789, string: "x" * 50 }
Benchmark.ips do |x|
x.report("Marshal") do
marshal_verifier.verify(marshal_verifier.generate(data, expires_at: expiry))
end
x.report("JSON") do
json_verifier.verify(json_verifier.generate(data, expires_at: expiry))
end
x.report("AS::JSON") do
asjson_verifier.verify(asjson_verifier.generate(data, expires_at: expiry))
end
x.report("MessagePack") do
msgpack_verifier.verify(msgpack_verifier.generate(data, expires_at: expiry))
end
x.compare!
end
puts "Marshal size: #{marshal_verifier.generate(data, expires_at: expiry).bytesize}"
puts "JSON size: #{json_verifier.generate(data, expires_at: expiry).bytesize}"
puts "MessagePack size: #{msgpack_verifier.generate(data, expires_at: expiry).bytesize}"
```
```
Warming up --------------------------------------
Marshal 1.206k i/100ms
JSON 1.165k i/100ms
AS::JSON 790.000 i/100ms
MessagePack 1.798k i/100ms
Calculating -------------------------------------
Marshal 11.748k (± 1.3%) i/s - 59.094k in 5.031071s
JSON 11.498k (± 1.4%) i/s - 58.250k in 5.066957s
AS::JSON 7.867k (± 2.4%) i/s - 39.500k in 5.024055s
MessagePack 17.865k (± 0.8%) i/s - 89.900k in 5.032592s
Comparison:
MessagePack: 17864.9 i/s
Marshal: 11747.8 i/s - 1.52x (± 0.00) slower
JSON: 11498.4 i/s - 1.55x (± 0.00) slower
AS::JSON: 7866.9 i/s - 2.27x (± 0.00) slower
Marshal size: 254
JSON size: 234
MessagePack size: 194
```
Additionally, `ActiveSupport::MessagePack::CacheSerializer` is a
serializer that is suitable for use as an `ActiveSupport::Cache` coder.
`AS::MessagePack::CacheSerializer` can serialize `ActiveRecord::Base`
instances, including loaded associations. Like `AS::MessagePack`, it
provides a performance improvement and payload size reduction:
```ruby
# frozen_string_literal: true
require "benchmark/ips"
require "active_support/message_pack"
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Schema.define do
create_table :posts, force: true do |t|
t.string :body
t.timestamps
end
create_table :comments, force: true do |t|
t.integer :post_id
t.string :body
t.timestamps
end
end
class Post < ActiveRecord::Base
has_many :comments
end
class Comment < ActiveRecord::Base
belongs_to :post
end
post = Post.create!(body: "x" * 100)
2.times { post.comments.create!(body: "x" * 100) }
post.comments.load
cache_entry = ActiveSupport::Cache::Entry.new(post)
Rails70Coder = ActiveSupport::Cache::Coders::Rails70Coder
CacheSerializer = ActiveSupport::MessagePack::CacheSerializer
Benchmark.ips do |x|
x.report("Rails70Coder") do
Rails70Coder.load(Rails70Coder.dump(cache_entry))
end
x.report("CacheSerializer") do
CacheSerializer.load(CacheSerializer.dump(cache_entry))
end
x.compare!
end
puts "Rails70Coder size: #{Rails70Coder.dump(cache_entry).bytesize}"
puts "CacheSerializer size: #{CacheSerializer.dump(cache_entry).bytesize}"
```
```
Warming up --------------------------------------
Rails70Coder 329.000 i/100ms
CacheSerializer 492.000 i/100ms
Calculating -------------------------------------
Rails70Coder 3.285k (± 1.7%) i/s - 16.450k in 5.008447s
CacheSerializer 4.895k (± 2.4%) i/s - 24.600k in 5.028803s
Comparison:
CacheSerializer: 4894.7 i/s
Rails70Coder: 3285.4 i/s - 1.49x slower
Rails70Coder size: 808
CacheSerializer size: 593
```
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2023-03-23 05:37:46 +08:00
|
|
|
gem "msgpack", ">= 1.7.0", require: false
|
2010-07-26 06:31:45 +08:00
|
|
|
|
2020-12-13 15:34:39 +08:00
|
|
|
# for railties
|
2019-04-26 15:25:28 +08:00
|
|
|
gem "bootsnap", ">= 1.4.4", require: false
|
2020-12-13 15:34:39 +08:00
|
|
|
gem "webrick", require: false
|
Always run `rails app:update` in app update tests
Prior to this commit, several tests in `AppGeneratorTest` were testing
app update behavior without actually running `rails app:update`. This
meant the logic in `Rails::AppUpdater#generator_options` that detects
which frameworks and components are installed was not being tested.
Additionally, because `ENV["BUNDLE_GEMFILE"]` is set when tests are run
(by `require "bundler/setup"` in `tools/test.rb`), any tests which did
run `rails app:update` used the Rails repo Gemfile, instead of the
generated app Gemfile. The difference becomes obvious when running
`rails app:update` after generating an app without Sprockets (as in
`test_app_update_does_not_generate_manifest_config_when_propshaft_is_used`),
because `rails app:update` will load the Sprockets railtie (due to
`Bundler.require` using the Rails repo Gemfile), and then exit with a
`Sprockets::Railtie::ManifestNeededError`. However, if
`rails app:update` is run within a `quietly` block, such an error will
be swallowed.
This commit changes all such tests to run `rails app:update` via a
`run_app_update` helper that: (1) overrides the `BUNDLE_GEMFILE`
environment variable to point to the generated app Gemfile, (2) points
the `rails` gem in the generated app Gemfile to the Rails repo
(otherwise the `rails` gem version cannot be resolved), and (3) sets
`exception: true` so that the `system` call will raise an error if
`rails app:update` exits with an error code.
This commit also adds `jbuilder` and `web-console` to the Rails repo
Gemfile to ensure they are already installed when evaluating the
generated app Gemfile.
These changes do add a couple dozen seconds to the test suite run time,
but the thorough test coverage seems worth it.
2022-10-04 06:26:04 +08:00
|
|
|
gem "jbuilder", require: false
|
|
|
|
gem "web-console", require: false
|
2019-02-12 04:44:25 +08:00
|
|
|
|
2023-01-25 10:26:34 +08:00
|
|
|
# Action Pack and railties
|
2023-06-13 12:44:08 +08:00
|
|
|
rack_version = ENV.fetch("RACK", "~> 3.0")
|
2023-07-18 07:15:20 +08:00
|
|
|
if rack_version != "head"
|
|
|
|
gem "rack", rack_version
|
|
|
|
else
|
|
|
|
gem "rack", git: "https://github.com/rack/rack.git", branch: "main"
|
|
|
|
end
|
2023-01-25 10:26:34 +08:00
|
|
|
|
2018-12-25 04:16:22 +08:00
|
|
|
# Active Job
|
2014-08-20 10:21:39 +08:00
|
|
|
group :job do
|
2017-02-10 14:31:41 +08:00
|
|
|
gem "resque", require: false
|
2017-12-14 06:49:08 +08:00
|
|
|
gem "resque-scheduler", require: false
|
2017-10-09 19:49:55 +08:00
|
|
|
gem "sidekiq", require: false
|
2016-08-07 01:23:19 +08:00
|
|
|
gem "sucker_punch", require: false
|
2017-12-30 05:57:28 +08:00
|
|
|
gem "delayed_job", require: false
|
2022-05-18 13:04:19 +08:00
|
|
|
gem "queue_classic", ">= 4.0.0", require: false, platforms: :ruby
|
2016-08-07 01:23:19 +08:00
|
|
|
gem "sneakers", require: false
|
|
|
|
gem "backburner", require: false
|
2017-01-29 08:05:06 +08:00
|
|
|
gem "delayed_job_active_record", require: false
|
2014-08-20 10:21:39 +08:00
|
|
|
end
|
2014-08-12 17:29:21 +08:00
|
|
|
|
2015-12-14 23:38:37 +08:00
|
|
|
# Action Cable
|
|
|
|
group :cable do
|
2022-09-22 03:46:43 +08:00
|
|
|
gem "puma", ">= 5.0.3", require: false
|
2016-01-24 18:43:40 +08:00
|
|
|
|
2022-09-07 04:23:50 +08:00
|
|
|
gem "redis", ">= 4.0.1", require: false
|
2017-09-29 12:54:00 +08:00
|
|
|
|
2021-02-22 17:48:02 +08:00
|
|
|
gem "redis-namespace"
|
2016-01-25 01:25:53 +08:00
|
|
|
|
2016-10-06 09:11:18 +08:00
|
|
|
gem "websocket-client-simple", github: "matthewd/websocket-client-simple", branch: "close-race", require: false
|
2015-12-14 23:38:37 +08:00
|
|
|
end
|
|
|
|
|
2017-10-12 03:31:54 +08:00
|
|
|
# Active Storage
|
2017-08-01 04:53:09 +08:00
|
|
|
group :storage do
|
2017-09-10 11:22:10 +08:00
|
|
|
gem "aws-sdk-s3", require: false
|
2018-05-02 11:20:56 +08:00
|
|
|
gem "google-cloud-storage", "~> 1.11", require: false
|
2021-08-24 03:17:59 +08:00
|
|
|
gem "azure-storage-blob", "~> 2.0", require: false
|
2017-08-01 04:53:09 +08:00
|
|
|
|
2018-04-06 07:48:29 +08:00
|
|
|
gem "image_processing", "~> 1.2"
|
2017-08-01 04:53:09 +08:00
|
|
|
end
|
|
|
|
|
2018-12-25 04:16:22 +08:00
|
|
|
# Action Mailbox
|
|
|
|
gem "aws-sdk-sns", require: false
|
|
|
|
gem "webmock"
|
|
|
|
|
2015-10-12 19:48:04 +08:00
|
|
|
# Add your own local bundler stuff.
|
2017-05-15 22:17:28 +08:00
|
|
|
local_gemfile = File.expand_path(".Gemfile", __dir__)
|
2023-01-21 09:30:47 +08:00
|
|
|
instance_eval File.read local_gemfile if File.exist? local_gemfile
|
2010-11-06 05:11:58 +08:00
|
|
|
|
2013-03-12 02:48:30 +08:00
|
|
|
group :test do
|
2017-07-16 03:19:13 +08:00
|
|
|
gem "minitest-bisect"
|
2021-08-26 16:39:36 +08:00
|
|
|
gem "minitest-ci", require: false
|
2018-10-11 06:33:09 +08:00
|
|
|
gem "minitest-retry"
|
2014-05-17 00:18:21 +08:00
|
|
|
|
2015-04-02 04:09:58 +08:00
|
|
|
platforms :mri do
|
2016-08-07 01:23:19 +08:00
|
|
|
gem "stackprof"
|
2021-09-20 21:18:30 +08:00
|
|
|
gem "debug", ">= 1.1.0", require: false
|
2014-11-17 22:39:32 +08:00
|
|
|
end
|
|
|
|
|
2021-05-25 05:11:38 +08:00
|
|
|
gem "benchmark-ips"
|
2011-07-22 20:55:48 +08:00
|
|
|
end
|
|
|
|
|
2022-09-13 01:44:47 +08:00
|
|
|
platforms :ruby, :windows do
|
2021-01-05 20:52:07 +08:00
|
|
|
gem "nokogiri", ">= 1.8.1", "!= 1.11.0"
|
2011-05-06 01:47:07 +08:00
|
|
|
|
2015-10-12 19:48:04 +08:00
|
|
|
# Needed for compiling the ActionDispatch::Journey parser.
|
2016-08-07 01:23:19 +08:00
|
|
|
gem "racc", ">=1.4.6", require: false
|
2013-02-26 13:10:03 +08:00
|
|
|
|
2015-10-12 19:48:04 +08:00
|
|
|
# Active Record.
|
2023-09-13 02:13:21 +08:00
|
|
|
gem "sqlite3", "~> 1.6", ">= 1.6.6"
|
2010-05-20 04:38:27 +08:00
|
|
|
|
|
|
|
group :db do
|
2022-01-25 19:31:36 +08:00
|
|
|
gem "pg", "~> 1.3"
|
2022-05-04 19:00:35 +08:00
|
|
|
gem "mysql2", "~> 0.5"
|
2023-09-02 04:39:50 +08:00
|
|
|
gem "trilogy", ">= 2.5.0"
|
2010-05-20 04:38:27 +08:00
|
|
|
end
|
2010-07-26 06:31:45 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
platforms :jruby do
|
2016-08-07 01:23:19 +08:00
|
|
|
if ENV["AR_JDBC"]
|
2016-09-14 08:19:09 +08:00
|
|
|
gem "activerecord-jdbcsqlite3-adapter", github: "jruby/activerecord-jdbc-adapter", branch: "master"
|
2013-09-03 14:33:00 +08:00
|
|
|
group :db do
|
2016-09-14 08:19:09 +08:00
|
|
|
gem "activerecord-jdbcmysql-adapter", github: "jruby/activerecord-jdbc-adapter", branch: "master"
|
|
|
|
gem "activerecord-jdbcpostgresql-adapter", github: "jruby/activerecord-jdbc-adapter", branch: "master"
|
2013-09-03 14:33:00 +08:00
|
|
|
end
|
|
|
|
else
|
2016-08-07 01:23:19 +08:00
|
|
|
gem "activerecord-jdbcsqlite3-adapter", ">= 1.3.0"
|
2013-09-03 14:33:00 +08:00
|
|
|
group :db do
|
2016-08-07 01:23:19 +08:00
|
|
|
gem "activerecord-jdbcmysql-adapter", ">= 1.3.0"
|
|
|
|
gem "activerecord-jdbcpostgresql-adapter", ">= 1.3.0"
|
2013-09-03 14:33:00 +08:00
|
|
|
end
|
2013-08-21 02:31:43 +08:00
|
|
|
end
|
2010-01-01 10:49:27 +08:00
|
|
|
end
|
2010-08-17 04:58:17 +08:00
|
|
|
|
2015-10-12 19:48:04 +08:00
|
|
|
# Gems that are necessary for Active Record tests with Oracle.
|
2016-08-07 01:23:19 +08:00
|
|
|
if ENV["ORACLE_ENHANCED"]
|
2010-08-17 04:58:17 +08:00
|
|
|
platforms :ruby do
|
2016-08-07 01:23:19 +08:00
|
|
|
gem "ruby-oci8", "~> 2.2"
|
2010-08-17 04:58:17 +08:00
|
|
|
end
|
2016-09-14 08:19:09 +08:00
|
|
|
gem "activerecord-oracle_enhanced-adapter", github: "rsim/oracle-enhanced", branch: "master"
|
2010-08-17 04:58:17 +08:00
|
|
|
end
|
2011-10-03 10:51:01 +08:00
|
|
|
|
2022-09-13 01:44:47 +08:00
|
|
|
gem "tzinfo-data", platforms: [:windows, :jruby]
|
|
|
|
gem "wdm", ">= 0.1.0", platforms: [:windows]
|
2022-08-10 17:16:25 +08:00
|
|
|
|
|
|
|
# The error_highlight gem only works on CRuby 3.1 or later.
|
|
|
|
# Also, Rails depends on a new API available since error_highlight 0.4.0.
|
|
|
|
# (Note that Ruby 3.1 bundles error_highlight 0.3.0.)
|
2023-09-29 16:15:14 +08:00
|
|
|
if RUBY_VERSION >= "3.1" && RUBY_VERSION < "3.2"
|
2022-11-14 14:56:34 +08:00
|
|
|
gem "error_highlight", ">= 0.4.0", platforms: [:ruby]
|
2022-08-10 17:16:25 +08:00
|
|
|
end
|