hamlbars 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +129 -0
- data/lib/hamlbars/ext/closure.rb +43 -0
- data/lib/hamlbars/ext/compiler.rb +45 -0
- data/lib/hamlbars/ext/precompiler.rb +71 -0
- data/lib/hamlbars/ext/rails_helper.rb +38 -0
- data/lib/hamlbars/ext.rb +8 -0
- data/lib/hamlbars/template.rb +207 -0
- data/lib/hamlbars/version.rb +3 -0
- data/lib/hamlbars.rb +22 -0
- data/vendor/javascripts/handlebars.js +1610 -0
- data/vendor/javascripts/precompiler.js +33 -0
- metadata +171 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
// DOM
|
2
|
+
var Element = {}
|
3
|
+
Element.firstChild = function () { return Element };
|
4
|
+
Element.innerHTML = function () { return Element };
|
5
|
+
|
6
|
+
var document = { createRange: false, createElement: function() { return Element } };
|
7
|
+
var window = this;
|
8
|
+
this.document = document;
|
9
|
+
|
10
|
+
// Console
|
11
|
+
var console = window.console = {};
|
12
|
+
console.log = console.info = console.warn = console.error = function(){};
|
13
|
+
|
14
|
+
// jQuery
|
15
|
+
var jQuery = window.jQuery = function() { return jQuery };
|
16
|
+
jQuery.ready = function() { return jQuery };
|
17
|
+
jQuery.inArray = function() { return jQuery };
|
18
|
+
jQuery.jquery = "1.7";
|
19
|
+
var $ = jQuery;
|
20
|
+
|
21
|
+
// Precompiler
|
22
|
+
var Hamlbars = {
|
23
|
+
precompile: function(string) {
|
24
|
+
var ast = Handlebars.parse(string);
|
25
|
+
var options = { data: true, stringParams: true };
|
26
|
+
var environment = new Handlebars.Compiler().compile(ast, options);
|
27
|
+
var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
|
28
|
+
|
29
|
+
return templateSpec.toString();
|
30
|
+
}
|
31
|
+
};
|
32
|
+
|
33
|
+
|
metadata
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hamlbars
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- James Harton
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-04-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: haml
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: sprockets
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: tilt
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: execjs
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.2'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.2'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rake
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rspec
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: activesupport
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
description: Hamlbars allows you to write handlebars templates using the familiar
|
127
|
+
Haml syntax.
|
128
|
+
email:
|
129
|
+
- james@sociable.co.nz
|
130
|
+
executables: []
|
131
|
+
extensions: []
|
132
|
+
extra_rdoc_files: []
|
133
|
+
files:
|
134
|
+
- README.md
|
135
|
+
- History.md
|
136
|
+
- MIT-LICENSE
|
137
|
+
- lib/hamlbars/ext/closure.rb
|
138
|
+
- lib/hamlbars/ext/compiler.rb
|
139
|
+
- lib/hamlbars/ext/precompiler.rb
|
140
|
+
- lib/hamlbars/ext/rails_helper.rb
|
141
|
+
- lib/hamlbars/ext.rb
|
142
|
+
- lib/hamlbars/template.rb
|
143
|
+
- lib/hamlbars/version.rb
|
144
|
+
- lib/hamlbars.rb
|
145
|
+
- vendor/javascripts/handlebars.js
|
146
|
+
- vendor/javascripts/precompiler.js
|
147
|
+
homepage: https://github.com/jamesotron/hamlbars
|
148
|
+
licenses: []
|
149
|
+
post_install_message:
|
150
|
+
rdoc_options: []
|
151
|
+
require_paths:
|
152
|
+
- lib
|
153
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
|
+
none: false
|
161
|
+
requirements:
|
162
|
+
- - ! '>='
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
requirements: []
|
166
|
+
rubyforge_project:
|
167
|
+
rubygems_version: 1.8.19
|
168
|
+
signing_key:
|
169
|
+
specification_version: 3
|
170
|
+
summary: Extensions to Haml to allow creation of handlebars expressions.
|
171
|
+
test_files: []
|