Skip to content

Instantly share code, notes, and snippets.

@a2ikm
Last active March 6, 2022 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a2ikm/30fdbfb8ed4b4df6951a9b8295e93a3b to your computer and use it in GitHub Desktop.
Save a2ikm/30fdbfb8ed4b4df6951a9b8295e93a3b to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "activesupport", "~> #{ENV["AS_VERSION"]}"
end
require "active_support"
p RUBY_VERSION
p ActiveSupport.version.to_s
module C
extend ActiveSupport::DescendantsTracker
end
p C.subclasses
module M
extend ActiveSupport::DescendantsTracker
end
p M.subclasses
# $ AS_VERSION=6.1 ruby module-subclasses.rb
# "3.1.0"
# "6.1.4.6"
# []
# []
# $ AS_VERSION=7.0 ruby module-subclasses.rb
# "3.0.2"
# "7.0.2.2"
# []
# []
# $ AS_VERSION=7.0 ruby module-subclasses.rb
# "3.1.0"
# "7.0.2.2"
# []
# /path/to/activesupport-7.0.2.2/lib/active_support/descendants_tracker.rb:83:in `subclasses': super: no superclass method `subclasses' for M:Module (NoMethodError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment