Sha256: 3ad81ac2949f238aec076d5a5d0a2d7109f07064eee5df095dc40ff5add97f77

Contents?: true

Size: 419 Bytes

Versions: 4

Compression:

Stored size: 419 Bytes

Contents

# encoding: utf-8

require "pupu/parser"

module Pupu
  module Helpers
    # Use it in your layout
    # Example: pupu :autocompleter, type: "local"
    def pupu(name, params = Hash.new)
      comment = if params.empty? then "<!-- Pupu #{name} without params -->"
      else "<!-- Pupu #{name} with params #{params.inspect} -->" end
      [comment, Parser.new(name, params).parse!, "", ""].join("\n")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pupu-0.0.5.2 lib/pupu/helpers.rb
pupu-0.0.5.1 lib/pupu/helpers.rb
pupu-0.0.5 lib/pupu/helpers.rb
pupu-0.0.4.pre lib/pupu/helpers.rb