recursive-open-struct 1.0.4 → 1.0.5
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 +4 -4
- data/AUTHORS.txt +1 -0
- data/CHANGELOG.md +8 -2
- data/LICENSE.txt +1 -1
- data/README.md +15 -7
- data/lib/recursive_open_struct.rb +1 -1
- data/lib/recursive_open_struct/version.rb +1 -1
- data/spec/recursive_open_struct/ostruct_2_0_0_spec.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ce4a65c03dbe16514c0c612776ec39b9a2c311b
|
4
|
+
data.tar.gz: 3ff3fa9d5f9ebb3f9d51dd682102a1b78e1b426e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3d79ba1465c421d5d0b0364b28b6bcc1b49d62e766e1aa7d2c5a1670a561e079808e32a2664bf055e654cf94bdb8fd53fe6a3c3087a4078c35c484d7b92d2d7
|
7
|
+
data.tar.gz: 5fded05b30f636676539de9aaed356c735e9adb43fedc020691494ace3330eccb9ad78349646511a0a5b3164dabe91452e1e95d7263191ffdd12baa721ecc23e
|
data/AUTHORS.txt
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,14 @@
|
|
1
|
+
1.0.5 / 2017-06-21
|
2
|
+
==================
|
3
|
+
|
4
|
+
* FIX [#54](https://github.com/aetherknight/recursive-open-struct/pull/54):
|
5
|
+
Beni Cherniavsky-Paskin: Improve performance of `new_ostruct_member` by using
|
6
|
+
`self.singleton_class.method_defined?` instead of `self.methods.include?`
|
7
|
+
|
1
8
|
1.0.4 / 2017-04-29
|
2
9
|
==================
|
3
10
|
|
4
|
-
* FIX
|
5
|
-
[#52](https://github.com/aetherknight/recursive-open-struct/pull/52): Joe
|
11
|
+
* FIX [#52](https://github.com/aetherknight/recursive-open-struct/pull/52): Joe
|
6
12
|
Rafaniello: Improve performance of DeepDup by using Set instead of an Array
|
7
13
|
to track visited nodes.
|
8
14
|
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -47,14 +47,22 @@ You may also install the gem manually :
|
|
47
47
|
gem install recursive-open-struct
|
48
48
|
|
49
49
|
## Contributing
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
50
|
+
|
51
|
+
For simple bug fixes, feel free to provide a pull request.
|
52
|
+
|
53
|
+
For anything else (new features, bugs that you want to report, and bugs that
|
54
|
+
are difficult to fix), I recommend opening an issue first to discuss the
|
55
|
+
feature or bug. I am fairly cautious about adding new features that might cause
|
56
|
+
RecursiveOpenStruct's API to deviate radically from OpenStruct's (since it
|
57
|
+
might introduce new reserved method names), and it is useful to discuss the
|
58
|
+
best way to solve a problem when there are tradeoffs or imperfect solutions.
|
59
|
+
|
60
|
+
When contributing code that changes behavior or fixes bugs, please include unit
|
61
|
+
tests to cover the new behavior or to provide regression testing for bugs.
|
62
|
+
Also, treat the unit tests as documentation --- make sure they are clean,
|
63
|
+
clear, and concise, and well organized.
|
56
64
|
|
57
65
|
## Copyright
|
58
66
|
|
59
|
-
Copyright (c) 2009-
|
67
|
+
Copyright (c) 2009-2017, The Recursive-open-struct developers (given in the
|
60
68
|
file AUTHORS.txt). See LICENSE.txt for details.
|
@@ -95,7 +95,7 @@ class RecursiveOpenStruct < OpenStruct
|
|
95
95
|
# 2.4.0.
|
96
96
|
def new_ostruct_member(name)
|
97
97
|
key_name = _get_key_from_table_(name)
|
98
|
-
unless self.
|
98
|
+
unless self.singleton_class.method_defined?(name.to_sym)
|
99
99
|
class << self; self; end.class_eval do
|
100
100
|
define_method(name) do
|
101
101
|
self[key_name]
|
@@ -96,7 +96,13 @@ describe RecursiveOpenStruct do
|
|
96
96
|
|
97
97
|
context "each_pair" do
|
98
98
|
it "iterates over hash keys, with keys as symbol" do
|
99
|
-
|
99
|
+
ros_pairs = []
|
100
|
+
ros.each_pair {|k,v| ros_pairs << [k,v]}
|
101
|
+
|
102
|
+
hash_pairs = []
|
103
|
+
{:foo => 'foo', :bar => :bar}.each_pair {|k,v| hash_pairs << [k,v]}
|
104
|
+
|
105
|
+
expect(ros_pairs).to match (hash_pairs)
|
100
106
|
end
|
101
107
|
end
|
102
108
|
|
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.0.
|
4
|
+
version: 1.0.5
|
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: 2017-
|
11
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|