lib/phlex/helpers.rb in phlex-1.3.3 vs lib/phlex/helpers.rb in phlex-1.4.0
- old
+ new
@@ -1,9 +1,9 @@
# frozen_string_literal: true
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0")
- using Overrides::Symbol::Name
+ using Phlex::Overrides::Symbol::Name
end
module Phlex::Helpers
private def tokens(*tokens, **conditional_tokens)
conditional_tokens.each do |condition, token|
@@ -23,10 +23,13 @@
when Hash then __append_token__(tokens, token[:else])
end
end
end
- tokens.join(" ")
+ tokens = tokens.select(&:itself).join(" ")
+ tokens.strip!
+ tokens.gsub!(/\s+/, " ")
+ tokens
end
private def __append_token__(tokens, token)
case token
when nil then nil