temple 0.8.0 → 0.8.2

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: 524637aaba62c678fcfe02760bb49ec94a2073c3
4
- data.tar.gz: a342126edf52f3e3578c4cc9f70540aed6b32b84
3
+ metadata.gz: 95a7b68d7ea63e7673e183765ce0a64838ee4bdb
4
+ data.tar.gz: 00e2072a5e6577a07a754bfe9c39bee365e87ebb
5
5
  SHA512:
6
- metadata.gz: 1bbc62f26373b9fb48c57cad57672ef3c379af1b991ba2538f3d7b699f6f0c22b19199520849869463349af07b810946a52029c345e7ec532aa81fb8b893d1e8
7
- data.tar.gz: 98da558eb0435b349b4c5ee44c407c92c07ee7eba8d08619d8a5158e447c423e16693707a052077ac4822aea810b1784f7fa0cc446fcf2648267b17dced0f421
6
+ metadata.gz: 8a685000159a7f3e0ba41c4d7a6f8e7b8167755d020f05725020ce64dd2526aa19cf5007f78e071b9dd9521787756fee24cf30edc224cce701b6596020858dfc
7
+ data.tar.gz: 71f2c6edfe191aa6ff7b90a245e2dbe8139fa03181a3d787236924b385c17a898dcad47a89e263cc2598769caf9b2767bdf32e6fcb4cac1d8d5421b1b8cf0562
data/CHANGES CHANGED
@@ -1,3 +1,14 @@
1
+ 0.8.2
2
+
3
+ * Support TruffleRuby in Temple::Filters::StaticAnalyzer (#127)
4
+ * Support TruffleRuby in Temple::Filters::StringSplitter (#127)
5
+
6
+ 0.8.1
7
+
8
+ * Stop relying on deprecated method in Rails (#121)
9
+ * Fix issue with --enable-frozen-string-literal
10
+ * Escape html in markdown
11
+
1
12
  0.8.0
2
13
 
3
14
  * Add Temple::StaticAnalyzer to analyze Ruby expressions
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. <br/> <img/>). The tag is also closed if the content Sexp is empty
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
- [![Build Status](https://secure.travis-ci.org/judofyr/temple.png?branch=master)](http://travis-ci.org/judofyr/temple) [![Dependency Status](https://gemnasium.com/judofyr/temple.png?travis)](https://gemnasium.com/judofyr/temple) [![Code Climate](https://codeclimate.com/github/judofyr/temple.png)](https://codeclimate.com/github/judofyr/temple)
4
+ [![Build Status](https://secure.travis-ci.org/judofyr/temple.svg?branch=master)](http://travis-ci.org/judofyr/temple) [![Code Climate](https://codeclimate.com/github/judofyr/temple.svg)](https://codeclimate.com/github/judofyr/temple) [![Gem Version](https://badge.fury.io/rb/temple.svg)](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
@@ -7,7 +7,7 @@ module Temple
7
7
  module Filters
8
8
  # Compile [:dynamic, "foo#{bar}"] to [:multi, [:static, 'foo'], [:dynamic, 'bar']]
9
9
  class StringSplitter < Filter
10
- if defined?(Ripper) && RUBY_VERSION >= "2.0.0"
10
+ if defined?(Ripper) && RUBY_VERSION >= "2.0.0" && Ripper.respond_to?(:lex)
11
11
  class << self
12
12
  # `code` param must be valid string literal
13
13
  def compile(code)
@@ -90,7 +90,8 @@ module Temple
90
90
  raise 'Invalid dispatcher node' unless method
91
91
  call_method
92
92
  else
93
- code = "case(exp[#{level}])\n"
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
@@ -30,7 +30,7 @@ module Temple
30
30
 
31
31
  class << self
32
32
  def available?
33
- defined?(Ripper)
33
+ defined?(Ripper) && Ripper.respond_to?(:lex)
34
34
  end
35
35
 
36
36
  def static?(code)
@@ -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?
@@ -1,3 +1,3 @@
1
1
  module Temple
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.2'
3
3
  end
@@ -3,7 +3,7 @@ require 'helper'
3
3
  describe Temple::StaticAnalyzer do
4
4
  describe '.available?' do
5
5
  it 'should return true if its dependency is available' do
6
- Temple::StaticAnalyzer.available?.should.equal(defined?(Ripper))
6
+ Temple::StaticAnalyzer.available?.should.equal(defined?(Ripper) && Ripper.respond_to?(:lex))
7
7
  end
8
8
  end
9
9
 
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.0
4
+ version: 0.8.2
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: 2017-02-12 00:00:00.000000000 Z
12
+ date: 2019-09-12 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.8
181
+ rubygems_version: 2.6.11
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: Template compilation framework in Ruby