recursive-open-struct 1.0.0 → 1.0.1

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: 2d1f3fe927a4c1021ecddcde1416e8f6135043c0
4
- data.tar.gz: e9ef12ce07604f331d0ccf2d807575c1a41f078b
3
+ metadata.gz: 91f6b03b9d7a4cb152dda016d3aa9aae975552cc
4
+ data.tar.gz: d8b1c74c38127a90cd894e7ebff086e0b372ccc5
5
5
  SHA512:
6
- metadata.gz: f430a2b3b7a980715c81d850b93e41259b5a3abaffb8101bd04a96cc55ad599862a1405314886753d9122fd8f045e0b4517622a8d9125478148da891f2e312e4
7
- data.tar.gz: 00ef1d3a89aa84d70499a3cc888e8a69f5f2cc921e8e07512b0290af4786c9d80b3a6a0029f6d79f7b65a2f10efa6438d2ae88d9792288c188be8c2da5b55052
6
+ metadata.gz: 92e7c17033509bc5eab4e2dabe5617e5a602619cd65eda8a40a2c828a456f1d73160a34f37c3e435bd8be786ec00d0e62e277bf0e6f610ae06ff1dfd978f3a11
7
+ data.tar.gz: 910614754bb46ad7dab007675af3a4cefc223fe724ad767c10d9a9f9c443385747cc5e25af671d46acfb219a47505e5b8322043dbddc7b6aabbf8a51892a1433
@@ -0,0 +1,15 @@
1
+ Recursive-open-struct was written by these fine people:
2
+
3
+ * Cédric Felizard <cedric@felizard.fr>
4
+ * Federico Aloi <federico.aloi@gmail.com>
5
+ * fervic <roberto@runawaybit.com>
6
+ * Kris Dekeyser <kris.dekeyser@libis.be>
7
+ * Matt Culpepper <matt@culpepper.co>
8
+ * Matthew O'Riordan <matthew.oriordan@gmail.com>
9
+ * Offirmo <offirmo.net@gmail.com>
10
+ * Peter Yeremenko <peter.yeremenko@gmail.com>
11
+ * Sebastian Gaul <sebastian@mgvmedia.com>
12
+ * Thiago Guimaraes <thiagogsr@gmail.com>
13
+ * Tom Chapin <tchapin@gmail.com>
14
+ * Victor Guzman <victor.guzman@runawaybit.com>
15
+ * William (B.J.) Snow Orvis <aetherknight@gmail.com>
@@ -1,3 +1,10 @@
1
+ 1.0.1 / 2016-01-18
2
+ ==================
3
+
4
+ * FIX [#42](https://github.com/aetherknight/recursive-open-struct/issues/42):
5
+ `[]` tried to call private methods if they existed instead of triggering the
6
+ `method_missing` code path. Thanks to @SaltwaterC for reporting.
7
+
1
8
  1.0.0 / 2015-12-11
2
9
  ==================
3
10
 
@@ -1,4 +1,5 @@
1
- Copyright (c) 2009-2015 William (B.J.) Snow Orvis
1
+ Copyright (c) 2009-2016, The Recursive-open-struct developers (given in the
2
+ file AUTHORS.txt).
2
3
 
3
4
  Permission is hereby granted, free of charge, to any person obtaining
4
5
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -56,4 +56,5 @@ You may also install the gem manually :
56
56
 
57
57
  ## Copyright
58
58
 
59
- Copyright (c) 2009-2015 William (B.J.) Snow Orvis. See LICENSE for details.
59
+ Copyright (c) 2009-2016, The Recursive-open-struct developers (given in the
60
+ file AUTHORS.txt). See LICENSE.txt for details.
data/Rakefile CHANGED
@@ -42,4 +42,14 @@ task :fix_permissions do
42
42
  FileUtils.chmod 0755, ['lib','spec'], :verbose => true
43
43
  end
44
44
 
45
- task :build => :fix_permissions
45
+ desc "Update the AUTHORS.txt file"
46
+ task :update_authors do
47
+ authors = `git log --format="%aN <%aE>"|sort -f|uniq`
48
+ File.open('AUTHORS.txt', 'w') do |f|
49
+ f.write("Recursive-open-struct was written by these fine people:\n\n")
50
+ f.write(authors.split("\n").map { |a| "* #{a}" }.join( "\n" ))
51
+ f.write("\n")
52
+ end
53
+ end
54
+
55
+ task :build => [:update_authors, :fix_permissions]
@@ -39,7 +39,7 @@ class RecursiveOpenStruct < OpenStruct
39
39
  alias_method :to_hash, :to_h
40
40
 
41
41
  def [](name)
42
- send name
42
+ public_send(name)
43
43
  end
44
44
 
45
45
  # Makes sure ROS responds as expected on #respond_to? and #method requests
@@ -3,5 +3,5 @@
3
3
  require 'ostruct'
4
4
 
5
5
  class RecursiveOpenStruct < OpenStruct
6
- VERSION = "1.0.0"
6
+ VERSION = "1.0.1"
7
7
  end
@@ -52,6 +52,19 @@ describe RecursiveOpenStruct do
52
52
  end
53
53
  end
54
54
 
55
+ context 'that contains keys that mirror existing private methods' do
56
+ let(:hash) { { test: :foo, rand: 'not a number' } }
57
+
58
+ # https://github.com/aetherknight/recursive-open-struct/issues/42
59
+ it 'handles subscript notation without calling the method name first (#42)' do
60
+ expect(ros['test']).to eq :foo
61
+ expect(ros['rand']).to eq 'not a number'
62
+
63
+ expect(ros.test).to eq :foo
64
+ expect(ros.rand).to eq 'not a number'
65
+ end
66
+ end
67
+
55
68
  end
56
69
 
57
70
 
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.0
4
+ version: 1.0.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: 2015-12-12 00:00:00.000000000 Z
11
+ date: 2016-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -117,6 +117,7 @@ files:
117
117
  - ".gitignore"
118
118
  - ".rspec"
119
119
  - ".travis.yml"
120
+ - AUTHORS.txt
120
121
  - CHANGELOG.md
121
122
  - Gemfile
122
123
  - LICENSE.txt
@@ -156,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
157
  version: '0'
157
158
  requirements: []
158
159
  rubyforge_project:
159
- rubygems_version: 2.4.5.1
160
+ rubygems_version: 2.5.1
160
161
  signing_key:
161
162
  specification_version: 4
162
163
  summary: OpenStruct subclass that returns nested hash attributes as RecursiveOpenStructs