hmote 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/hmote.gemspec +2 -2
- data/lib/hmote/render.rb +1 -0
- data/lib/hmote.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 944f108a4471141ffe3b7265b6d7f2895443259c
|
4
|
+
data.tar.gz: 92d6d888dadad1e50ac3f471bb020c20e24937c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b7d2b3e3b1dabc260e22c1214da5f45499e45f05674ace3ca4c29d156293733a78f12399527eb1046966b1999e3001cc5c2ece01410246cb5c531cb9480a233
|
7
|
+
data.tar.gz: ae500aa801dfd837eee00e82c8a1ffee987b1977081255aafcf1113e69d52e7f96452d480f97c88fe82939632b00252533eb86eb97b957d5d66356696abee8b0
|
data/README.md
CHANGED
@@ -3,6 +3,12 @@ hmote
|
|
3
3
|
|
4
4
|
Minimal template engine with default escaping.
|
5
5
|
|
6
|
+
Description
|
7
|
+
-----------
|
8
|
+
|
9
|
+
HMote is based on [Mote][mote] and uses [Hache][hache]
|
10
|
+
to auto-escape HTML special characters.
|
11
|
+
|
6
12
|
Basic Usage
|
7
13
|
-----------
|
8
14
|
|
@@ -206,4 +212,6 @@ $ gem install hmote
|
|
206
212
|
```
|
207
213
|
|
208
214
|
[cuba]: http://cuba.is
|
215
|
+
[mote]: https://github.com/soveran/mote
|
216
|
+
[hache]: https://github.com/frodsan/hache
|
209
217
|
[xss]: http://en.wikipedia.org/wiki/Cross-Site_Scripting
|
data/hmote.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "hmote"
|
3
|
-
s.version = "1.
|
3
|
+
s.version = "1.2.0"
|
4
4
|
s.summary = "A minimum operational template that escapes HTML tags by default."
|
5
5
|
s.description = s.summary
|
6
6
|
s.authors = ["Francesco Rodríguez", "Mayn Kjær"]
|
7
7
|
s.email = ["frodsan@me.com", "mayn.kjaer@gmail.com"]
|
8
|
-
s.homepage = "https://github.com/harmoni
|
8
|
+
s.homepage = "https://github.com/harmoni/hmote"
|
9
9
|
s.license = "MIT"
|
10
10
|
|
11
11
|
s.files = `git ls-files`.split("\n")
|
data/lib/hmote/render.rb
CHANGED
data/lib/hmote.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
require "hache"
|
2
2
|
|
3
3
|
class HMote
|
4
|
-
PATTERN = /^(\n)| #
|
5
|
-
^\s*(%)\s*(.*?)(?:\n|\Z)| # % code
|
4
|
+
PATTERN = /^(\n)| # newlines.
|
5
|
+
^\s*(%)\s*(.*?)(?:\n|\Z)| # % single-line code
|
6
6
|
(<\?)\s+(.*?)\s+\?>| # <? multi-line code ?>
|
7
|
-
(\{\{!?)(.*?)\}\} # {{
|
7
|
+
(\{\{!?)(.*?)\}\} # {{ escape }} or {{! unescape }}
|
8
8
|
/mx
|
9
9
|
|
10
10
|
def self.parse(template, context = self, vars = [])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hmote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francesco Rodríguez
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hache
|
@@ -72,7 +72,7 @@ files:
|
|
72
72
|
- test/views/context.mote
|
73
73
|
- test/views/home.mote
|
74
74
|
- test/views/layout.mote
|
75
|
-
homepage: https://github.com/harmoni
|
75
|
+
homepage: https://github.com/harmoni/hmote
|
76
76
|
licenses:
|
77
77
|
- MIT
|
78
78
|
metadata: {}
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.4.5
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: A minimum operational template that escapes HTML tags by default.
|