Skip to content

Commit

Permalink
Simplify 2.7 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Jan 30, 2024
1 parent 3ffa190 commit 84ba1e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
8 changes: 8 additions & 0 deletions lib/phlex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions lib/phlex/elements.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 0 additions & 11 deletions lib/phlex/overrides.rb

This file was deleted.

0 comments on commit 84ba1e2

Please sign in to comment.