persistent-dmnd 2.0.5 โ 3.0.0
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/.gitlab-ci.yml +27 -312
- data/.standard.yml +4 -0
- data/CODE_OF_CONDUCT.adoc +99 -45
- data/README.adoc +17 -17
- data/Rakefile +4 -3
- data/UPSTREAM_TODO.adoc +0 -10
- data/gems.rb +1 -4
- data/lib/persistent-dmnd.rb +0 -3
- data/lib/persistent-/360/237/222/216.rb +1 -7
- data/lib/persistent_dmnd/array.rb +5 -10
- data/lib/persistent_dmnd/concurrent_ruby_support.rb +1 -6
- data/lib/persistent_dmnd/dmndifier.rb +17 -19
- data/lib/persistent_dmnd/everywhere.rb +1 -3
- data/lib/persistent_dmnd/hash.rb +5 -30
- data/lib/persistent_dmnd/is_persistent.rb +0 -3
- data/lib/persistent_dmnd/jruby_9_2_set_workaround.rb +32 -32
- data/lib/persistent_dmnd/self_conversion.rb +0 -7
- data/lib/persistent_dmnd/set.rb +9 -12
- data/lib/persistent_dmnd/version.rb +1 -4
- data/persistent-dmnd.gemspec +11 -15
- metadata +25 -35
- data/.ruby-version +0 -1
- data/lib/persistent_dmnd/jruby_workaround.rb +0 -107
- data/lib/persistent_dmnd/ruby_1_9_and_2_0_support.rb +0 -48
- data/sorbet/config +0 -2
- data/sorbet/rbi/gems/concurrent-ruby.rbi +0 -1660
- data/sorbet/rbi/gems/hamster.rbi +0 -683
- data/sorbet/rbi/hidden-definitions/errors.txt +0 -2552
- data/sorbet/rbi/hidden-definitions/hidden.rbi +0 -4180
- data/sorbet/rbi/sorbet-typed/lib/rake/all/rake.rbi +0 -645
- data/sorbet/rbi/sorbet-typed/lib/rspec-core/all/rspec-core.rbi +0 -1891
- data/sorbet/rbi/todo.rbi +0 -10
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: persistent-dmnd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ivo Anjo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-02-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -16,28 +16,28 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '13.1'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '13.1'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rspec
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '3.
|
|
33
|
+
version: '3.13'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '3.
|
|
40
|
+
version: '3.13'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: concurrent-ruby
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -53,19 +53,19 @@ dependencies:
|
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '1.1'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
56
|
+
name: standard
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- - "
|
|
59
|
+
- - ">="
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0
|
|
61
|
+
version: '0'
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- - "
|
|
66
|
+
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0
|
|
68
|
+
version: '0'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: pry
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -95,47 +95,47 @@ dependencies:
|
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
98
|
+
name: hamster
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
101
|
- - ">="
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
103
|
+
version: 3.0.0
|
|
104
104
|
type: :development
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
108
|
- - ">="
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
110
|
+
version: 3.0.0
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name:
|
|
112
|
+
name: warning
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
115
|
- - "~>"
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
|
-
version:
|
|
117
|
+
version: 1.3.0
|
|
118
118
|
type: :development
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
122
|
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
|
-
version:
|
|
124
|
+
version: 1.3.0
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
|
-
name:
|
|
126
|
+
name: immutable-ruby
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
128
128
|
requirements:
|
|
129
|
-
- - "
|
|
129
|
+
- - ">="
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
|
-
version:
|
|
131
|
+
version: 0.1.0
|
|
132
132
|
type: :runtime
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
|
-
- - "
|
|
136
|
+
- - ">="
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
|
-
version:
|
|
138
|
+
version: 0.1.0
|
|
139
139
|
description: A tiny ruby gem that gives you a beautiful short-hand syntax for creating
|
|
140
140
|
immutable arrays, hashes and sets
|
|
141
141
|
email: ivo@ivoanjo.me
|
|
@@ -146,7 +146,7 @@ files:
|
|
|
146
146
|
- ".gitignore"
|
|
147
147
|
- ".gitlab-ci.yml"
|
|
148
148
|
- ".rspec"
|
|
149
|
-
- ".
|
|
149
|
+
- ".standard.yml"
|
|
150
150
|
- CODE_OF_CONDUCT.adoc
|
|
151
151
|
- LICENSE
|
|
152
152
|
- README.adoc
|
|
@@ -165,20 +165,10 @@ files:
|
|
|
165
165
|
- lib/persistent_dmnd/hash.rb
|
|
166
166
|
- lib/persistent_dmnd/is_persistent.rb
|
|
167
167
|
- lib/persistent_dmnd/jruby_9_2_set_workaround.rb
|
|
168
|
-
- lib/persistent_dmnd/jruby_workaround.rb
|
|
169
|
-
- lib/persistent_dmnd/ruby_1_9_and_2_0_support.rb
|
|
170
168
|
- lib/persistent_dmnd/self_conversion.rb
|
|
171
169
|
- lib/persistent_dmnd/set.rb
|
|
172
170
|
- lib/persistent_dmnd/version.rb
|
|
173
171
|
- persistent-dmnd.gemspec
|
|
174
|
-
- sorbet/config
|
|
175
|
-
- sorbet/rbi/gems/concurrent-ruby.rbi
|
|
176
|
-
- sorbet/rbi/gems/hamster.rbi
|
|
177
|
-
- sorbet/rbi/hidden-definitions/errors.txt
|
|
178
|
-
- sorbet/rbi/hidden-definitions/hidden.rbi
|
|
179
|
-
- sorbet/rbi/sorbet-typed/lib/rake/all/rake.rbi
|
|
180
|
-
- sorbet/rbi/sorbet-typed/lib/rspec-core/all/rspec-core.rbi
|
|
181
|
-
- sorbet/rbi/todo.rbi
|
|
182
172
|
homepage: https://gitlab.com/ivoanjo/persistent-dmnd/
|
|
183
173
|
licenses:
|
|
184
174
|
- MIT
|
|
@@ -191,14 +181,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
191
181
|
requirements:
|
|
192
182
|
- - ">="
|
|
193
183
|
- !ruby/object:Gem::Version
|
|
194
|
-
version:
|
|
184
|
+
version: 2.4.0
|
|
195
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
186
|
requirements:
|
|
197
187
|
- - ">="
|
|
198
188
|
- !ruby/object:Gem::Version
|
|
199
189
|
version: '0'
|
|
200
190
|
requirements: []
|
|
201
|
-
rubygems_version: 3.
|
|
191
|
+
rubygems_version: 3.5.3
|
|
202
192
|
signing_key:
|
|
203
193
|
specification_version: 4
|
|
204
194
|
summary: "Persistent-\U0001F48E: Because Immutable Data Is Forever"
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ruby-3.0.2
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
# encoding: UTF-8
|
|
2
|
-
# typed: false
|
|
3
|
-
|
|
4
|
-
# Persistent-๐: Ruby gem for easily creating immutable data structures
|
|
5
|
-
# Copyright (c) 2017-2021 Ivo Anjo <ivo@ivoanjo.me>
|
|
6
|
-
#
|
|
7
|
-
# This file is part of Persistent-๐.
|
|
8
|
-
#
|
|
9
|
-
# MIT License
|
|
10
|
-
#
|
|
11
|
-
# Copyright (c) 2017-2021 Ivo Anjo
|
|
12
|
-
#
|
|
13
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
15
|
-
# in the Software without restriction, including without limitation the rights
|
|
16
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
18
|
-
# furnished to do so, subject to the following conditions:
|
|
19
|
-
#
|
|
20
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
21
|
-
# copies or substantial portions of the Software.
|
|
22
|
-
#
|
|
23
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
-
# SOFTWARE.
|
|
30
|
-
|
|
31
|
-
# frozen_string_literal: true
|
|
32
|
-
|
|
33
|
-
module Persistent๐
|
|
34
|
-
module JRubyWorkaround
|
|
35
|
-
if RUBY_PLATFORM == "java" && JRUBY_VERSION < "9.2.0.0" # Only supposed to do something on legacy JRuby versions
|
|
36
|
-
BROKEN_ENCODING = "\x00"
|
|
37
|
-
private_constant :BROKEN_ENCODING
|
|
38
|
-
|
|
39
|
-
BROKEN_ENCODING_JRUBY_1_7 = [239, 146, 142].pack("c*").force_encoding("UTF-8")
|
|
40
|
-
private_constant :BROKEN_ENCODING_JRUBY_1_7
|
|
41
|
-
|
|
42
|
-
def self.included(klass)
|
|
43
|
-
# Make methods on this module also available inside classes (e.g. not just in instances)
|
|
44
|
-
klass.extend(self)
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def method_added(name)
|
|
48
|
-
super
|
|
49
|
-
maybe_fix_broken_encoding(name)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def singleton_method_added(name)
|
|
53
|
-
super
|
|
54
|
-
maybe_fix_broken_encoding(name, self.singleton_class)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
private
|
|
58
|
-
|
|
59
|
-
# Workaround JRuby encoding bug
|
|
60
|
-
# See https://github.com/jruby/jruby/issues/4878
|
|
61
|
-
# and https://gitlab.com/ivoanjo/persistent-dmnd/issues/5
|
|
62
|
-
#
|
|
63
|
-
# The trick here is that on JRuby, methods with emojis in the name are defined, but the resulting name is mangled
|
|
64
|
-
# so instead of for instance #to_๐ the result is #to_?\x00. (Or #๐ify will become #?ify\x00.) This behavior is
|
|
65
|
-
# consistent between def and calling a method, so def will register a method #to_?\x00, and a normal method call
|
|
66
|
-
# will do the same mangling and thus look for a method **WITH** the mangled name.
|
|
67
|
-
#
|
|
68
|
-
# But there are still other places in the code that rely on the correct name, such as alias and public_send/send,
|
|
69
|
-
# so we additionally use this module to define the correct name as an alias for the broken name.
|
|
70
|
-
#
|
|
71
|
-
# Thus, it all works on JRuby, albeit in a very roundabout way!
|
|
72
|
-
#
|
|
73
|
-
# FOR JRUBY 1.7:
|
|
74
|
-
# On JRuby 1.7 it seems that the mangling is different, and the emoji just gets replaced with ?, so for
|
|
75
|
-
# instance #to_๐ becomes #to_?. But then, to make things interesting, on symbols created without quotes, it
|
|
76
|
-
# gets mangled with the BROKEN_ENCODING_JRUBY_1_7, e.g :to_๐ becomes :to_BROKEN_ENCODING_JRUBY_1_7 (but
|
|
77
|
-
# :"to_๐" is still correct).
|
|
78
|
-
# To support both of these, we add an extra alias on JRuby, so that everything else seems to work even if it is
|
|
79
|
-
# actually using the name with the mangled encoding.
|
|
80
|
-
#
|
|
81
|
-
def maybe_fix_broken_encoding(name, target = nil)
|
|
82
|
-
name_string = name.to_s
|
|
83
|
-
|
|
84
|
-
if JRUBY_VERSION.start_with?("1.7.")
|
|
85
|
-
unless name_string.match(/\?.+/) ||
|
|
86
|
-
["a?", "h?", "s?", "each?"].include?(name_string) ||
|
|
87
|
-
["_?", "_a?", "_h?", "_s?"].any? { |suffix| name_string.end_with?(suffix) }
|
|
88
|
-
return
|
|
89
|
-
end
|
|
90
|
-
else
|
|
91
|
-
return unless name_string.end_with?(BROKEN_ENCODING)
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
fixed_name = name_string.sub("?", "๐").delete(BROKEN_ENCODING).to_sym
|
|
95
|
-
fixed_name_jruby_1_7 = name_string.sub("?", BROKEN_ENCODING_JRUBY_1_7).to_sym
|
|
96
|
-
|
|
97
|
-
if target
|
|
98
|
-
target.instance_eval { alias_method(fixed_name, name) }
|
|
99
|
-
target.instance_eval { alias_method(fixed_name_jruby_1_7, name) } if JRUBY_VERSION.start_with?("1.7.")
|
|
100
|
-
else
|
|
101
|
-
alias_method(fixed_name, name)
|
|
102
|
-
alias_method(fixed_name_jruby_1_7, name) if JRUBY_VERSION.start_with?("1.7.")
|
|
103
|
-
end
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
end
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# encoding: UTF-8
|
|
2
|
-
# typed: true
|
|
3
|
-
|
|
4
|
-
# Persistent-๐: Ruby gem for easily creating immutable data structures
|
|
5
|
-
# Copyright (c) 2017-2021 Ivo Anjo <ivo@ivoanjo.me>
|
|
6
|
-
#
|
|
7
|
-
# This file is part of Persistent-๐.
|
|
8
|
-
#
|
|
9
|
-
# MIT License
|
|
10
|
-
#
|
|
11
|
-
# Copyright (c) 2017-2021 Ivo Anjo
|
|
12
|
-
#
|
|
13
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
15
|
-
# in the Software without restriction, including without limitation the rights
|
|
16
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
18
|
-
# furnished to do so, subject to the following conditions:
|
|
19
|
-
#
|
|
20
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
21
|
-
# copies or substantial portions of the Software.
|
|
22
|
-
#
|
|
23
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
-
# SOFTWARE.
|
|
30
|
-
|
|
31
|
-
# frozen_string_literal: true
|
|
32
|
-
|
|
33
|
-
module Persistent๐
|
|
34
|
-
module Ruby19And20Support
|
|
35
|
-
# Enumerable#to_h was only introduced in Ruby 2.1 so we have to do it by hand on 2.0/1.9
|
|
36
|
-
if RUBY_VERSION.start_with?("2.0.") || RUBY_VERSION.start_with?("1.9.")
|
|
37
|
-
def self.enumerable_to_h(enumerable)
|
|
38
|
-
enumerable.each_with_object({}) do |(key, value), result|
|
|
39
|
-
result[key] = value
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
else
|
|
43
|
-
def self.enumerable_to_h(enumerable)
|
|
44
|
-
enumerable.to_h
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
data/sorbet/config
DELETED