recursive-open-struct 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c20dbcb5ce4e4805d18e6c7ea454ef2357dbc224
4
- data.tar.gz: d9a112d4e90c9355c3f7356e88b16f81fe8da7f7
3
+ metadata.gz: 1ce4a65c03dbe16514c0c612776ec39b9a2c311b
4
+ data.tar.gz: 3ff3fa9d5f9ebb3f9d51dd682102a1b78e1b426e
5
5
  SHA512:
6
- metadata.gz: 7379ae006edd0cea0f1b052098042a6333cc8ed3509fa1742f77b54aa73d135eb483e41bfa7eb00e39b29fb2c7c5cc808cd788f4af0cb3ff0fdb11a77a4d2f77
7
- data.tar.gz: ac6f2be126563fa292e523f2e463fa1a8f520f8d5e6b45c134e6d196a4bc50de4d1bcf144448cf8da7b5b862615cf400efaf094efd1c11c9b55e7f5e96fa7175
6
+ metadata.gz: a3d79ba1465c421d5d0b0364b28b6bcc1b49d62e766e1aa7d2c5a1670a561e079808e32a2664bf055e654cf94bdb8fd53fe6a3c3087a4078c35c484d7b92d2d7
7
+ data.tar.gz: 5fded05b30f636676539de9aaed356c735e9adb43fedc020691494ace3330eccb9ad78349646511a0a5b3164dabe91452e1e95d7263191ffdd12baa721ecc23e
@@ -1,5 +1,6 @@
1
1
  Recursive-open-struct was written by these fine people:
2
2
 
3
+ * Beni Cherniavsky-Paskin <cben@redhat.com>
3
4
  * Cédric Felizard <cedric@felizard.fr>
4
5
  * Federico Aloi <federico.aloi@gmail.com>
5
6
  * fervic <roberto@runawaybit.com>
@@ -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
 
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2016, The Recursive-open-struct developers (given in the
1
+ Copyright (c) 2009-2017, The Recursive-open-struct developers (given in the
2
2
  file AUTHORS.txt).
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining
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
- * Fork the project.
52
- * Make your feature addition or bug fix.
53
- * Add tests for your new or changed functionality. Make sure the tests you add
54
- provide clean and clear explanation of the feature.
55
- * Send me a pull request. Bonus points for topic branches.
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-2016, The Recursive-open-struct developers (given in the
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.methods.include?(name.to_sym)
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]
@@ -3,5 +3,5 @@
3
3
  require 'ostruct'
4
4
 
5
5
  class RecursiveOpenStruct < OpenStruct
6
- VERSION = "1.0.4"
6
+ VERSION = "1.0.5"
7
7
  end
@@ -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
- expect(ros.each_pair).to match ({:foo => 'foo', :bar => :bar}.each_pair)
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
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-04-29 00:00:00.000000000 Z
11
+ date: 2017-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler