moxml 0.5.109 → 0.5.110

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
  SHA256:
3
- metadata.gz: 04f63f1599959406386523aafe8289335b021ee5b729b0ac88dec032e08fac55
4
- data.tar.gz: f4d6cbd0012ef39253c519edd2af087c8ff230b7689622bad6143138e21c9d7d
3
+ metadata.gz: 3982cbbfe581d8786fa674d3ec8dd1f63900530621265baec4d6e2ff03a5791f
4
+ data.tar.gz: 83906c429efb771af92ba8358a0cd67523d52e7d732cf0ab7e2d6edf1f400af0
5
5
  SHA512:
6
- metadata.gz: f18cb5879bc64127726fc090c2c0f570edb813a032186e883d0c8ac3af7c96ec544f5c3fae7ca3d760b4fb5aba8ac5a1fb2a6a1422e27e7029f074543a036389
7
- data.tar.gz: a22ade19383fc5da7052f713761fe7bd458e062c59de10e6c8ab00d07f747a00b9627d7503148092630c798359074cbcabb05b91512b1953fd237087beafc2b5
6
+ metadata.gz: '0459f6ce8ee1713a840295ce951f19950b1f9e9acffa5ff2949b840fef604468897ae59398aae9bd9a3c1ea0c0b0f6ec591e02e7bf4eaf11dae96d56e3864f61'
7
+ data.tar.gz: 1ed691f3d140ea793f6f94ddef4693dab5155cbf9abbf8c2dce227bf828e2ae976bacf9db7b69839d0f8345f31b2aa6991e7ee6c52acf72ae5628e4bd82e8498
data/lib/moxml/element.rb CHANGED
@@ -127,8 +127,8 @@ module Moxml
127
127
  # writes bump it (see invalidate_attribute_value_cache!).
128
128
  def attribute_pairs
129
129
  generation = attribute_value_generation
130
- @pairs = nil if @pairs_gen != generation
131
- @pairs_gen = generation
130
+ @attribute_pairs = nil if @attribute_pairs_gen != generation
131
+ @attribute_pairs_gen = generation
132
132
  @attribute_pairs ||= adapter.attribute_pairs(@native)
133
133
  end
134
134
 
data/lib/moxml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Moxml
4
- VERSION = "0.5.109"
4
+ VERSION = "0.5.110"
5
5
  end
@@ -39,4 +39,23 @@ RSpec.describe Moxml::Element do
39
39
  end
40
40
  end
41
41
  end
42
+
43
+ context "when memoized" do
44
+ it "returns the same object on repeated reads" do
45
+ with_adapter(:leptris) do |ctx|
46
+ root = ctx.parse(xml).root
47
+ expect(root.attribute_pairs).to equal(root.attribute_pairs)
48
+ end
49
+ end
50
+
51
+ it "refreshes after a value write" do
52
+ with_adapter(:leptris) do |ctx|
53
+ root = ctx.parse(xml).root
54
+ before = root.attribute_pairs
55
+ root["id"] = "r9"
56
+ expect(root.attribute_pairs).not_to equal(before)
57
+ expect(root.attribute_pairs).to include(["id", "r9"])
58
+ end
59
+ end
60
+ end
42
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.109
4
+ version: 0.5.110
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.