Sha256: b55b2b51123f308a93f12325318b052f3d829d4ed17affccd74a8b2c01b32ada

Contents?: true

Size: 421 Bytes

Versions: 2

Compression:

Stored size: 421 Bytes

Contents

require 'squash_whitespace'

module SquashWhitespace
  module Helpers
    def squash_whitespace(options = {}, &block)
      unless @squashing_whitespace
        begin
          @squashing_whitespace = true
          SquashWhitespace.squash_html(capture(&block).to_s, options)
        ensure
          @squashing_whitespace = false
        end
      else
        capture(&block).to_s
      end.html_safe
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
squash_whitespace-0.0.2 lib/squash_whitespace/helpers.rb
squash_whitespace-0.0.1 lib/squash_whitespace/helpers.rb