opulent 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opulent/compiler/define.rb +10 -4
- data/lib/opulent/parser/root.rb +1 -0
- data/lib/opulent/parser/text.rb +2 -2
- data/lib/opulent/tokens.rb +3 -3
- data/lib/opulent/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6daf567113902547514da9b31c194ca45587239
|
4
|
+
data.tar.gz: 21ed11e388a2cdf395adadc22b22599ff034c30d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa4b1110a6588609be2b67b1cbeffd7331cade6abcacac05935fbddf5aa7996fed7b115f5da47b3c7e501e2a05b31f303445ac0e9b401f996a033ee914a26775
|
7
|
+
data.tar.gz: 57a2e9efab145024e4b7ff18109d2a244e15ab3677b679ed4937e68caa2db9b66effc68faed0e667e4c7d8e564a5989aef10cb8c1f9600751f56bc918c5e5325
|
@@ -32,7 +32,9 @@ module Opulent
|
|
32
32
|
# by generating the required attribute code
|
33
33
|
attributes = {}
|
34
34
|
call_node[@options][:attributes].each do |key, attribute|
|
35
|
-
|
35
|
+
unless node[@options][:parameters].has_key? key
|
36
|
+
attributes[key] = map_attribute key, attribute, context
|
37
|
+
end
|
36
38
|
end
|
37
39
|
|
38
40
|
# Go through each extension attribute and use the value where applicable
|
@@ -43,10 +45,14 @@ module Opulent
|
|
43
45
|
|
44
46
|
# Extract values which appear as definition parameters. If we have the
|
45
47
|
# key passed as argument, get its value. Otherwise, set the default
|
46
|
-
# parameter value
|
48
|
+
# parameter value.
|
49
|
+
#
|
50
|
+
# Definition arguments (parameters which are set in definition header)
|
51
|
+
# will be passed unescaped, to allow node definition to handle escaping
|
52
|
+
# properly
|
47
53
|
node[@options][:parameters].each do |key, value|
|
48
|
-
if attributes
|
49
|
-
arguments[key] =
|
54
|
+
if call_node[@options][:attributes].has_key? key
|
55
|
+
arguments[key] = context.evaluate call_node[@options][:attributes][key][@value]
|
50
56
|
else
|
51
57
|
arguments[key] = definition_context.evaluate value[@value]
|
52
58
|
end
|
data/lib/opulent/parser/root.rb
CHANGED
data/lib/opulent/parser/text.rb
CHANGED
@@ -56,9 +56,9 @@ module Opulent
|
|
56
56
|
# Match one line or multiline, escaped or unescaped text
|
57
57
|
#
|
58
58
|
def html_text(parent, indent)
|
59
|
-
if (text_feed =
|
59
|
+
if (text_feed = accept :html_text)
|
60
60
|
text_node = [:plain, :text, {value: text_feed.strip, escaped: false}, nil, indent]
|
61
|
-
|
61
|
+
|
62
62
|
parent[@children] << text_node
|
63
63
|
end
|
64
64
|
end
|
data/lib/opulent/tokens.rb
CHANGED
@@ -8,7 +8,7 @@ module Opulent
|
|
8
8
|
#
|
9
9
|
@@tokens = {
|
10
10
|
# Indentation
|
11
|
-
indent: /\A
|
11
|
+
indent: /\A\s*/,
|
12
12
|
|
13
13
|
# Node
|
14
14
|
node: /\A\w+(\-\w+)*/,
|
@@ -65,7 +65,7 @@ module Opulent
|
|
65
65
|
multiline: /\A(\|)/,
|
66
66
|
|
67
67
|
# HTML Text
|
68
|
-
html_text: /\A
|
68
|
+
html_text: /\A\<.+\>.*/,
|
69
69
|
|
70
70
|
# Yield
|
71
71
|
yield: /\A(yield)/,
|
@@ -125,7 +125,7 @@ module Opulent
|
|
125
125
|
hash_symbol: /\A([a-zA-Z\_][a-zA-Z0-9\_]*\:(?!\:))/,
|
126
126
|
|
127
127
|
# Whitespace
|
128
|
-
whitespace: /\A
|
128
|
+
whitespace: /\A\s+/,
|
129
129
|
|
130
130
|
# Evaluation
|
131
131
|
eval: /\A\-(.*)/,
|
data/lib/opulent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opulent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Grozav
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|