hmote 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19990b7d9d7fe577bc7dc27b2557f6ec928d5620
4
- data.tar.gz: 81433bcbf7ddc6068bd41a75ec4e1df0c69a9833
3
+ metadata.gz: 574d79f437faf44b5337ddfdb727ed3ab7097404
4
+ data.tar.gz: b3f511a6f9913a4f62e66a8d673b9a72ec74a597
5
5
  SHA512:
6
- metadata.gz: 67dc3c6016d0f8d3a94bb644f04cf8c1badec0347c70304e8cd3ac4f099f707ee6d5e5a6e3d5a22cb3a9d861096af80a2482487c3ca0a57c3e0cb774149228be
7
- data.tar.gz: aa7a8f852a4d7220a273ef42f3924cea6155cccf1d834858c82de74cf04e63f126427de0345a415cc471f32b5ae5f665f28be9c9a553fdde8cb3bba2288256b7
6
+ metadata.gz: 7c7b07826c01235d9100c64a1ca0faf8edbdfcb938809ad69168d75b1dab2dbd7c74b88a6e09fe5f507ec4f36092d573829a0c8fdd7aec2a0eccd3b65ee445aa
7
+ data.tar.gz: 7eb8fc99e77be61ce15089e2c9b870167406dd38ee05bd694a79bb248327034bd36294c3e93b2eaca92dbccf3a73f41f3b2418a74eb8cee790a7a44bbe9fa881
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- HMote [![Build Status](https://travis-ci.org/frodsan/hmote.svg)](https://travis-ci.org/frodsan/hmote)
1
+ hmote [![Build Status](https://gitlab.com/frodsan/hmote/badges/master/build.svg)](https://gitlab.com/frodsan/hmote/builds)
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
- HMote is a fork of [Mote][mote] that uses [Hache][hache]
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,13 +43,13 @@ template.call
43
43
  # => "your template goes here!"
44
44
  ```
45
45
 
46
- HMote recognizes three tags to evaluate Ruby code: `%`, `{{}}` and `<? ?>`.
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
 
50
50
  Imagine that your template looks like this:
51
51
 
52
- ```ruby
52
+ ```
53
53
  % # single-line code
54
54
  % gems = ["rack", "cuba", "hmote"]
55
55
 
@@ -98,7 +98,7 @@ template.call(name: "Ruby")
98
98
  Auto-escaping
99
99
  -------------
100
100
 
101
- By default, HMote escapes HTML special characters to prevent [XSS][xss]
101
+ By default, hmote escapes HTML special characters to prevent [XSS][xss]
102
102
  attacks. You can start the expression with an exclamation mark to disable
103
103
  escaping for that expression:
104
104
 
@@ -151,7 +151,7 @@ hmote("foo.mote", a: 1, b: 2)
151
151
  Related projects:
152
152
  -----------------
153
153
 
154
- - [hmote-render][hmote-render]: HMote plugin for Cuba.
154
+ - [hmote-render][hmote-render]: hmote plugin for Cuba.
155
155
 
156
156
  Contributing
157
157
  ------------
@@ -159,7 +159,7 @@ Contributing
159
159
  Fork the project with:
160
160
 
161
161
  ```
162
- $ git clone git@github.com:frodsan/hmote.git
162
+ $ git clone git@gitlab.com:frodsan/hmote.git
163
163
  ```
164
164
 
165
165
  To install dependencies, use:
@@ -174,16 +174,16 @@ To run the test suite, do:
174
174
  $ rake test
175
175
  ```
176
176
 
177
- For bug reports and pull requests use [GitHub][issues].
177
+ For bug reports and pull requests use [GitLab][issues].
178
178
 
179
179
  License
180
180
  -------
181
181
 
182
- HMote is released under the [MIT License][mit].
182
+ hmote is released under the [MIT License][mit].
183
183
 
184
184
  [mit]: http://www.opensource.org/licenses/MIT
185
185
  [mote]: https://github.com/soveran/mote
186
- [hache]: https://github.com/harmoni/hache
186
+ [hache]: https://gitlab.com/frodsan/hache
187
187
  [hmote-render]: https://github.com/harmoni/hmote-render
188
- [issues]: https://github.com/frodsan/hmote/issues
188
+ [issues]: https://gitlab.com/frodsan/hmote/issues
189
189
  [xss]: http://en.wikipedia.org/wiki/Cross-Site_Scripting
data/lib/hmote.rb CHANGED
@@ -47,11 +47,11 @@ class HMote
47
47
 
48
48
  def self.parse_expression(terms, term)
49
49
  case term
50
- when "<?" then terms.shift + "\n"
51
- when "%" then terms.shift + "\n"
52
- when "{{" then "__o << Hache.h((" + terms.shift + ").to_s)\n"
53
- when "{{!" then "__o << (" + terms.shift + ").to_s\n"
54
- else "__o << " + term.dump + "\n"
50
+ when "<?" then terms.shift + "\n"
51
+ when "%" then terms.shift + "\n"
52
+ when "{{" then "__o << Hache.h((" + terms.shift + ").to_s)\n"
53
+ when "{{!" then "__o << (" + terms.shift + ").to_s\n"
54
+ else "__o << " + term.dump + "\n"
55
55
  end
56
56
  end
57
57
 
data/lib/hmote/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class HMote
2
- VERSION = "1.5.0"
4
+ VERSION = "1.5.1"
3
5
  end
data/test/helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/setup"
2
4
  require "minitest/autorun"
3
5
  require "minitest/pride"
data/test/helpers_test.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "helper"
2
4
 
3
5
  class HelpersTest < Minitest::Test
data/test/parsing_test.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "helper"
2
4
 
3
5
  class ParsingTest < Minitest::Test
@@ -8,7 +10,7 @@ class ParsingTest < Minitest::Test
8
10
  end
9
11
 
10
12
  test "control flow" do
11
- template = (<<-EOT).gsub(/ {4}/, "")
13
+ template = <<-EOT.gsub(/ {4}/, "")
12
14
  % if false
13
15
  false
14
16
  % else
@@ -22,7 +24,7 @@ class ParsingTest < Minitest::Test
22
24
  end
23
25
 
24
26
  test "parameters" do
25
- template = (<<-EOT).gsub(/ {4}/, "")
27
+ template = <<-EOT.gsub(/ {4}/, "")
26
28
  % params[:n].times do
27
29
  *
28
30
  % end
@@ -46,7 +48,10 @@ class ParsingTest < Minitest::Test
46
48
 
47
49
  test "context" do
48
50
  context = Object.new
49
- def context.user; "Bruno"; end
51
+
52
+ def context.user
53
+ "Bruno"
54
+ end
50
55
 
51
56
  example = HMote.parse("{{ user }}", context)
52
57
 
@@ -66,7 +71,7 @@ class ParsingTest < Minitest::Test
66
71
  end
67
72
 
68
73
  test "multi-line XML-style directives" do
69
- template = (<<-EOT).gsub(/^ /, "")
74
+ template = <<-EOT.gsub(/^ /, "")
70
75
  <?
71
76
  # Multiline code evaluation
72
77
  lucky = [1, 3, 7, 9, 13, 15]
@@ -81,7 +86,7 @@ class ParsingTest < Minitest::Test
81
86
  end
82
87
 
83
88
  test "preserve XML directives" do
84
- template = (<<-EOT).gsub(/^ /, "")
89
+ template = <<-EOT.gsub(/^ /, "")
85
90
  <?xml "hello" ?>
86
91
  EOT
87
92
 
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.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Rodríguez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-22 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hache
@@ -66,8 +66,22 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.39'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.39'
69
83
  description: A minimum operational template that escapes HTML tags by default
70
- email: frodsan@protonmail.ch
84
+ email: frodsan@hello.com
71
85
  executables: []
72
86
  extensions: []
73
87
  extra_rdoc_files: []
@@ -79,7 +93,7 @@ files:
79
93
  - test/helper.rb
80
94
  - test/helpers_test.rb
81
95
  - test/parsing_test.rb
82
- homepage: https://github.com/frodsan/hmote
96
+ homepage: https://gitlab.com/frodsan/hmote
83
97
  licenses:
84
98
  - MIT
85
99
  metadata: {}