Sha256: 2bcd0c1f3c443ae621c1cc3b9aef782290c3dfad1eab9abeb83dbfd65cac42ac

Contents?: true

Size: 414 Bytes

Versions: 11

Compression:

Stored size: 414 Bytes

Contents

require_relative 'base'

module Faml
  module FilterCompilers
    class Javascript < Base
      def compile(ast)
        temple = [:multi, [:static, "\n"], [:newline]]
        compile_texts(temple, ast.lineno, ast.texts, tab_width: 2)
        temple << [:static, "\n"]
        [:haml, :tag, 'script', false, [:html, :attrs], [:html, :js, temple]]
      end
    end

    register(:javascript, Javascript)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
faml-0.6.0 lib/faml/filter_compilers/javascript.rb
faml-0.5.1 lib/faml/filter_compilers/javascript.rb
faml-0.5.0 lib/faml/filter_compilers/javascript.rb
faml-0.4.2 lib/faml/filter_compilers/javascript.rb
faml-0.4.1 lib/faml/filter_compilers/javascript.rb
faml-0.4.0 lib/faml/filter_compilers/javascript.rb
faml-0.3.6 lib/faml/filter_compilers/javascript.rb
faml-0.3.5 lib/faml/filter_compilers/javascript.rb
faml-0.3.4 lib/faml/filter_compilers/javascript.rb
faml-0.3.3 lib/faml/filter_compilers/javascript.rb
faml-0.3.2 lib/faml/filter_compilers/javascript.rb