diff --git a/lib/phlex.rb b/lib/phlex.rb index 4f367dd8..cceae5d2 100644 --- a/lib/phlex.rb +++ b/lib/phlex.rb @@ -33,3 +33,11 @@ class NameError < ::NameError # @api private ATTRIBUTE_CACHE = Concurrent::Map.new end + +if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0") + class Symbol + def name + to_s + end + end +end diff --git a/lib/phlex/elements.rb b/lib/phlex/elements.rb index 3fbec2e3..417709da 100644 --- a/lib/phlex/elements.rb +++ b/lib/phlex/elements.rb @@ -1,9 +1,5 @@ # frozen_string_literal: true -if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0") - using Phlex::Overrides::Symbol::Name -end - # Extending this module provides the {register_element} macro for registering your own custom elements. It's already extended by {HTML} and {SVG}. # @example # module MyCustomElements diff --git a/lib/phlex/overrides.rb b/lib/phlex/overrides.rb deleted file mode 100644 index 8167c014..00000000 --- a/lib/phlex/overrides.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -module Phlex - module Overrides - module Symbol - module Name - refine(Symbol) { alias_method :name, :to_s } - end - end - end -end