persistent-dmnd 1.0.4 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitlab-ci.yml +140 -25
- data/.ruby-version +1 -1
- data/CODE_OF_CONDUCT.adoc +1 -1
- data/LICENSE +1 -1
- data/README.adoc +5 -4
- data/gems.rb +5 -11
- data/lib/persistent-dmnd.rb +4 -3
- data/lib/persistent-/360/237/222/216.rb +9 -8
- data/lib/persistent_dmnd/array.rb +9 -8
- data/lib/persistent_dmnd/concurrent_ruby_support.rb +6 -5
- data/lib/persistent_dmnd/dmndifier.rb +5 -4
- data/lib/persistent_dmnd/everywhere.rb +4 -4
- data/lib/persistent_dmnd/hash.rb +9 -8
- data/lib/persistent_dmnd/is_persistent.rb +3 -2
- data/lib/persistent_dmnd/jruby_9_2_set_workaround.rb +9 -10
- data/lib/persistent_dmnd/jruby_workaround.rb +12 -11
- data/lib/persistent_dmnd/ruby_1_9_and_2_0_support.rb +4 -3
- data/lib/persistent_dmnd/self_conversion.rb +4 -3
- data/lib/persistent_dmnd/set.rb +20 -11
- data/lib/persistent_dmnd/version.rb +4 -3
- data/persistent-dmnd.gemspec +28 -25
- data/sorbet/config +2 -0
- data/sorbet/rbi/gems/concurrent-ruby.rbi +1660 -0
- data/sorbet/rbi/gems/hamster.rbi +683 -0
- data/sorbet/rbi/hidden-definitions/errors.txt +2552 -0
- data/sorbet/rbi/hidden-definitions/hidden.rbi +4180 -0
- data/sorbet/rbi/sorbet-typed/lib/rake/all/rake.rbi +645 -0
- data/sorbet/rbi/sorbet-typed/lib/rspec-core/all/rspec-core.rbi +1891 -0
- data/sorbet/rbi/todo.rbi +10 -0
- metadata +32 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 997bf52e7c42eede7ff1aec2b935b454de180a9249d07079b0f8e10826fbdf76
|
4
|
+
data.tar.gz: ccdbe8004757f456bfe7258d38881f4fea3341cb789325a3de230b350105a226
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eb571c134ee04d62521169e519052be1d064c4e8fe6b2003a8e89184366b4fb4e760104a29f4e33aef195eead23b909a905ad09105abdd743217dd94e2a614d
|
7
|
+
data.tar.gz: f2ea7b05c3d4dae505b71bc90002280f478548916297193b85afc162011ff2d72b3594737aadaa542e5f2af7adf2d2f23e842e82252143560dd5fad0fab276d8
|
data/.gitlab-ci.yml
CHANGED
@@ -10,6 +10,7 @@ testruby_1_9_3:
|
|
10
10
|
- vendor/ruby
|
11
11
|
|
12
12
|
before_script:
|
13
|
+
- printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
|
13
14
|
- apt-get update >/dev/null # Add UTF-8 support
|
14
15
|
- apt-get install -y locales >/dev/null # |
|
15
16
|
- echo "en_US UTF-8" > /etc/locale.gen # |
|
@@ -18,7 +19,7 @@ testruby_1_9_3:
|
|
18
19
|
- export LANGUAGE=en_US:en # |
|
19
20
|
- export LC_ALL=en_US.UTF-8 # v
|
20
21
|
- ruby -v # Print out ruby version for debugging
|
21
|
-
- gem install bundler
|
22
|
+
- gem install bundler -v '< 2' # Bundler is not installed with the image
|
22
23
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
23
24
|
|
24
25
|
script:
|
@@ -33,6 +34,7 @@ testruby_2_0:
|
|
33
34
|
- vendor/ruby
|
34
35
|
|
35
36
|
before_script:
|
37
|
+
- printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
|
36
38
|
- apt-get update >/dev/null # Add UTF-8 support
|
37
39
|
- apt-get install -y locales >/dev/null # |
|
38
40
|
- echo "en_US UTF-8" > /etc/locale.gen # |
|
@@ -41,7 +43,7 @@ testruby_2_0:
|
|
41
43
|
- export LANGUAGE=en_US:en # |
|
42
44
|
- export LC_ALL=en_US.UTF-8 # v
|
43
45
|
- ruby -v # Print out ruby version for debugging
|
44
|
-
- gem install bundler
|
46
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
45
47
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
46
48
|
|
47
49
|
script:
|
@@ -56,6 +58,7 @@ testruby_2_1:
|
|
56
58
|
- vendor/ruby
|
57
59
|
|
58
60
|
before_script:
|
61
|
+
- printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
|
59
62
|
- apt-get update >/dev/null # Add UTF-8 support
|
60
63
|
- apt-get install -y locales >/dev/null # |
|
61
64
|
- echo "en_US UTF-8" > /etc/locale.gen # |
|
@@ -64,7 +67,7 @@ testruby_2_1:
|
|
64
67
|
- export LANGUAGE=en_US:en # |
|
65
68
|
- export LC_ALL=en_US.UTF-8 # v
|
66
69
|
- ruby -v # Print out ruby version for debugging
|
67
|
-
- gem install bundler
|
70
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
68
71
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
69
72
|
|
70
73
|
script:
|
@@ -79,6 +82,7 @@ testruby_2_2:
|
|
79
82
|
- vendor/ruby
|
80
83
|
|
81
84
|
before_script:
|
85
|
+
- printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
|
82
86
|
- apt-get update >/dev/null # Add UTF-8 support
|
83
87
|
- apt-get install -y locales >/dev/null # |
|
84
88
|
- echo "en_US UTF-8" > /etc/locale.gen # |
|
@@ -87,7 +91,7 @@ testruby_2_2:
|
|
87
91
|
- export LANGUAGE=en_US:en # |
|
88
92
|
- export LC_ALL=en_US.UTF-8 # v
|
89
93
|
- ruby -v # Print out ruby version for debugging
|
90
|
-
- gem install bundler
|
94
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
91
95
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
92
96
|
|
93
97
|
script:
|
@@ -110,7 +114,7 @@ testruby_2_3:
|
|
110
114
|
- export LANGUAGE=en_US:en # |
|
111
115
|
- export LC_ALL=en_US.UTF-8 # v
|
112
116
|
- ruby -v # Print out ruby version for debugging
|
113
|
-
- gem install bundler
|
117
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
114
118
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
115
119
|
|
116
120
|
script:
|
@@ -133,7 +137,7 @@ testruby_2_4:
|
|
133
137
|
- export LANGUAGE=en_US:en # |
|
134
138
|
- export LC_ALL=en_US.UTF-8 # v
|
135
139
|
- ruby -v # Print out ruby version for debugging
|
136
|
-
- gem install bundler
|
140
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
137
141
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
138
142
|
|
139
143
|
script:
|
@@ -156,14 +160,81 @@ testruby_2_5:
|
|
156
160
|
- export LANGUAGE=en_US:en # |
|
157
161
|
- export LC_ALL=en_US.UTF-8 # v
|
158
162
|
- ruby -v # Print out ruby version for debugging
|
159
|
-
- gem install bundler
|
163
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
160
164
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
161
165
|
|
162
166
|
script:
|
163
167
|
- bin/rspec
|
164
168
|
|
165
169
|
testruby_2_6:
|
166
|
-
image: "ruby:2.6
|
170
|
+
image: "ruby:2.6"
|
171
|
+
|
172
|
+
# Cache gems in between builds
|
173
|
+
cache:
|
174
|
+
paths:
|
175
|
+
- vendor/ruby
|
176
|
+
|
177
|
+
before_script:
|
178
|
+
- apt-get update >/dev/null # Add UTF-8 support
|
179
|
+
- apt-get install -y locales >/dev/null # |
|
180
|
+
- echo "en_US UTF-8" > /etc/locale.gen # |
|
181
|
+
- locale-gen en_US.UTF-8 # |
|
182
|
+
- export LANG=en_US.UTF-8 # |
|
183
|
+
- export LANGUAGE=en_US:en # |
|
184
|
+
- export LC_ALL=en_US.UTF-8 # v
|
185
|
+
- ruby -v # Print out ruby version for debugging
|
186
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
187
|
+
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
188
|
+
|
189
|
+
script:
|
190
|
+
- bin/rspec
|
191
|
+
|
192
|
+
testruby_2_7:
|
193
|
+
image: "ruby:2.7"
|
194
|
+
|
195
|
+
# Cache gems in between builds
|
196
|
+
cache:
|
197
|
+
paths:
|
198
|
+
- vendor/ruby
|
199
|
+
|
200
|
+
before_script:
|
201
|
+
- apt-get update >/dev/null # Add UTF-8 support
|
202
|
+
- apt-get install -y locales >/dev/null # |
|
203
|
+
- echo "en_US UTF-8" > /etc/locale.gen # |
|
204
|
+
- locale-gen en_US.UTF-8 # |
|
205
|
+
- export LANG=en_US.UTF-8 # |
|
206
|
+
- export LANGUAGE=en_US:en # |
|
207
|
+
- export LC_ALL=en_US.UTF-8 # v
|
208
|
+
- ruby -v # Print out ruby version for debugging
|
209
|
+
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
210
|
+
|
211
|
+
script:
|
212
|
+
- bin/rspec
|
213
|
+
|
214
|
+
testruby_3_0:
|
215
|
+
image: "ruby:3.0.0"
|
216
|
+
|
217
|
+
# Cache gems in between builds
|
218
|
+
cache:
|
219
|
+
paths:
|
220
|
+
- vendor/ruby
|
221
|
+
|
222
|
+
before_script:
|
223
|
+
- apt-get update >/dev/null # Add UTF-8 support
|
224
|
+
- apt-get install -y locales >/dev/null # |
|
225
|
+
- echo "en_US UTF-8" > /etc/locale.gen # |
|
226
|
+
- locale-gen en_US.UTF-8 # |
|
227
|
+
- export LANG=en_US.UTF-8 # |
|
228
|
+
- export LANGUAGE=en_US:en # |
|
229
|
+
- export LC_ALL=en_US.UTF-8 # v
|
230
|
+
- ruby -v # Print out ruby version for debugging
|
231
|
+
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
232
|
+
|
233
|
+
script:
|
234
|
+
- bin/rspec
|
235
|
+
|
236
|
+
testruby_3_1:
|
237
|
+
image: "ruby:3.1.0"
|
167
238
|
|
168
239
|
# Cache gems in between builds
|
169
240
|
cache:
|
@@ -179,7 +250,6 @@ testruby_2_6:
|
|
179
250
|
- export LANGUAGE=en_US:en # |
|
180
251
|
- export LC_ALL=en_US.UTF-8 # v
|
181
252
|
- ruby -v # Print out ruby version for debugging
|
182
|
-
- gem install bundler --no-ri --no-rdoc # Bundler is not installed with the image
|
183
253
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
184
254
|
|
185
255
|
script:
|
@@ -204,14 +274,14 @@ testjruby_1_7:
|
|
204
274
|
- apt-get install -y git >/dev/null # Add git binary
|
205
275
|
- export JRUBY_OPTS=--dev # Faster test runs
|
206
276
|
- ruby -v # Print out ruby version for debugging
|
207
|
-
- gem install bundler
|
277
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
208
278
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
209
279
|
|
210
280
|
script:
|
211
281
|
- bin/rspec
|
212
282
|
|
213
|
-
|
214
|
-
image: "jruby:9.0
|
283
|
+
testjruby_9_0:
|
284
|
+
image: "jruby:9.0"
|
215
285
|
|
216
286
|
# Cache gems in between builds
|
217
287
|
cache:
|
@@ -219,7 +289,8 @@ testjruby_9_0_1_0:
|
|
219
289
|
- vendor/ruby
|
220
290
|
|
221
291
|
before_script:
|
222
|
-
-
|
292
|
+
- rm /etc/apt/sources.list.d/jessie-backports.list
|
293
|
+
- apt-get update # Add UTF-8 support
|
223
294
|
- apt-get install -y locales >/dev/null # |
|
224
295
|
- echo "en_US UTF-8" > /etc/locale.gen # |
|
225
296
|
- locale-gen en_US.UTF-8 # |
|
@@ -229,7 +300,10 @@ testjruby_9_0_1_0:
|
|
229
300
|
- apt-get install -y git >/dev/null # Add git binary
|
230
301
|
- export JRUBY_OPTS=--dev # Faster test runs
|
231
302
|
- ruby -v # Print out ruby version for debugging
|
232
|
-
-
|
303
|
+
- wget https://rubygems.org/downloads/jruby-openssl-0.9.21-java.gem # Needed to support newer ciphers when connecting to rubygems.org (otherwise gem downloads fail)
|
304
|
+
- gem install jruby-openssl-0.9.21-java.gem # Install the newer gem
|
305
|
+
- gem uninstall -x -i /opt/jruby/lib/ruby/gems/shared bundler # Remove any pre-existing bundler
|
306
|
+
- gem install bundler:'< 2' # Install latest bundler 1.x
|
233
307
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
234
308
|
|
235
309
|
script:
|
@@ -254,7 +328,8 @@ testjruby_9_1:
|
|
254
328
|
- apt-get install -y git >/dev/null # Add git binary
|
255
329
|
- export JRUBY_OPTS=--dev # Faster test runs
|
256
330
|
- ruby -v # Print out ruby version for debugging
|
257
|
-
- gem
|
331
|
+
- gem uninstall -x -i /opt/jruby/lib/ruby/gems/shared bundler # Remove any pre-existing bundler
|
332
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
258
333
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
259
334
|
|
260
335
|
script:
|
@@ -281,7 +356,7 @@ testjruby9_2_0_0:
|
|
281
356
|
- apt-get install -y git >/dev/null # Add git binary
|
282
357
|
- export JRUBY_OPTS=--dev # Faster test runs
|
283
358
|
- ruby -v # Print out ruby version for debugging
|
284
|
-
- gem install bundler
|
359
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
285
360
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
286
361
|
|
287
362
|
script:
|
@@ -306,17 +381,22 @@ testjruby_9_2:
|
|
306
381
|
- apt-get install -y git >/dev/null # Add git binary
|
307
382
|
- export JRUBY_OPTS=--dev # Faster test runs
|
308
383
|
- ruby -v # Print out ruby version for debugging
|
309
|
-
- gem
|
384
|
+
- gem uninstall -a -x -i /opt/jruby/lib/ruby/gems/shared bundler # Remove any pre-existing bundler
|
385
|
+
- gem install bundler:'< 2' # Bundler is not installed with the image
|
310
386
|
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
311
387
|
|
312
388
|
script:
|
313
389
|
- bin/rspec
|
314
390
|
|
315
|
-
|
316
|
-
image: "
|
391
|
+
testjruby_9_3:
|
392
|
+
image: "jruby:9.3"
|
393
|
+
|
394
|
+
# Cache gems in between builds
|
395
|
+
cache:
|
396
|
+
paths:
|
397
|
+
- vendor/ruby
|
317
398
|
|
318
399
|
before_script:
|
319
|
-
- gu install -c org.graalvm.ruby # Install TruffleRuby
|
320
400
|
- apt-get update >/dev/null # Add UTF-8 support
|
321
401
|
- apt-get install -y locales >/dev/null # |
|
322
402
|
- echo "en_US UTF-8" > /etc/locale.gen # |
|
@@ -324,12 +404,47 @@ testtruffleruby:
|
|
324
404
|
- export LANG=en_US.UTF-8 # |
|
325
405
|
- export LANGUAGE=en_US:en # |
|
326
406
|
- export LC_ALL=en_US.UTF-8 # v
|
327
|
-
- apt-get install -y git
|
328
|
-
-
|
329
|
-
# notes
|
407
|
+
- apt-get install -y git >/dev/null # Add git binary
|
408
|
+
- export JRUBY_OPTS=--dev # Faster test runs
|
330
409
|
- ruby -v # Print out ruby version for debugging
|
331
|
-
-
|
332
|
-
|
410
|
+
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
411
|
+
|
412
|
+
script:
|
413
|
+
- bin/rspec
|
414
|
+
|
415
|
+
testtruffleruby_20_2_0:
|
416
|
+
image: "flavorjones/truffleruby:20.2.0-buster"
|
417
|
+
|
418
|
+
before_script:
|
419
|
+
- apt-get update >/dev/null # Add UTF-8 support
|
420
|
+
- apt-get install -y locales >/dev/null # |
|
421
|
+
- echo "en_US UTF-8" > /etc/locale.gen # |
|
422
|
+
- locale-gen en_US.UTF-8 # |
|
423
|
+
- export LANG=en_US.UTF-8 # |
|
424
|
+
- export LANGUAGE=en_US:en # |
|
425
|
+
- export LC_ALL=en_US.UTF-8 # v
|
426
|
+
- apt-get install -y git >/dev/null # Add git binary
|
427
|
+
- ruby -v # Print out ruby version for debugging
|
428
|
+
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
429
|
+
|
430
|
+
script:
|
431
|
+
- bin/rspec
|
432
|
+
|
433
|
+
|
434
|
+
testtruffleruby_21_3_0:
|
435
|
+
image: "ghcr.io/flavorjones/truffleruby:21.3.0"
|
436
|
+
|
437
|
+
before_script:
|
438
|
+
- apt-get update >/dev/null # Add UTF-8 support
|
439
|
+
- apt-get install -y locales >/dev/null # |
|
440
|
+
- echo "en_US UTF-8" > /etc/locale.gen # |
|
441
|
+
- locale-gen en_US.UTF-8 # |
|
442
|
+
- export LANG=en_US.UTF-8 # |
|
443
|
+
- export LANGUAGE=en_US:en # |
|
444
|
+
- export LC_ALL=en_US.UTF-8 # v
|
445
|
+
- apt-get install -y git >/dev/null # Add git binary
|
446
|
+
- ruby -v # Print out ruby version for debugging
|
447
|
+
- bundle install -j $(nproc) --path vendor # Install dependencies into ./vendor/ruby
|
333
448
|
|
334
449
|
script:
|
335
450
|
- bin/rspec
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-
|
1
|
+
ruby-3.0.2
|
data/CODE_OF_CONDUCT.adoc
CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|
55
55
|
== Enforcement
|
56
56
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at ivo
|
58
|
+
reported by contacting the project team at ivo@ivoanjo.me. All
|
59
59
|
complaints will be reviewed and investigated and will result in a response that
|
60
60
|
is deemed necessary and appropriate to the circumstances. The project team is
|
61
61
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
data/LICENSE
CHANGED
data/README.adoc
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
:toclevels: 4
|
5
5
|
:toc-title:
|
6
6
|
|
7
|
-
|
7
|
+
image:https://badge.fury.io/rb/persistent-dmnd.svg["Gem Version", link="https://badge.fury.io/rb/persistent-dmnd"]
|
8
8
|
|
9
9
|
Are you tired of calling `.freeze` on your data structures (or your colleagues forgetting to do so)? +
|
10
10
|
Do you wish Ruby had a literal for creating immutable arrays?
|
@@ -97,8 +97,9 @@ It also (_optionally!_) interoperates with the https://github.com/ruby-concurren
|
|
97
97
|
Underneath the covers, persistent-💎 mostly builds atop the awesome https://github.com/hamstergem/hamster[hamster gem].
|
98
98
|
Big thanks to its equally-awesome authors!
|
99
99
|
|
100
|
-
Persistent-💎 is fully supported and tested on Ruby versions 1.9.3 to
|
101
|
-
If we don't support your Ruby, it's probably a Python binary instead
|
100
|
+
Persistent-💎 is fully supported and tested on Ruby versions 1.9.3 to 3.1, JRuby 1.7 to 9.3, and TruffleRuby 🎉.
|
101
|
+
If we don't support your Ruby, it's probably a Python binary instead (or a potato?).
|
102
|
+
Keep calm and 💎 away!
|
102
103
|
|
103
104
|
[discrete]
|
104
105
|
== Contents
|
@@ -373,7 +374,7 @@ When you need to go from thread-safe immutable data structures to thread-safe mu
|
|
373
374
|
|
374
375
|
You'll need to install concurrent-ruby first, see https://github.com/ruby-concurrency/concurrent-ruby#installation for instructions.
|
375
376
|
|
376
|
-
NOTE: If you're using TruffleRuby, you'll need to use concurrent-ruby >= 1.1.0
|
377
|
+
NOTE: If you're using TruffleRuby, you'll need to use concurrent-ruby >= 1.1.0, as older versions did not work correctly on TruffleRuby.
|
377
378
|
|
378
379
|
After that, you'll be able to:
|
379
380
|
|
data/gems.rb
CHANGED
@@ -1,17 +1,11 @@
|
|
1
|
-
|
1
|
+
# encoding: UTF-8
|
2
|
+
# typed: false
|
3
|
+
|
4
|
+
source "https://rubygems.org"
|
2
5
|
|
3
6
|
gemspec
|
4
7
|
|
5
8
|
# Specify ffi version to avoid dependency issues when switching between MRI
|
6
9
|
# and JRuby with the same gems.lock
|
7
10
|
# Only used in development
|
8
|
-
gem
|
9
|
-
|
10
|
-
# As of this writing, the latest available version of concurrent-ruby on
|
11
|
-
# rubygems.org is 1.1.0.pre1, which is broken on TruffleRuby -- at least version
|
12
|
-
# 1.1.0.pre2 is needed to support it.
|
13
|
-
# So for now, let's use the git version of concurrent-ruby in development, so we
|
14
|
-
# can run the full test suite for the gem locally and in CI.
|
15
|
-
if RUBY_ENGINE == 'truffleruby'
|
16
|
-
gem 'concurrent-ruby', git: 'https://github.com/ruby-concurrency/concurrent-ruby'
|
17
|
-
end
|
11
|
+
gem "ffi", "~> 1.9.18"
|
data/lib/persistent-dmnd.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
# typed: strong
|
2
3
|
|
3
4
|
# Persistent-💎: Ruby gem for easily creating immutable data structures
|
4
|
-
# Copyright (c) 2017 Ivo Anjo <ivo
|
5
|
+
# Copyright (c) 2017-2021 Ivo Anjo <ivo@ivoanjo.me>
|
5
6
|
#
|
6
7
|
# This file is part of Persistent-💎.
|
7
8
|
#
|
8
9
|
# MIT License
|
9
10
|
#
|
10
|
-
# Copyright (c) 2017 Ivo Anjo
|
11
|
+
# Copyright (c) 2017-2021 Ivo Anjo
|
11
12
|
#
|
12
13
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
14
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,4 +30,4 @@
|
|
29
30
|
|
30
31
|
# frozen_string_literal: true
|
31
32
|
|
32
|
-
require
|
33
|
+
require "persistent-💎"
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
# typed: true
|
2
3
|
|
3
4
|
# Persistent-💎: Ruby gem for easily creating immutable data structures
|
4
|
-
# Copyright (c) 2017 Ivo Anjo <ivo
|
5
|
+
# Copyright (c) 2017-2021 Ivo Anjo <ivo@ivoanjo.me>
|
5
6
|
#
|
6
7
|
# This file is part of Persistent-💎.
|
7
8
|
#
|
8
9
|
# MIT License
|
9
10
|
#
|
10
|
-
# Copyright (c) 2017 Ivo Anjo
|
11
|
+
# Copyright (c) 2017-2021 Ivo Anjo
|
11
12
|
#
|
12
13
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
14
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,12 +30,12 @@
|
|
29
30
|
|
30
31
|
# frozen_string_literal: true
|
31
32
|
|
32
|
-
require
|
33
|
-
require
|
34
|
-
require
|
35
|
-
require
|
36
|
-
require
|
37
|
-
require
|
33
|
+
require "persistent_dmnd/version"
|
34
|
+
require "persistent_dmnd/array"
|
35
|
+
require "persistent_dmnd/hash"
|
36
|
+
require "persistent_dmnd/set"
|
37
|
+
require "persistent_dmnd/dmndifier"
|
38
|
+
require "persistent_dmnd/jruby_workaround"
|
38
39
|
|
39
40
|
module Persistent💎
|
40
41
|
include JRubyWorkaround
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
# typed: false
|
2
3
|
|
3
4
|
# Persistent-💎: Ruby gem for easily creating immutable data structures
|
4
|
-
# Copyright (c) 2017 Ivo Anjo <ivo
|
5
|
+
# Copyright (c) 2017-2021 Ivo Anjo <ivo@ivoanjo.me>
|
5
6
|
#
|
6
7
|
# This file is part of Persistent-💎.
|
7
8
|
#
|
8
9
|
# MIT License
|
9
10
|
#
|
10
|
-
# Copyright (c) 2017 Ivo Anjo
|
11
|
+
# Copyright (c) 2017-2021 Ivo Anjo
|
11
12
|
#
|
12
13
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
14
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,13 +30,13 @@
|
|
29
30
|
|
30
31
|
# frozen_string_literal: true
|
31
32
|
|
32
|
-
require
|
33
|
-
require
|
34
|
-
require
|
35
|
-
require
|
33
|
+
require "persistent_dmnd/self_conversion"
|
34
|
+
require "persistent_dmnd/is_persistent"
|
35
|
+
require "persistent_dmnd/concurrent_ruby_support"
|
36
|
+
require "persistent_dmnd/jruby_workaround"
|
36
37
|
|
37
|
-
require
|
38
|
-
require
|
38
|
+
require "hamster"
|
39
|
+
require "set"
|
39
40
|
|
40
41
|
module Persistent💎
|
41
42
|
class Array < Hamster::Vector
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
# typed: true
|
2
3
|
|
3
4
|
# Persistent-💎: Ruby gem for easily creating immutable data structures
|
4
|
-
# Copyright (c) 2017 Ivo Anjo <ivo
|
5
|
+
# Copyright (c) 2017-2021 Ivo Anjo <ivo@ivoanjo.me>
|
5
6
|
#
|
6
7
|
# This file is part of Persistent-💎.
|
7
8
|
#
|
8
9
|
# MIT License
|
9
10
|
#
|
10
|
-
# Copyright (c) 2017 Ivo Anjo
|
11
|
+
# Copyright (c) 2017-2021 Ivo Anjo
|
11
12
|
#
|
12
13
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
14
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,7 +30,7 @@
|
|
29
30
|
|
30
31
|
# frozen_string_literal: true
|
31
32
|
|
32
|
-
require
|
33
|
+
require "thread"
|
33
34
|
|
34
35
|
module Persistent💎
|
35
36
|
# Simple module that attempts to load concurrent-ruby, and then stores the result for quick lookup
|
@@ -51,7 +52,7 @@ module Persistent💎
|
|
51
52
|
|
52
53
|
begin
|
53
54
|
REQUIRE_MUTEX.synchronize do # Avoid require races
|
54
|
-
require
|
55
|
+
require "concurrent"
|
55
56
|
end
|
56
57
|
mark_as_success
|
57
58
|
true
|
@@ -65,7 +66,7 @@ module Persistent💎
|
|
65
66
|
|
66
67
|
def raise_no_concurrent_ruby
|
67
68
|
raise(NotImplementedError,
|
68
|
-
|
69
|
+
"concurrent-ruby gem is not available, please install it in order to use #to_concurrent and #to_concurrent_* methods")
|
69
70
|
end
|
70
71
|
|
71
72
|
# The following methods are only for internal and test usage. Please do not use them :)
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
# typed: true
|
2
3
|
|
3
4
|
# Persistent-💎: Ruby gem for easily creating immutable data structures
|
4
|
-
# Copyright (c) 2017 Ivo Anjo <ivo
|
5
|
+
# Copyright (c) 2017-2021 Ivo Anjo <ivo@ivoanjo.me>
|
5
6
|
#
|
6
7
|
# This file is part of Persistent-💎.
|
7
8
|
#
|
8
9
|
# MIT License
|
9
10
|
#
|
10
|
-
# Copyright (c) 2017 Ivo Anjo
|
11
|
+
# Copyright (c) 2017-2021 Ivo Anjo
|
11
12
|
#
|
12
13
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
14
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,9 +30,9 @@
|
|
29
30
|
|
30
31
|
# frozen_string_literal: true
|
31
32
|
|
32
|
-
require
|
33
|
+
require "persistent_dmnd/ruby_1_9_and_2_0_support"
|
33
34
|
|
34
|
-
require
|
35
|
+
require "hamster"
|
35
36
|
|
36
37
|
module Persistent💎
|
37
38
|
class Dmndifier
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
-
|
2
|
+
# typed: strict
|
3
3
|
# Persistent-💎: Ruby gem for easily creating immutable data structures
|
4
|
-
# Copyright (c) 2017 Ivo Anjo <ivo
|
4
|
+
# Copyright (c) 2017-2021 Ivo Anjo <ivo@ivoanjo.me>
|
5
5
|
#
|
6
6
|
# This file is part of Persistent-💎.
|
7
7
|
#
|
8
8
|
# MIT License
|
9
9
|
#
|
10
|
-
# Copyright (c) 2017 Ivo Anjo
|
10
|
+
# Copyright (c) 2017-2021 Ivo Anjo
|
11
11
|
#
|
12
12
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
13
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,7 +29,7 @@
|
|
29
29
|
|
30
30
|
# frozen_string_literal: true
|
31
31
|
|
32
|
-
require
|
32
|
+
require "persistent-💎"
|
33
33
|
|
34
34
|
# Add our module to the main object, allowing our syntax to be used everywhere
|
35
35
|
include Persistent💎
|
data/lib/persistent_dmnd/hash.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
# typed: false
|
2
3
|
|
3
4
|
# Persistent-💎: Ruby gem for easily creating immutable data structures
|
4
|
-
# Copyright (c) 2017 Ivo Anjo <ivo
|
5
|
+
# Copyright (c) 2017-2021 Ivo Anjo <ivo@ivoanjo.me>
|
5
6
|
#
|
6
7
|
# This file is part of Persistent-💎.
|
7
8
|
#
|
8
9
|
# MIT License
|
9
10
|
#
|
10
|
-
# Copyright (c) 2017 Ivo Anjo
|
11
|
+
# Copyright (c) 2017-2021 Ivo Anjo
|
11
12
|
#
|
12
13
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
14
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -29,13 +30,13 @@
|
|
29
30
|
|
30
31
|
# frozen_string_literal: true
|
31
32
|
|
32
|
-
require
|
33
|
-
require
|
34
|
-
require
|
35
|
-
require
|
33
|
+
require "persistent_dmnd/self_conversion"
|
34
|
+
require "persistent_dmnd/is_persistent"
|
35
|
+
require "persistent_dmnd/concurrent_ruby_support"
|
36
|
+
require "persistent_dmnd/jruby_workaround"
|
36
37
|
|
37
|
-
require
|
38
|
-
require
|
38
|
+
require "hamster"
|
39
|
+
require "set"
|
39
40
|
|
40
41
|
module Persistent💎
|
41
42
|
class Hash < Hamster::Hash
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
+
# typed: true
|
2
3
|
|
3
4
|
# Persistent-💎: Ruby gem for easily creating immutable data structures
|
4
|
-
# Copyright (c) 2017 Ivo Anjo <ivo
|
5
|
+
# Copyright (c) 2017-2021 Ivo Anjo <ivo@ivoanjo.me>
|
5
6
|
#
|
6
7
|
# This file is part of Persistent-💎.
|
7
8
|
#
|
8
9
|
# MIT License
|
9
10
|
#
|
10
|
-
# Copyright (c) 2017 Ivo Anjo
|
11
|
+
# Copyright (c) 2017-2021 Ivo Anjo
|
11
12
|
#
|
12
13
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
14
|
# of this software and associated documentation files (the "Software"), to deal
|