Module: Emblem

Defined in:
lib/emblem.rb,
lib/emblem/version.rb

Defined Under Namespace

Classes: EmblemTemplate

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.compile(script, options = {}) ⇒ Object

Compile a Emblem file to JavaScript or generate the source maps.

Parameters:

  • the (String, #read)

    source string or IO

  • options (Hash) (defaults to: {})

    the compiler options

Options Hash (options):

  • format (String)

    the output format, either ‘:map` or `:js`



28
29
30
31
32
# File 'lib/emblem.rb', line 28

def compile(script, options = {})
  script = script.read if script.respond_to?(:read)
  templateName = options[:templateName] || "template"
  Open3.capture3("emblem -i #{templateName}", :stdin_data=>script)[0]
end

.engineObject



11
12
# File 'lib/emblem.rb', line 11

def engine
end

.engine=(engine) ⇒ Object



14
15
# File 'lib/emblem.rb', line 14

def engine=(engine)
end

.versionObject



17
18
19
# File 'lib/emblem.rb', line 17

def version
  `emblem -v`
end