Commit Graph

131 Commits

Author SHA1 Message Date
Rafael Mendonça França f624ed09ab
Don't make rexml an dependency of activesupport
rexml is only used in the xml_mini backend and it should be the users
choice if they want to use that feature or not. If they do we will warn
them that installing rexml is needed like we do with all backends.
2020-09-24 22:41:04 +00:00
Ryuta Kamizono c23533ee0b rexml is no longer default gem in Ruby 3.0
https://bugs.ruby-lang.org/issues/16485
https://github.com/ruby/ruby/pull/2832

Unless adding `s.add_dependency "rexml"` in the gemspec,
`ActiveSupport::XmlMini` with default engine (REXML) won't work.

```ruby
# frozen_string_literal: true

require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"

  git_source(:github) { |repo| "https://github.com/#{repo}.git" }

  gem "activesupport", github: "rails/rails"
end

require "active_support"
require "active_support/xml_mini"
require "minitest/autorun"

class BugTest < Minitest::Test
  def test_stuff
    xml_string = "<root></root>"
    assert_equal({ "root" => {} }, ActiveSupport::XmlMini.parse(xml_string))
  end
end
```

```
% ruby xml_mini.rb
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/............
Resolving dependencies...
Using bundler 2.2.0.dev
Using concurrent-ruby 1.1.7
Using minitest 5.14.2
Using zeitwerk 2.4.0
Using i18n 1.8.5
Using tzinfo 2.0.2
Using activesupport 6.1.0.alpha from source at `..`
Run options: --seed 20428

# Running:

E

Finished in 0.002034s, 491.6421 runs/s, 0.0000 assertions/s.

  1) Error:
BugTest#test_stuff:
LoadError: cannot load such file -- rexml/document
    /Users/kamipo/src/github.com/rails/rails/activesupport/lib/active_support/xml_mini/rexml.rb:28:in `require'
    /Users/kamipo/src/github.com/rails/rails/activesupport/lib/active_support/xml_mini/rexml.rb:28:in `block in parse'
    /Users/kamipo/src/github.com/rails/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:15:in `block in silence_warnings'
    /Users/kamipo/src/github.com/rails/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:28:in `with_warnings'
    /Users/kamipo/src/github.com/rails/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:15:in `silence_warnings'
    /Users/kamipo/src/github.com/rails/rails/activesupport/lib/active_support/xml_mini/rexml.rb:28:in `parse'
    /Users/kamipo/src/github.com/rails/rails/activesupport/lib/active_support/xml_mini.rb:94:in `parse'
    xml_mini.rb:23:in `test_stuff'

1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
```

Follow up of 0399be7076.
2020-09-24 16:07:16 +09:00
David Heinemeier Hansson 36a33d721c Needlessly tight dependency spec
Let it float, unless there's a specific threat to the opposite.
2020-05-31 16:45:37 -07:00
Xavier Noria cf71309684 Depend on Zeitwerk 2.3
Let's bump Zeitwerk in preparation for Rails 6.1.

With Zeitwerk 2.3, applications can enable reloading and eager loading
at the same time. As of this writing, Rails does not implement that
logic, but if we do we know the dependency is in place to support it.

Zeitwerk minor releases are backwards compatible, should be a seamlessly
upgrade.
2020-05-02 11:53:30 +02: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
Phil Ross e9425abe33
Update to TZInfo v2.0.0
Co-authored-by: Jared Beck <jared@jaredbeck.com>
Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
2020-03-28 20:42:43 +01:00
Jean Boussier 54878cd44b Distinguish missing controller exceptions from unrelated NameError
Fix: https://github.com/rails/rails/issues/37650

The classic autoloader used to totally unregister any constant that
failed midway. Which mean `"SomeConst".constantize` was idempotent.

However Zeitwerk rely on normal `Kernel#require` behavior, which mean
that if an exception is raised during a class/module definition,
it will be left incompletely defined. For instance:

```ruby
class FooController
  ::DoesNotExist

  def index
  end
end
```

Will leave `FooController` defined, but without its `index` method.

Because of this, when silencing a NameError, it's important
to make sure the missing constant is really the one we were trying
to load.
2019-12-04 16:11:54 +01:00
Diego Plentz 9731bcbee7 Add I18n to eager_load_namespaces 2019-11-21 14:59:22 -05:00
Orien Madgwick 493edf044f Add bug tracker/documentation/mailing list URIs to the gemspecs 2019-10-11 20:47:19 -04:00
Xavier Noria 245f255318 bump Zeitwerk to 2.2 2019-10-09 21:30:48 +02:00
Xavier Noria 72e257b4c9 bumps Zeitwerk
This version makes eager loading and autoloading consistent,
as documented in the upgrading guide.
2019-06-30 23:57:19 +02:00
Xavier Noria 1b2efe5a11 upgrades Zeitwerk to 2.1.4
This commit more or less undoes 9b5401f, restores autoloaded? not to
touch the descendants tracker, and autoloaded_constants because it is
documented in the guide.
2019-04-23 01:18:21 +02:00
Xavier Noria 7b6b10542d improves the reloading disabled error message
The original message from Zeitwerk is "can't reload, please call
loader.enable_reloading before setup (Zeitwerk::Error)", which is not
very informative for Rails programmers.

Rails should err with a message worded in terms of its interface.
2019-04-11 23:10:13 +02:00
Xavier Noria 9b5401fcc9 depend on Zeitwerk 2.1.0 2019-04-09 11:06:44 +02:00
Xavier Noria 57c7cbb162 depend on Zeitwerk 2 2019-04-07 13:05:26 +02:00
Xavier Noria 379d7e8bfa bumps Zeitwerk and Bootsnap 2019-03-26 20:30:18 +01:00
Xavier Noria 3acf5f71f0 Depend on Zeitwerk 1.4.2 2019-03-23 14:42:24 +01:00
Xavier Noria 3d0850bfb8 depend on Zeitwerk 1.4.0 2019-03-19 13:07:31 +01:00
Xavier Noria 85984e5031 bumps Zeitwerk 2019-03-14 14:42:12 -07:00
Xavier Noria 96242410a8 bump Zeitwerk to 1.3.3 2019-03-11 16:11:35 -07:00
Abhay Nikam 027e492b6f Fix links in gemspec and docs from http to https. 2019-03-09 19:42:35 +05:30
Xavier Noria 71e23d33ae Bump Zeitwerk 2019-03-06 12:08:08 -08:00
Xavier Noria 24092b7115 Upgrade Zeitwerk to 1.3.1 2019-02-23 05:16:03 -08:00
Xavier Noria 159b9c40db bump Zeitwerk 2019-02-21 14:27:32 -08:00
Xavier Noria 07346c4b35 upgrades Zeitwerk to 1.2.0 2019-02-17 10:10:05 -08:00
Xavier Noria 870377915a Replace autoloader accessors with Rails.autoloaders.{main,once}
Rails.autoloader and Rails.once_autoloader was just tentative API good
enough for a first patch. Rails.autoloader is singular and does not
convey in its name that there is another autoloader. That might be
confusing, for example if you set a logger and miss traces. On the other
hand, the name `once_autoloader` is very close to being horrible.

Rails.autoloaders.main and Rails.autoloaders.once read better for my
taste, and have a nice symmetry. Also, both "main" and "once" are four
letters long, short and same length.

They are tagged as "rails.main" and "rails.once", respectively.

References #35235.
2019-02-14 22:34:16 -08:00
Xavier Noria c36b6c8d38 Let Zeitwerk be a dependency of Active Support
Zeitwerk is a strong dependency, planned to replace AS::Dependencies. A
line in the generated Gemfile does not convey this as much.
2019-02-13 12:27:53 -08:00
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 f66a977fc7.
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 8eaffe7e89, reversing
changes made to b6e4305c3b.
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
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
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
Rafael Mendonça França 2e87ea6d70 Don't force people to upgrade i18n gem 2018-02-14 11:55:36 -05:00
Ryan Bigg 068fc462fd
Bump i18n to 1.0 2018-02-14 12:49:19 +11:00
Koichi ITO ac717d65a3 [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` 2017-07-11 13:12:32 +09:00
Kir Shatrov 72950568dd Use frozen-string-literal in ActiveSupport 2017-07-09 15:08:29 +03:00
Matthew Draper 87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30
Kir Shatrov cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Grey Baker 3e6ce1cd69 Add source code and changelog links to gemspecs 2017-06-28 10:06:01 +01:00
bogdanvlviv 40bdbce191
Define path with __dir__
".. with __dir__ we can restore order in the Universe." - by @fxn

Related to 5b8738c2df
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
Jeremy Daer 06dc3fba46
Fix template resolver cache concurrency: "can't add a new key into hash during iteration"
Resolved by https://github.com/ruby-concurrency/concurrent-ruby/pull/529

Fixes #24627.
2016-05-02 15:05:03 -07: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
Mike Perham cf18c34e3a Remove unused dependency
railties uses method_source, activesupport does not.  I assume code was refactored and the dependency wasn't removed.
2016-02-03 14:28:55 -08:00
Mike Perham f3433f7c75 Remove json gem dependency
All modern Rubies ship JSON as part of stdlib.  Using the gem actually hurts multi-platform support due to build difficulties on Windows.
2016-02-03 10:49:14 -08:00
Rafael Mendonça França 788d7bce3d Using released concurrent-ruby 2015-11-16 18:26:39 -02:00
Jerry D'Antonio 23b6f65fd1 Require only necessary concurrent-ruby classes. 2015-11-04 21:12:28 -05:00
Jerry D'Antonio 33e506cb4a Fixed concurrent-ruby warnings.
Bumped version of concurrent-ruby to 1.0.0.pre3, which fixes all
interpreter warnings.
2015-09-29 21:31:49 -04:00