hmote 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/hmote.rb +1 -1
- data/lib/hmote/version.rb +1 -1
- data/test/parsing_test.rb +2 -2
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffbdcc2bd38e5cafe31aee54f8d72541d693dccd
|
4
|
+
data.tar.gz: b0633bf8b9ac9e0e85ac6296ae125ac9051de17d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90c158105f3594f8f6f2edb958a5c8a77969f28d7cfae470e80e0e4e04bb2da2b8056ce71a08b9286e2dcfd65e6ebe8793e83baac4c0ec3cfa47069e4726478f
|
7
|
+
data.tar.gz: adccb100a8b96363e08253a7c491e8ea3bb8dcca754cd5e8c2c3aa0b09c3131471e5aa4d0419637c34b2e3e907968a2412b5fb17fbcc0e217eab51a9b2b728b6
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
hmote
|
1
|
+
HMote [![Build Status](https://travis-ci.org/frodsan/hmote.svg)](https://travis-ci.org/frodsan/hmote)
|
2
2
|
=====
|
3
3
|
|
4
4
|
Minimal template engine with default escaping.
|
@@ -6,7 +6,7 @@ Minimal template engine with default escaping.
|
|
6
6
|
Description
|
7
7
|
-----------
|
8
8
|
|
9
|
-
|
9
|
+
HMote is a fork of [Mote][mote] that uses [Hache][hache]
|
10
10
|
to auto-escape HTML special characters.
|
11
11
|
|
12
12
|
Installation
|
@@ -43,7 +43,7 @@ template.call
|
|
43
43
|
# => "your template goes here!"
|
44
44
|
```
|
45
45
|
|
46
|
-
|
46
|
+
HMote recognizes three tags to evaluate Ruby code: `%`, `{{}}` and `<? ?>`.
|
47
47
|
The difference between them is that while the `%` and `<? ?>` tags only
|
48
48
|
evaluate the code, the `{{}}` tag also prints the result to the template.
|
49
49
|
|
@@ -174,7 +174,7 @@ For bug reports and pull requests use [GitHub][issues].
|
|
174
174
|
License
|
175
175
|
-------
|
176
176
|
|
177
|
-
|
177
|
+
HMote is released under the [MIT License][mit].
|
178
178
|
|
179
179
|
[mit]: http://www.opensource.org/licenses/MIT
|
180
180
|
[mote]: https://github.com/soveran/mote
|
data/lib/hmote.rb
CHANGED
@@ -34,7 +34,7 @@ class HMote
|
|
34
34
|
terms = template.split(PATTERN)
|
35
35
|
parts = "Proc.new do |params, __o|\n params ||= {}; __o ||= ''\n".dup
|
36
36
|
|
37
|
-
vars.each { |var| parts <<
|
37
|
+
vars.each { |var| parts << sprintf("%s = params[%p]\n", var, var) }
|
38
38
|
|
39
39
|
while (term = terms.shift)
|
40
40
|
parts << parse_expression(terms, term)
|
data/lib/hmote/version.rb
CHANGED
data/test/parsing_test.rb
CHANGED
@@ -96,11 +96,11 @@ class ParsingTest < Minitest::Test
|
|
96
96
|
end
|
97
97
|
|
98
98
|
test "escapes by default" do
|
99
|
-
text = %q(<>&"'
|
99
|
+
text = %q(<>&"')
|
100
100
|
template = HMote.parse("{{ params[:text] }}")
|
101
101
|
result = template.call(text: text)
|
102
102
|
|
103
|
-
assert_equal("<>&
|
103
|
+
assert_equal("<>&'"", result)
|
104
104
|
end
|
105
105
|
|
106
106
|
test "no escaping please" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hmote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Francesco
|
7
|
+
- Francesco Rodriguez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hache
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '11.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '11.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubocop
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.39'
|
83
83
|
description: A minimum operational template that escapes HTML tags by default
|
84
|
-
email: frodsan@
|
84
|
+
email: frodsan@protonmail.com
|
85
85
|
executables: []
|
86
86
|
extensions: []
|
87
87
|
extra_rdoc_files: []
|