Sha256: b449d575d6380f21e4b4d801af014cadbc863fd821c5e3e673392222fb7da3b9

Contents?: true

Size: 505 Bytes

Versions: 96

Compression:

Stored size: 505 Bytes

Contents

module Temple
  module Generators
    # Implements an ERB generator.
    #
    # @api public
    class ERB < Generator
      def call(exp)
        compile(exp)
      end

      def on_multi(*exp)
        exp.map {|e| compile(e) }.join('')
      end

      def on_capture(name, exp)
        on_code(super)
      end

      def on_static(text)
        text
      end

      def on_dynamic(code)
        "<%= #{code} %>"
      end

      def on_code(code)
        "<% #{code} %>"
      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/generators/erb.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
brakeman-6.1.2 bundle/ruby/3.3.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
brakeman-6.1.1 bundle/ruby/3.0.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
brakeman-6.1.0 bundle/ruby/3.1.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
brakeman-6.0.1 bundle/ruby/3.1.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
brakeman-6.0.0 bundle/ruby/3.0.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
brakeman-5.4.1 bundle/ruby/3.1.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
temple-0.10.0 lib/temple/generators/erb.rb
brakeman-5.4.0 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
temple-0.9.1 lib/temple/generators/erb.rb
temple-0.9.0 lib/temple/generators/erb.rb
brakeman-5.3.1 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
brakeman-5.3.0 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
brakeman-5.2.3 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
brakeman-5.2.2 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/erb.rb
brakeman-5.2.1 bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/erb.rb