Sha256: 876cfc37e09b61fd0f80be2830ae7afcdf53b7658793a7205dea8bbd5e29cf34

Contents?: true

Size: 1.72 KB

Versions: 252

Compression:

Stored size: 1.72 KB

Contents

##
## $Release: 2.7.0 $
## copyright(c) 2006-2011 kuwata-lab.com all rights reserved.
##

require 'erubis/util'

module Erubis


  ##
  ## code generator, called by Converter module
  ##
  module Generator

    def self.supported_properties()  # :nodoc:
      return [
              [:escapefunc,    nil,    "escape function name"],
            ]
    end

    attr_accessor :escapefunc

    def init_generator(properties={})
      @escapefunc = properties[:escapefunc]
    end


    ## (abstract) escape text string
    ##
    ## ex.
    ##   def escape_text(text)
    ##     return text.dump
    ##     # or return "'" + text.gsub(/['\\]/, '\\\\\&') + "'"
    ##   end
    def escape_text(text)
      not_implemented
    end

    ## return escaped expression code (ex. 'h(...)' or 'htmlspecialchars(...)')
    def escaped_expr(code)
      code.strip!
      return "#{@escapefunc}(#{code})"
    end

    ## (abstract) add @preamble to src
    def add_preamble(src)
      not_implemented
    end

    ## (abstract) add text string to src
    def add_text(src, text)
      not_implemented
    end

    ## (abstract) add statement code to src
    def add_stmt(src, code)
      not_implemented
    end

    ## (abstract) add expression literal code to src. this is called by add_expr().
    def add_expr_literal(src, code)
      not_implemented
    end

    ## (abstract) add escaped expression code to src. this is called by add_expr().
    def add_expr_escaped(src, code)
      not_implemented
    end

    ## (abstract) add expression code to src for debug. this is called by add_expr().
    def add_expr_debug(src, code)
      not_implemented
    end

    ## (abstract) add @postamble to src
    def add_postamble(src)
      not_implemented
    end


  end


end

Version data entries

252 entries across 212 versions & 42 rubygems

Version Path
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/erubis-2.7.0/lib/erubis/generator.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/erubis-2.7.0/lib/erubis/generator.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/erubis-2.7.0/lib/erubis/generator.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/erubis-2.7.0/lib/erubis/generator.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/brakeman-4.6.1/bundle/ruby/2.6.0/gems/erubis-2.7.0/lib/erubis/generator.rb
brakeman-4.6.1 bundle/ruby/2.6.0/gems/erubis-2.7.0/lib/erubis/generator.rb
brakeman-4.6.0 bundle/ruby/2.6.0/gems/erubis-2.7.0/lib/erubis/generator.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/brakeman-4.5.1/bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
brakeman-4.5.1 bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
brakeman-4.5.0 bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/erubis-2.7.0/lib/erubis/generator.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
brakeman-4.4.0 bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/erubis-2.7.0/lib/erubis/generator.rb