🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

emblem2hbs

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emblem2hbs - npm Package Compare versions

Comparing version
1.0.1
to
1.0.2
+14
CHANGELOG.md
## Version 1.0.2 - January 22, 2015
* Bugfix: support all the value types in pairs as well as params
* Fixes to the test suite to close over the looped examples
## Version 1.0.1 - January 14, 2015
* Test suite based on Emblem's example docs
* Support for more of the param types that Emblem emits
* Officially support node.js 0.8.x and 0.11.x
## Version 1.0.0 - January 14, 2015
* Initial public release.
+10
-10

@@ -12,2 +12,10 @@ fs = require("fs")

result = emblem.parse(input)
handlebarsStringForValue = (value) ->
switch value.type
when "STRING" then "\"#{value.string}\""
when "ID" then value.original
when "BOOLEAN" then value.bool
when "INTEGER" then value.integer
else throw new Error("Unsupported value type: #{value.type}")

@@ -18,4 +26,3 @@ pairsToAttrString = (pairs) ->

key = arr[0]
value = arr[1].string
value = "\"#{value}\"" if arr[1].type == "STRING"
value = handlebarsStringForValue(arr[1])

@@ -27,10 +34,3 @@ "#{key}=#{value}"

return '' unless params? && params.length > 0
' ' + _(params).map((p) ->
switch p.type
when "STRING" then "\"#{p.string}\""
when "ID" then p.original
when "BOOLEAN" then p.bool
when "INTEGER" then p.integer
else throw new Error("Unsupported param type: #{p.type}")
).join(' ')
' ' + _(params).map((p) -> handlebarsStringForValue(p)).join(' ')

@@ -37,0 +37,0 @@ processStatements = (statements) ->

{
"name": "emblem2hbs",
"description": "Convert emblem templates to Handlebars",
"version": "1.0.1",
"version": "1.0.2",
"homepage": "http://www.emblemjs.com/",

@@ -6,0 +6,0 @@ "keywords": [

@@ -19,2 +19,3 @@ chai = require("chai")

['a{bind-attr class="isActive"}{action \'toggleHeader\'} x', '<a {{bind-attr class="isActive"}} {{action "toggleHeader"}}>x</a>']
['App.MyTextArea objectBinding="view.answer" hideFieldName=true rows=20 cols=40', '{{view App.MyTextArea objectBinding="view.answer" hideFieldName=true rows=20 cols=40}}']
]

@@ -44,4 +45,6 @@

for group_name, example_group of examples
for example in example_group
it "should process the #{group_name} example '#{example}' correctly", ->
assert.equal(Processor.process(example[0]), example[1])
do (group_name, example_group) ->
for example in example_group
do (group_name, example) ->
it "should process the #{group_name} example '#{example}' correctly", ->
assert.equal(Processor.process(example[0]), example[1])