saxerator 0.9.1 → 0.9.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: 549f3904273d8c16502ac451896f49fe49e8425a
4
- data.tar.gz: 0170f3915d36acbf25f77b6abf6b06dddff8ba8c
3
+ metadata.gz: 65e8c906e3b63d2bc0968eb8efbf8e737827a0f6
4
+ data.tar.gz: ef9f928056120981840202ea4c19e3778c8c5424
5
5
  SHA512:
6
- metadata.gz: 5083fbc22ec09116b79cbb5dbf2c334551e1d2a6448bab12b559aa14feb601fccc33a5caee4a8bf2911131c9e5399a52272869fa5d5d9d69a36ebc2c7a3fd645
7
- data.tar.gz: d4a324588e410486255f1336d37585410b67ca1b43a078971698b9081cdab3f39c4aa979e35f0abddf4de233bcccb850988cfc174d6fcf2ef94755155313b8f7
6
+ metadata.gz: 2ee3f52630eda84e56596e0972369e902f28ddf4a20fd23cd10fbda360bec551aae51d5045267f98007017d08e3880b59c5ad566fdeb9546bc76c054cd349bd0
7
+ data.tar.gz: e535bd0e982ec499187b39864851237923d909852c5ce86f75412a62c597823e9be6a6f2c92abb6958ee2ed5f06857d1b97de3e04340d849b8ca6abe35349b3d
@@ -36,12 +36,20 @@ module Saxerator
36
36
  end
37
37
 
38
38
  def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = [])
39
- return start_element(name, attrs) if @ignore_namespaces
39
+ if @ignore_namespaces
40
+ prefix, uri, ns = nil, nil, []
41
+ attrs.each do |attr|
42
+ attr.prefix = nil if attr.respond_to? :prefix
43
+ attr.uri = nil if attr.respond_to? :uri
44
+ end
45
+ end
40
46
  check_latches_and_passthrough(:start_element_namespace, name, attrs, prefix, uri, ns)
41
47
  end
42
48
 
43
49
  def end_element_namespace(name, prefix = nil, uri = nil)
44
- return end_element(name) if @ignore_namespaces
50
+ if @ignore_namespaces
51
+ prefix, uri = nil
52
+ end
45
53
  check_latches_and_passthrough(:end_element_namespace, name, prefix, uri)
46
54
  end
47
55
 
@@ -1,3 +1,3 @@
1
1
  module Saxerator
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
@@ -66,9 +66,18 @@ describe Saxerator do
66
66
  end
67
67
 
68
68
  context "with ignore namespaces" do
69
- let(:xml) { "<ns1:foo xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:ns1=\"http://foo.com\" xmlns:ns3=\"http://bar.com\"><ns3:bar>baz</ns3:bar></ns1:foo>" }
69
+ let(:xml) { <<-eos
70
+ <ns1:foo xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ns1="http://foo.com" xmlns:ns3="http://bar.com">
71
+ <ns3:bar>baz</ns3:bar>
72
+ <ns3:bar bar="bar" ns1:foo="foo" class="class">bax</ns3:bar>
73
+ </ns1:foo>
74
+ eos
75
+ }
76
+
70
77
  subject(:parser) do
71
- Saxerator.parser(xml) { |config| config.ignore_namespaces! }
78
+ Saxerator.parser(xml) { |config|
79
+ config.ignore_namespaces!
80
+ }
72
81
  end
73
82
 
74
83
  specify {
@@ -76,8 +85,7 @@ describe Saxerator do
76
85
  parser.for_tag("bar").each do |tag|
77
86
  bar_count += 1
78
87
  end
79
-
80
- bar_count.should == 1
88
+ bar_count.should == 2
81
89
  }
82
90
  end
83
91
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saxerator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bradley Schaefer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-28 00:00:00.000000000 Z
11
+ date: 2014-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri