csdl 0.2.5 → 0.2.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86d840515b02e9204cf62b918aa6e66d938ee28c
4
- data.tar.gz: 13214717542d540b965100afedcd272860b0f6ea
3
+ metadata.gz: 0d619a1a1247aa90f4208236515b2e9babf7a2fe
4
+ data.tar.gz: 23668650182608ad4b8824552164a821ad82d1d8
5
5
  SHA512:
6
- metadata.gz: 0ba7deed00875ae83ce82c63f94aef32c44c6c2c3f5159238763ec76f924325a662bcfef4d3bdaf66b3c34911750bbded0ab33540343b988f5f7d2243264e1be
7
- data.tar.gz: cac413670a0cbe3df8f6504e5f8d0059b3fdcb40ab28bf4241ac95c574e2a8151f51c3d454d783d1131d47eab6bbd4ab8b9496621907646c156a47a8ac85b2a3
6
+ metadata.gz: 8024a4518a67bb92ed703301f0cbd97bedc9080cabc106a3ab740fdb7904cd2bbe9c7e257b02587d5ff4da691759aaad3467219b2cd41ec5a140092703e5dc31
7
+ data.tar.gz: 9ddee6b21793b7b3df25664ade3ef3f6260a4b055ed708d8ea88187ae08b063685261d954386f0910d6b62fb72f88632efea3134d0832ce53dcecc0744f9ee91
@@ -50,7 +50,7 @@ module CSDL
50
50
  # @return [String] The processed :statement_scope child node, prepended by the "return" keyword.
51
51
  #
52
52
  def on_return(node)
53
- statement_scope = node.children.find { |child| child.type == :statement_scope }
53
+ statement_scope = node.children.compact.find { |child| child.type == :statement_scope }
54
54
 
55
55
  if statement_scope.nil?
56
56
  fail ::CSDL::MissingReturnStatementScopeError, "Invalid CSDL AST: return statment scope is missing"
@@ -74,7 +74,7 @@ module CSDL
74
74
  # @see #on_tag
75
75
  #
76
76
  def on_statement_scope(node)
77
- "{" + process_all(node.children).join(" ") + "}"
77
+ "{" + process_all(node.children.compact).join(" ") + "}"
78
78
  end
79
79
 
80
80
  # Process :tag node with it's child nodes :tag_namespaces (optional), :tag_class, and :statement_scope.
@@ -107,9 +107,10 @@ module CSDL
107
107
  # @raise [MissingTagStatementScopeError] When we don't have a first-level :statement_scope child.
108
108
  #
109
109
  def on_tag(node)
110
- tag_namespaces = node.children.find { |child| child.type == :tag_namespaces }
111
- tag_class = node.children.find { |child| child.type == :tag_class }
112
- statement_scope = node.children.find { |child| child.type == :statement_scope }
110
+ children = node.children.compact
111
+ tag_namespaces = children.find { |child| child.type == :tag_namespaces }
112
+ tag_class = children.find { |child| child.type == :tag_class }
113
+ statement_scope = children.find { |child| child.type == :statement_scope }
113
114
 
114
115
  if tag_class.nil?
115
116
  fail ::CSDL::MissingTagClassError, "Invalid CSDL AST: :tag node must have a :tag_class child node"
@@ -168,7 +169,7 @@ module CSDL
168
169
  # @raise [MissingTagNodesError] When there aren't any first-level :tag_namespace child nodes.
169
170
  #
170
171
  def on_tag_namespaces(node)
171
- child_tag_namespaces = node.children.select { |child| child.type == :tag_namespace }
172
+ child_tag_namespaces = node.children.compact.select { |child| child.type == :tag_namespace }
172
173
 
173
174
  if child_tag_namespaces.empty?
174
175
  fail ::CSDL::MissingTagNodesError, "Invalid CSDL AST: A :tag_namespaces node must have at least one :tag_namespace child"
data/lib/csdl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CSDL
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csdl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - BJ Neilsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-10 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ast