oga 2.1 → 2.2

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: dcab3403e0fe14385a3d49586b93b072411cde77
4
- data.tar.gz: 260b438d5af4359fdb8e5942df310c9a00865a5d
3
+ metadata.gz: eb91cb8f756557db46d3b6acf22407906f4b1ca0
4
+ data.tar.gz: 2d2fb0d3cad5ed6b98705489d51f95aeeb214746
5
5
  SHA512:
6
- metadata.gz: e6c7481726a96ca38f5a847009347d5793ea7ec36467c11fd9fad839e7acbf4c25e2b8b47db8f98b88081222744917b848f22ba5ca2c0d7b7f4b2c68e569d2bf
7
- data.tar.gz: 9b2ebffc901618e8fea939d7bb2f7ed50d5461308ba37f53ddb449b355bddb3d25822c05797ea4a7b55b21ead9155a9b289e9fc7123259d4c47443f863157aa4
6
+ metadata.gz: 225b7434479ba6726a3dc8536141cb6356238e9c9cae4bb5b0f825b2b3d190e2e77d3ada709d68ebda74447d48cf2d7e38c78fd4f6498671dd16265f45802ea0
7
+ data.tar.gz: e746f872516044856d6949838332a5ce27b476193f8ad17124bda7749863ebe626bb6d3c229f35173a2221b9af7e6d2ded86b146eb7a479c5533bfaa6e8798af
data/README.md CHANGED
@@ -162,6 +162,7 @@ Querying a document using a namespace:
162
162
  * Support for XPath 1.0
163
163
  * CSS3 selector support
164
164
  * XML namespace support (registering, querying, etc)
165
+ * Windows support
165
166
 
166
167
  ## Requirements
167
168
 
@@ -1,3 +1,3 @@
1
1
  module Oga
2
- VERSION = '2.1'
2
+ VERSION = '2.2'
3
3
  end # Oga
@@ -590,16 +590,20 @@ module Oga
590
590
  def on_pipe(ast, input, &block)
591
591
  left, right = *ast
592
592
 
593
- union = unique_literal(:union)
594
- conversion = literal(Conversion)
595
-
596
- union.assign(literal(XML::NodeSet).new)
597
- .followed_by(process(left, input) { |node| union << node })
598
- .followed_by(process(right, input) { |node| union << node })
599
- .followed_by do
600
- # block present means we're in a predicate
601
- block ? conversion.to_boolean(union).if_true(&block) : union
602
- end
593
+ union = unique_literal(:union)
594
+
595
+ # Expressions such as "a | b | c"
596
+ if left.type == :pipe
597
+ union.assign(process(left, input))
598
+ .followed_by(process(right, input) { |node| union << node })
599
+ .followed_by(union)
600
+ # Expressions such as "a | b"
601
+ else
602
+ union.assign(literal(XML::NodeSet).new)
603
+ .followed_by(process(left, input) { |node| union << node })
604
+ .followed_by(process(right, input) { |node| union << node })
605
+ .followed_by(union)
606
+ end
603
607
  end
604
608
 
605
609
  # @param [AST::Node] ast
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oga
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.1'
4
+ version: '2.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yorick Peterse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-09 00:00:00.000000000 Z
11
+ date: 2016-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ast