set 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/test.yml +1 -1
- data/lib/set.rb +42 -42
- data/set.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e23398781865843cd7ba5286dca1a65ff241807ba8196020407b986bc74270b1
|
4
|
+
data.tar.gz: 19c57ed5aa898b0e4ee695df08aeccfb0d313cd785d4dd318941d5bb68291595
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88ee0f430a9b381d557f4c8bbe161c2199207ffcbaeb79d78daec9b9dc3e4ebb9fbc3a397ae82c5ffeba0b73782e9363ee19512e0b1b0372628ef4c6d715365a
|
7
|
+
data.tar.gz: d05a97bb9a5cb900eb303ce85926b73e04530fd44ca0cc85e9ca09e8413af5f5a3ad812cf4409a9fd5f2bc191632e8673d9fc3c89ebb62b8fa13fcf6a3c643ff
|
data/.github/workflows/test.yml
CHANGED
data/lib/set.rb
CHANGED
@@ -88,134 +88,134 @@
|
|
88
88
|
#
|
89
89
|
# ### Methods for Creating a \Set
|
90
90
|
#
|
91
|
-
# - ::[]
|
91
|
+
# - ::[]:
|
92
92
|
# Returns a new set containing the given objects.
|
93
|
-
# - ::new
|
93
|
+
# - ::new:
|
94
94
|
# Returns a new set containing either the given objects
|
95
95
|
# (if no block given) or the return values from the called block
|
96
96
|
# (if a block given).
|
97
97
|
#
|
98
98
|
# ### Methods for \Set Operations
|
99
99
|
#
|
100
|
-
# - [|](#method-i-7C) (aliased as #union and #+)
|
100
|
+
# - [|](#method-i-7C) (aliased as #union and #+):
|
101
101
|
# Returns a new set containing all elements from +self+
|
102
102
|
# and all elements from a given enumerable (no duplicates).
|
103
|
-
# - [&](#method-i-26) (aliased as #intersection)
|
103
|
+
# - [&](#method-i-26) (aliased as #intersection):
|
104
104
|
# Returns a new set containing all elements common to +self+
|
105
105
|
# and a given enumerable.
|
106
|
-
# - [-](#method-i-2D) (aliased as #difference)
|
106
|
+
# - [-](#method-i-2D) (aliased as #difference):
|
107
107
|
# Returns a copy of +self+ with all elements
|
108
108
|
# in a given enumerable removed.
|
109
|
-
# - [\^](#method-i-5E)
|
109
|
+
# - [\^](#method-i-5E):
|
110
110
|
# Returns a new set containing all elements from +self+
|
111
111
|
# and a given enumerable except those common to both.
|
112
112
|
#
|
113
113
|
# ### Methods for Comparing
|
114
114
|
#
|
115
|
-
# - [<=>](#method-i-3C-3D-3E)
|
115
|
+
# - [<=>](#method-i-3C-3D-3E):
|
116
116
|
# Returns -1, 0, or 1 as +self+ is less than, equal to,
|
117
117
|
# or greater than a given object.
|
118
|
-
# - [==](#method-i-3D-3D)
|
118
|
+
# - [==](#method-i-3D-3D):
|
119
119
|
# Returns whether +self+ and a given enumerable are equal,
|
120
120
|
# as determined by Object#eql?.
|
121
|
-
# - \#compare_by_identity
|
121
|
+
# - \#compare_by_identity?:
|
122
122
|
# Returns whether the set considers only identity
|
123
123
|
# when comparing elements.
|
124
124
|
#
|
125
125
|
# ### Methods for Querying
|
126
126
|
#
|
127
|
-
# - \#length (aliased as #size)
|
127
|
+
# - \#length (aliased as #size):
|
128
128
|
# Returns the count of elements.
|
129
|
-
# - \#empty
|
129
|
+
# - \#empty?:
|
130
130
|
# Returns whether the set has no elements.
|
131
|
-
# - \#include? (aliased as #member? and #===)
|
131
|
+
# - \#include? (aliased as #member? and #===):
|
132
132
|
# Returns whether a given object is an element in the set.
|
133
|
-
# - \#subset? (aliased as [<=](#method-i-3C-3D))
|
133
|
+
# - \#subset? (aliased as [<=](#method-i-3C-3D)):
|
134
134
|
# Returns whether a given object is a subset of the set.
|
135
|
-
# - \#proper_subset? (aliased as [<](#method-i-3C))
|
135
|
+
# - \#proper_subset? (aliased as [<](#method-i-3C)):
|
136
136
|
# Returns whether a given enumerable is a proper subset of the set.
|
137
|
-
# - \#superset? (aliased as [
|
137
|
+
# - \#superset? (aliased as [>=](#method-i-3E-3D])):
|
138
138
|
# Returns whether a given enumerable is a superset of the set.
|
139
|
-
# - \#proper_superset? (aliased as [>](#method-i-3E))
|
139
|
+
# - \#proper_superset? (aliased as [>](#method-i-3E)):
|
140
140
|
# Returns whether a given enumerable is a proper superset of the set.
|
141
|
-
# - \#disjoint
|
141
|
+
# - \#disjoint?:
|
142
142
|
# Returns +true+ if the set and a given enumerable
|
143
143
|
# have no common elements, +false+ otherwise.
|
144
|
-
# - \#intersect
|
145
|
-
# Returns +true+ if the set and a given enumerable
|
144
|
+
# - \#intersect?:
|
145
|
+
# Returns +true+ if the set and a given enumerable:
|
146
146
|
# have any common elements, +false+ otherwise.
|
147
|
-
# - \#compare_by_identity
|
147
|
+
# - \#compare_by_identity?:
|
148
148
|
# Returns whether the set considers only identity
|
149
149
|
# when comparing elements.
|
150
150
|
#
|
151
151
|
# ### Methods for Assigning
|
152
152
|
#
|
153
|
-
# - \#add (aliased as #<<)
|
153
|
+
# - \#add (aliased as #<<):
|
154
154
|
# Adds a given object to the set; returns +self+.
|
155
|
-
# - \#add
|
155
|
+
# - \#add?:
|
156
156
|
# If the given object is not an element in the set,
|
157
157
|
# adds it and returns +self+; otherwise, returns +nil+.
|
158
|
-
# - \#merge
|
158
|
+
# - \#merge:
|
159
159
|
# Adds each given object to the set; returns +self+.
|
160
|
-
# - \#replace
|
160
|
+
# - \#replace:
|
161
161
|
# Replaces the contents of the set with the contents
|
162
162
|
# of a given enumerable.
|
163
163
|
#
|
164
164
|
# ### Methods for Deleting
|
165
165
|
#
|
166
|
-
# - \#clear
|
166
|
+
# - \#clear:
|
167
167
|
# Removes all elements in the set; returns +self+.
|
168
|
-
# - \#delete
|
168
|
+
# - \#delete:
|
169
169
|
# Removes a given object from the set; returns +self+.
|
170
|
-
# - \#delete
|
170
|
+
# - \#delete?:
|
171
171
|
# If the given object is an element in the set,
|
172
172
|
# removes it and returns +self+; otherwise, returns +nil+.
|
173
|
-
# - \#subtract
|
173
|
+
# - \#subtract:
|
174
174
|
# Removes each given object from the set; returns +self+.
|
175
175
|
# - \#delete_if - Removes elements specified by a given block.
|
176
|
-
# - \#select! (aliased as #filter!)
|
176
|
+
# - \#select! (aliased as #filter!):
|
177
177
|
# Removes elements not specified by a given block.
|
178
|
-
# - \#keep_if
|
178
|
+
# - \#keep_if:
|
179
179
|
# Removes elements not specified by a given block.
|
180
180
|
# - \#reject!
|
181
181
|
# Removes elements specified by a given block.
|
182
182
|
#
|
183
183
|
# ### Methods for Converting
|
184
184
|
#
|
185
|
-
# - \#classify
|
185
|
+
# - \#classify:
|
186
186
|
# Returns a hash that classifies the elements,
|
187
187
|
# as determined by the given block.
|
188
|
-
# - \#collect! (aliased as #map!)
|
188
|
+
# - \#collect! (aliased as #map!):
|
189
189
|
# Replaces each element with a block return-value.
|
190
|
-
# - \#divide
|
190
|
+
# - \#divide:
|
191
191
|
# Returns a hash that classifies the elements,
|
192
192
|
# as determined by the given block;
|
193
193
|
# differs from #classify in that the block may accept
|
194
194
|
# either one or two arguments.
|
195
|
-
# - \#flatten
|
195
|
+
# - \#flatten:
|
196
196
|
# Returns a new set that is a recursive flattening of +self+.
|
197
|
-
# \#flatten
|
197
|
+
# \#flatten!:
|
198
198
|
# Replaces each nested set in +self+ with the elements from that set.
|
199
|
-
# - \#inspect (aliased as #to_s)
|
199
|
+
# - \#inspect (aliased as #to_s):
|
200
200
|
# Returns a string displaying the elements.
|
201
|
-
# - \#join
|
201
|
+
# - \#join:
|
202
202
|
# Returns a string containing all elements, converted to strings
|
203
203
|
# as needed, and joined by the given record separator.
|
204
|
-
# - \#to_a
|
204
|
+
# - \#to_a:
|
205
205
|
# Returns an array containing all set elements.
|
206
|
-
# - \#to_set
|
206
|
+
# - \#to_set:
|
207
207
|
# Returns +self+ if given no arguments and no block;
|
208
208
|
# with a block given, returns a new set consisting of block
|
209
209
|
# return values.
|
210
210
|
#
|
211
211
|
# ### Methods for Iterating
|
212
212
|
#
|
213
|
-
# - \#each
|
213
|
+
# - \#each:
|
214
214
|
# Calls the block with each successive element; returns +self+.
|
215
215
|
#
|
216
216
|
# ### Other Methods
|
217
217
|
#
|
218
|
-
# - \#reset
|
218
|
+
# - \#reset:
|
219
219
|
# Resets the internal state; useful if an object
|
220
220
|
# has been modified while an element in the set.
|
221
221
|
#
|
@@ -854,7 +854,7 @@ module Enumerable
|
|
854
854
|
# Needs to `require "set"` to use this method.
|
855
855
|
def to_set(klass = Set, *args, &block)
|
856
856
|
klass.new(self, *args, &block)
|
857
|
-
end
|
857
|
+
end unless method_defined?(:to_set)
|
858
858
|
end
|
859
859
|
|
860
860
|
autoload :SortedSet, "#{__dir__}/set/sorted_set"
|
data/set.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: set
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akinori MUSHA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Provides a class to deal with collections of unordered, unique values
|
14
14
|
email:
|
@@ -17,6 +17,7 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".github/dependabot.yml"
|
20
21
|
- ".github/workflows/test.yml"
|
21
22
|
- ".gitignore"
|
22
23
|
- CHANGELOG.md
|
@@ -36,7 +37,7 @@ licenses:
|
|
36
37
|
metadata:
|
37
38
|
homepage_uri: https://github.com/ruby/set
|
38
39
|
source_code_uri: https://github.com/ruby/set
|
39
|
-
changelog_uri: https://github.com/ruby/set/blob/v1.0.
|
40
|
+
changelog_uri: https://github.com/ruby/set/blob/v1.0.3/CHANGELOG.md
|
40
41
|
post_install_message:
|
41
42
|
rdoc_options: []
|
42
43
|
require_paths:
|
@@ -52,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
53
|
- !ruby/object:Gem::Version
|
53
54
|
version: '0'
|
54
55
|
requirements: []
|
55
|
-
rubygems_version: 3.
|
56
|
+
rubygems_version: 3.4.0.dev
|
56
57
|
signing_key:
|
57
58
|
specification_version: 4
|
58
59
|
summary: Provides a class to deal with collections of unordered, unique values
|