temple 0.8.0 → 0.8.1
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/CHANGES +6 -0
- data/EXPRESSIONS.md +1 -1
- data/README.md +1 -1
- data/lib/temple/mixins/dispatcher.rb +2 -1
- data/lib/temple/templates/rails.rb +2 -2
- data/lib/temple/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55957f55fcf577f188ba54ba8c9851344a41a652
|
4
|
+
data.tar.gz: 70d128d51b774affc4be599f00e272628e062f03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 678eaaf1c3a7632cb38421a41c94d3e2c91c718233a261b3ac69d342e74b2b2987ae7b05033e3a69b212904c49ab6de3f00861129ec732a927ed30ea4915c08f
|
7
|
+
data.tar.gz: ddec9236857f4f70d7044d7b03579647d803377da3fd4b90606c82f97aeea248708fe4fbb6f5a360ac109bd0d774e82808f888e72d72ba9963b8ddd001886acf
|
data/CHANGES
CHANGED
data/EXPRESSIONS.md
CHANGED
@@ -220,7 +220,7 @@ generates:
|
|
220
220
|
### [:html, :tag, identifier, attributes, optional-sexp]
|
221
221
|
|
222
222
|
HTML tag abstraction. Identifier can be a String or a Symbol. If the optional content Sexp is omitted
|
223
|
-
the tag is closed (e.g.
|
223
|
+
the tag is closed (e.g. `<br/>` `<img/>`). The tag is also closed if the content Sexp is empty
|
224
224
|
(consists only of :multi and :newline expressions) and the tag is registered as auto-closing.
|
225
225
|
|
226
226
|
Example:
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Temple
|
2
2
|
======
|
3
3
|
|
4
|
-
[](http://travis-ci.org/judofyr/temple) [](https://gemnasium.com/judofyr/temple) [](https://codeclimate.com/github/judofyr/temple) [](https://rubygems.org/gems/temple)
|
5
5
|
|
6
6
|
Temple is an abstraction and a framework for compiling templates to pure Ruby.
|
7
7
|
It's all about making it easier to experiment, implement and optimize template
|
@@ -90,7 +90,8 @@ module Temple
|
|
90
90
|
raise 'Invalid dispatcher node' unless method
|
91
91
|
call_method
|
92
92
|
else
|
93
|
-
code =
|
93
|
+
code = String.new
|
94
|
+
code << "case(exp[#{level}])\n"
|
94
95
|
each do |key, child|
|
95
96
|
code << "when #{key.inspect}\n " <<
|
96
97
|
child.compile(level + 1, call_method).gsub("\n".freeze, "\n ".freeze) << "\n".freeze
|
@@ -3,9 +3,9 @@ module Temple
|
|
3
3
|
class Rails
|
4
4
|
extend Mixins::Template
|
5
5
|
|
6
|
-
def call(template)
|
6
|
+
def call(template, source = nil)
|
7
7
|
opts = {}.update(self.class.options).update(file: template.identifier)
|
8
|
-
self.class.compile(template.source, opts)
|
8
|
+
self.class.compile((source || template.source), opts)
|
9
9
|
end
|
10
10
|
|
11
11
|
def supports_streaming?
|
data/lib/temple/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: temple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Magnus Holm
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-03-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: tilt
|
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
178
|
version: '0'
|
179
179
|
requirements: []
|
180
180
|
rubyforge_project:
|
181
|
-
rubygems_version: 2.6.
|
181
|
+
rubygems_version: 2.6.11
|
182
182
|
signing_key:
|
183
183
|
specification_version: 4
|
184
184
|
summary: Template compilation framework in Ruby
|