ostruct 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/lib/ostruct.rb +10 -4
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 275ddcb1c14c6e9ce329eab097a2c56eb09b6a1b3a2c108bbccdf8a2d02013a1
4
- data.tar.gz: 3dec8898394fb32823c69f28645cedd248da69f7371156553a24820c87b62e90
3
+ metadata.gz: 21e6b4898eb983f5662872ec9b061babc748c196756225e561a2606f1be43f92
4
+ data.tar.gz: ed5975f18423c5db6e0cc0262ce17aa8a625a9488ab8a3a0a556287e71e7881d
5
5
  SHA512:
6
- metadata.gz: a9afae5a172d6bb18e5cf6f55bcd48c822ea07a22f3edb2197629e2434b6af83609eb4c01f9f12bb6343be2f74585dd1945a75a063200babccfc80293cd85c25
7
- data.tar.gz: eaa9370db72e1832db832a0b7f52763a226879e70e6f9ede84084fd9bf103389db454ce1944b915ae509746012d326d01df6ff24305ef25a0f305e42ccb417e1
6
+ metadata.gz: d1993c5247e4d0aa91ef62d1cdc943eb7e95b18a74abc0c6739c611ee4676c32a792801bb7b5f2f51c9992799863a5a6aeee66ad7ed69dd0f5b5b6ee0e227a2b
7
+ data.tar.gz: 119f99ac4213fe46116ffba0c142af7cbba91c7b7e7273ff4fd154585df5f31aa2fdc0048fd4dddc8de21e4ab3e95e1214da40fbb2608126a795f83a2162c628
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ end
17
17
 
18
18
  task :sync_tool do
19
19
  require 'fileutils'
20
- FileUtils.cp "../ruby/tool/lib/test/unit/core_assertions.rb", "./test/lib"
20
+ FileUtils.cp "../ruby/tool/lib/core_assertions.rb", "./test/lib"
21
21
  FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
22
22
  FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
23
23
  end
data/lib/ostruct.rb CHANGED
@@ -107,7 +107,7 @@
107
107
  # For all these reasons, consider not using OpenStruct at all.
108
108
  #
109
109
  class OpenStruct
110
- VERSION = "0.4.0"
110
+ VERSION = "0.5.0"
111
111
 
112
112
  #
113
113
  # Creates a new OpenStruct object. By default, the resulting OpenStruct
@@ -221,8 +221,14 @@ class OpenStruct
221
221
  #
222
222
  def new_ostruct_member!(name) # :nodoc:
223
223
  unless @table.key?(name) || is_method_protected!(name)
224
- define_singleton_method!(name) { @table[name] }
225
- define_singleton_method!("#{name}=") {|x| @table[name] = x}
224
+ getter_proc = Proc.new { @table[name] }
225
+ setter_proc = Proc.new {|x| @table[name] = x}
226
+ if defined?(::Ractor)
227
+ ::Ractor.make_shareable(getter_proc)
228
+ ::Ractor.make_shareable(setter_proc)
229
+ end
230
+ define_singleton_method!(name, &getter_proc)
231
+ define_singleton_method!("#{name}=", &setter_proc)
226
232
  end
227
233
  end
228
234
  private :new_ostruct_member!
@@ -308,7 +314,7 @@ class OpenStruct
308
314
  # Finds and returns the object in nested objects
309
315
  # that is specified by +name+ and +identifiers+.
310
316
  # The nested objects may be instances of various classes.
311
- # See {Dig Methods}[rdoc-ref:doc/dig_methods.rdoc].
317
+ # See {Dig Methods}[rdoc-ref:dig_methods.rdoc].
312
318
  #
313
319
  # Examples:
314
320
  # require "ostruct"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ostruct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-Andre Lafortune
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-14 00:00:00.000000000 Z
11
+ date: 2021-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  requirements: []
77
- rubygems_version: 3.2.3
77
+ rubygems_version: 3.3.0.dev
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Class to build custom data structures, similar to a Hash.