Sha256: 84a152f7111fd664d0a94260a2f5ab10c189d3c0565d3a5b0d2ef17de144f08f

Contents?: true

Size: 304 Bytes

Versions: 96

Compression:

Stored size: 304 Bytes

Contents

module Temple
  module Filters
    # Remove BOM from input string
    #
    # @api public
    class RemoveBOM < Parser
      def call(s)
        return s if s.encoding.name !~ /^UTF-(8|16|32)(BE|LE)?/
        s.gsub(Regexp.new("\\A\uFEFF".encode(s.encoding.name)), ''.freeze)
      end
    end
  end
end

Version data entries

96 entries across 82 versions & 6 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
brakeman-6.1.2 bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
brakeman-6.1.1 bundle/ruby/3.0.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
brakeman-6.1.0 bundle/ruby/3.1.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
brakeman-6.0.1 bundle/ruby/3.1.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
brakeman-6.0.0 bundle/ruby/3.0.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
brakeman-5.4.1 bundle/ruby/3.1.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
temple-0.10.0 lib/temple/filters/remove_bom.rb
brakeman-5.4.0 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
temple-0.9.1 lib/temple/filters/remove_bom.rb
temple-0.9.0 lib/temple/filters/remove_bom.rb
brakeman-5.3.1 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
brakeman-5.3.0 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
brakeman-5.2.3 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
brakeman-5.2.2 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb
brakeman-5.2.1 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb