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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbda9fcfae11aa802dd630503537fe4ad6e68208
4
- data.tar.gz: 7d9f569b65d0a043c6fdb831992eb17860cd9d01
3
+ metadata.gz: b6daf567113902547514da9b31c194ca45587239
4
+ data.tar.gz: 21ed11e388a2cdf395adadc22b22599ff034c30d
5
5
  SHA512:
6
- metadata.gz: 48323906c8fd7463558c599b7bdb2aa3d4799b6544fb51d5ad284903d11869bd00f24b96ade47edaf90a34c13fe0b36dedd8b8a43ca855ee5d65586ba76bd242
7
- data.tar.gz: 10cee6d1c1153a20d15acbcf591a7404722ee7dde668d40d7d0cb118719b8360f1061bc013411cf345c5fabfafc7fe2131714a39e88a3059959e2a15c3046e8c
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
- attributes[key] = map_attribute key, attribute, context
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[key]
49
- arguments[key] = attributes.delete 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
@@ -38,6 +38,7 @@ module Opulent
38
38
  block_yield(parent, indent) ||
39
39
  block(parent, indent) ||
40
40
  require_file(parent, indent)||
41
+ html_text(parent, indent) ||
41
42
  doctype(parent, indent)
42
43
 
43
44
  # Throw an error if we couldn't find a valid node
@@ -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 = accept_stripped :html_text)
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
@@ -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\-(.*)/,
@@ -1,4 +1,4 @@
1
1
  # @Opulent
2
2
  module Opulent
3
- VERSION = "1.1.5"
3
+ VERSION = "1.1.6"
4
4
  end
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.5
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-13 00:00:00.000000000 Z
11
+ date: 2015-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler