Sha256: 8c7b29ce9315f43e6aa7a53a96267d3a16d2a30e94f9e3cc2fa9339df714fca1

Contents?: true

Size: 412 Bytes

Versions: 5

Compression:

Stored size: 412 Bytes

Contents

module Nitro
  
# Compress the inline xhtml. Does not touch the ruby code.
 
class Squeeze
  
  # Compresses the inline xhtml. Does not touch the ruby code.
   
  def self.transform(text)
    return text.gsub(/\@out \<\< \%\^(.*?)\^/m) do |match|
      c = $1.gsub(/^(\s*)/m, '').squeeze(" \t").tr("\n", '').tr("\t", ' ')
      "@out << %{#{c}}"
    end
  end
  
end
  
end

# * George Moschovitis <gm@navel.gr>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nitro-0.25.0 lib/nitro/compiler/squeeze.rb
nitro-0.26.0 lib/nitro/compiler/squeeze.rb
nitro-0.27.0 lib/nitro/compiler/squeeze.rb
nitro-0.28.0 lib/nitro/compiler/squeeze.rb
nitro-0.29.0 lib/nitro/compiler/squeeze.rb