recursive-open-struct 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/recursive_open_struct/version.rb +1 -1
- data/lib/recursive_open_struct.rb +0 -10
- data/spec/recursive_open_struct/recursion_spec.rb +0 -19
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0020068d7158163ebaa61a88a20513fda9662cabbb36227b9516c4c3579b579d'
|
4
|
+
data.tar.gz: 95da83b2e949d013183b4f7715ca0820e71e12cebb6a91bd095cbef8c739013c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1a8203c90c1cda06131dd1bd342d928458af25d8a66880c80b9db1ebe5abbf411792b8377f73558e13f1815d8a2e6fb43b7b270cbd21d9202c8dedc9b3cc107
|
7
|
+
data.tar.gz: c44fdc3e770d7f3be3ad5348174b62d36fe38c245516943195127152a549437fc26bb7a23047d79e3d71a08d12fdeebeb4bf12efd1b759172fedfde03625ecf1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
1.3.1 / 2024/10/03
|
2
|
+
==================
|
3
|
+
|
4
|
+
* FIX for
|
5
|
+
[#79](https://github.com/aetherknight/recursive-open-struct/issues/79):
|
6
|
+
Revert #72's change to marshalling and dumping since it is an API-breaking
|
7
|
+
change. It will be re-added in a new major version after releasing a fix.
|
8
|
+
|
1
9
|
1.3.0 / 2024/10/01
|
2
10
|
==================
|
3
11
|
|
@@ -40,16 +40,6 @@ class RecursiveOpenStruct < OpenStruct
|
|
40
40
|
@sub_elements = {}
|
41
41
|
end
|
42
42
|
|
43
|
-
def marshal_load(attributes)
|
44
|
-
hash, @options = attributes
|
45
|
-
@deep_dup = DeepDup.new(@options)
|
46
|
-
@sub_elements = {}
|
47
|
-
super(hash)
|
48
|
-
end
|
49
|
-
|
50
|
-
def marshal_dump
|
51
|
-
[super, @options]
|
52
|
-
end
|
53
43
|
|
54
44
|
if OpenStruct.public_instance_methods.include?(:initialize_copy)
|
55
45
|
def initialize_copy(orig)
|
@@ -37,14 +37,6 @@ describe RecursiveOpenStruct do
|
|
37
37
|
expect(ros.blah.changed).to eql 'backing'
|
38
38
|
end
|
39
39
|
|
40
|
-
it "handles being dump then loaded by Marshal" do
|
41
|
-
foo_struct = [RecursiveOpenStruct.new]
|
42
|
-
bar_struct = RecursiveOpenStruct.new(foo: foo_struct)
|
43
|
-
serialized = Marshal.dump(bar_struct)
|
44
|
-
|
45
|
-
expect(Marshal.load(serialized).foo).to eq(foo_struct)
|
46
|
-
end
|
47
|
-
|
48
40
|
describe "handling loops in the original Hashes" do
|
49
41
|
let(:h1) { { :a => 'a'} }
|
50
42
|
let(:h2) { { :a => 'b', :h1 => h1 } }
|
@@ -190,17 +182,6 @@ describe RecursiveOpenStruct do
|
|
190
182
|
let(:blah_list) { [ { :foo => '1' }, { :foo => '2' }, 'baz' ] }
|
191
183
|
let(:h) { { :blah => blah_list } }
|
192
184
|
|
193
|
-
context "when dump and loaded by Marshal" do
|
194
|
-
let(:test) { RecursiveOpenStruct.new(h, :recurse_over_arrays => true) }
|
195
|
-
subject { Marshal.load(Marshal.dump(test))}
|
196
|
-
|
197
|
-
it { expect(subject.blah.length).to eq 3 }
|
198
|
-
it { expect(subject.blah[0].foo).to eq '1' }
|
199
|
-
it { expect(subject.blah[1].foo).to eq '2' }
|
200
|
-
it { expect(subject.blah_as_a_hash).to eq blah_list }
|
201
|
-
it { expect(subject.blah[2]).to eq 'baz' }
|
202
|
-
end
|
203
|
-
|
204
185
|
context "when recursing over arrays is enabled" do
|
205
186
|
subject { RecursiveOpenStruct.new(h, :recurse_over_arrays => true) }
|
206
187
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recursive-open-struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William (B.J.) Snow Orvis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|