sliq 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sliq.rb +15 -7
- data/lib/sliq/version.rb +1 -1
- data/sliq.gemspec +2 -2
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faa546c3a75c8771be2888d06837271c1e78351f
|
4
|
+
data.tar.gz: f316ed4112d3b2c2228e4d6d5e0893d5f444cb78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56eb8d1714545422e2aaa60f2037aedd01ccae3645fe574f002ddfb40674422d4a5a851383ed20e5b1116211947b75f363b7a2fc61951de71114c9d4a1221cfc
|
7
|
+
data.tar.gz: 4fef2069c0f4791a276c676bd8ee98857bdbb8947a70a35d94eaad36954f3ddad254b8e4d348ca982b32ec69bcddfb8559dcd3f13b0b418f265c5244ff087229
|
data/lib/sliq.rb
CHANGED
@@ -4,7 +4,7 @@ require 'tilt/liquid'
|
|
4
4
|
|
5
5
|
module Sliq
|
6
6
|
class Parser < Slim::Parser
|
7
|
-
|
7
|
+
define_options attr_list_delims: {
|
8
8
|
'(' => ')',
|
9
9
|
'[' => ']'
|
10
10
|
}
|
@@ -56,11 +56,19 @@ module Sliq
|
|
56
56
|
block = [:multi]
|
57
57
|
begin
|
58
58
|
case string
|
59
|
-
when /\A\{/
|
60
|
-
|
61
|
-
block << [:
|
62
|
-
|
63
|
-
|
59
|
+
when /\A\\{\{/
|
60
|
+
# Escaped interpolation
|
61
|
+
block << [:static, '{{']
|
62
|
+
string = $'
|
63
|
+
when /\A\{{2}((?>[^{}]|(\{{2}(?>[^{}]|\g<1>)*\}{2}))*)\}{2}/
|
64
|
+
# Interpolation
|
65
|
+
string, code = $', $1
|
66
|
+
escape = code !~ /\A\{.*\}\Z/
|
67
|
+
block << [:slim, :output, escape, escape ? code : code[1..-2], [:multi]]
|
68
|
+
# TODO: make reg exp for liquid static text
|
69
|
+
when /\A([#\\]?[^#\\]*([#\\][^\\#\{][^#\\]*)*)/
|
70
|
+
# Static text
|
71
|
+
block << [:static, $&]
|
64
72
|
string = $'
|
65
73
|
end
|
66
74
|
end until string.empty?
|
@@ -69,7 +77,7 @@ module Sliq
|
|
69
77
|
end
|
70
78
|
|
71
79
|
class Engine < Slim::Engine
|
72
|
-
replace Slim::Parser, Parser,
|
80
|
+
replace Slim::Parser, Parser, Parser.options
|
73
81
|
before Slim::Interpolation, Interpolation
|
74
82
|
after Parser, Tags
|
75
83
|
end
|
data/lib/sliq/version.rb
CHANGED
data/sliq.gemspec
CHANGED
@@ -18,6 +18,6 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = %w(lib)
|
20
20
|
|
21
|
-
s.add_runtime_dependency('slim', ['~>
|
22
|
-
s.add_runtime_dependency('liquid', ['~>
|
21
|
+
s.add_runtime_dependency('slim', ['~> 3.0'])
|
22
|
+
s.add_runtime_dependency('liquid', ['~> 3.0'])
|
23
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sliq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Mendler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slim
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '3.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: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: liquid
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '3.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '3.0'
|
41
41
|
description: Process template with Slim and Liquid afterwards.
|
42
42
|
email:
|
43
43
|
- mail@daniel-mendler.de
|
@@ -71,9 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
73
|
rubyforge_project: sliq
|
74
|
-
rubygems_version: 2.
|
74
|
+
rubygems_version: 2.5.1
|
75
75
|
signing_key:
|
76
76
|
specification_version: 4
|
77
77
|
summary: Slim and Liquid working together.
|
78
78
|
test_files: []
|
79
|
-
has_rdoc:
|