put 0.0.2 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 946be21b2839e39c50fccfc55683ec69b8aa1d888a4030cd93aa3ff59f17ff18
4
- data.tar.gz: 9cd544f2130f11a1285eaeeaff6b695ac3ca80513b721783836a4d7526b70178
3
+ metadata.gz: 535145ee17f2f25a68d80ed7afa1e58cb2edd1d261c2b0f976cd9706c4304049
4
+ data.tar.gz: 4551a7ac241dc9d0b6fc7b975ae0a7d10c87b1dadf35c3832128ecaf563b1b2d
5
5
  SHA512:
6
- metadata.gz: 057e1c3b3b7bcb4b8b79e9a98ec132f1c9d6faa03defb3095ae0d2fa5eaeed7b74e3d39d8bda3ab280d8b594e492b493008d1711349d1a11ddea6c1e95802eee
7
- data.tar.gz: 2d093be68e236968499608dbd183ffbd99e7664cb6d3a929e0f15bbc904a0f86905a187f2f0046902bab0b055c5dd29399d1cf53a684e36f12a2e19e4bbcdf4b
6
+ metadata.gz: 7cd640fd7da59ca4ad28472284addf6df5db063dba76a1e98f9de4c44e6a243818f8366f1b79ebc345010e0cfc454c5a03c7030449710967f945f9504419937c
7
+ data.tar.gz: e8217fdfbe3fb805bd31bc5632c227c2b9265fc176004a94b41943c33a8b24b06399868026fdb8e8098e4c32162db4a4ff03006a9db7668675af8ac04615bde5
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
- ## [Unreleased]
1
+ ## [0.2.0] - 2026-09-22
2
+
3
+ - **[Breaking]** Drop support for Ruby 2.6; require Ruby >= 3.1
4
+
5
+ ## [0.1.0] - 2022-09-22
6
+
7
+ - Add Put.nils_first, Put.nils_last
8
+ - Add Put.anywhere
2
9
 
3
10
  ## [0.0.2] - 2022-09-21
4
11
 
data/Gemfile CHANGED
@@ -4,5 +4,10 @@ gemspec
4
4
 
5
5
  gem "debug"
6
6
  gem "rake"
7
- gem "minitest"
7
+ gem "minitest", "< 6"
8
+ gem "parallel", "< 2"
8
9
  gem "standard"
10
+ gem "ostruct"
11
+ gem "fiddle"
12
+ gem "racc"
13
+ gem "base64"
data/Gemfile.lock CHANGED
@@ -1,58 +1,85 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- put (0.0.2)
4
+ put (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.2)
9
+ ast (2.4.3)
10
+ base64 (0.3.0)
10
11
  debug (1.6.2)
11
12
  irb (>= 1.3.6)
12
13
  reline (>= 0.3.1)
14
+ fiddle (1.1.8)
13
15
  io-console (0.5.11)
14
16
  irb (1.4.1)
15
17
  reline (>= 0.3.0)
16
- json (2.6.2)
17
- minitest (5.16.3)
18
- parallel (1.22.1)
19
- parser (3.1.2.1)
18
+ json (2.21.2)
19
+ language_server-protocol (3.17.0.6)
20
+ lint_roller (1.1.0)
21
+ minitest (5.27.0)
22
+ ostruct (0.6.3)
23
+ parallel (1.28.0)
24
+ parser (3.3.12.0)
20
25
  ast (~> 2.4.1)
26
+ racc
27
+ prism (1.9.0)
28
+ racc (1.8.1)
21
29
  rainbow (3.1.1)
22
30
  rake (13.0.6)
23
- regexp_parser (2.5.0)
31
+ regexp_parser (2.13.0)
24
32
  reline (0.3.1)
25
33
  io-console (~> 0.5)
26
- rexml (3.2.5)
27
- rubocop (1.35.1)
34
+ rubocop (1.88.2)
28
35
  json (~> 2.3)
29
- parallel (~> 1.10)
30
- parser (>= 3.1.2.1)
36
+ language_server-protocol (~> 3.17.0.2)
37
+ lint_roller (~> 1.1.0)
38
+ parallel (>= 1.10)
39
+ parser (>= 3.3.0.2)
31
40
  rainbow (>= 2.2.2, < 4.0)
32
- regexp_parser (>= 1.8, < 3.0)
33
- rexml (>= 3.2.5, < 4.0)
34
- rubocop-ast (>= 1.20.1, < 2.0)
41
+ regexp_parser (>= 2.9.3, < 3.0)
42
+ rubocop-ast (>= 1.49.0, < 2.0)
35
43
  ruby-progressbar (~> 1.7)
36
- unicode-display_width (>= 1.4.0, < 3.0)
37
- rubocop-ast (1.21.0)
38
- parser (>= 3.1.1.0)
39
- rubocop-performance (1.14.3)
40
- rubocop (>= 1.7.0, < 2.0)
41
- rubocop-ast (>= 0.4.0)
42
- ruby-progressbar (1.11.0)
43
- standard (1.16.1)
44
- rubocop (= 1.35.1)
45
- rubocop-performance (= 1.14.3)
46
- unicode-display_width (2.3.0)
44
+ unicode-display_width (>= 2.4.0, < 4.0)
45
+ rubocop-ast (1.50.0)
46
+ parser (>= 3.3.7.2)
47
+ prism (~> 1.7)
48
+ rubocop-performance (1.26.1)
49
+ lint_roller (~> 1.1)
50
+ rubocop (>= 1.75.0, < 2.0)
51
+ rubocop-ast (>= 1.47.1, < 2.0)
52
+ ruby-progressbar (1.13.0)
53
+ standard (1.56.0)
54
+ language_server-protocol (~> 3.17.0.2)
55
+ lint_roller (~> 1.0)
56
+ rubocop (~> 1.88.0)
57
+ standard-custom (~> 1.0.0)
58
+ standard-performance (~> 1.8)
59
+ standard-custom (1.0.2)
60
+ lint_roller (~> 1.0)
61
+ rubocop (~> 1.50)
62
+ standard-performance (1.9.0)
63
+ lint_roller (~> 1.1)
64
+ rubocop-performance (~> 1.26.0)
65
+ unicode-display_width (3.3.0)
66
+ unicode-emoji (~> 4.3)
67
+ unicode-emoji (4.3.0)
47
68
 
48
69
  PLATFORMS
49
70
  arm64-darwin-21
50
71
  arm64-darwin-22
72
+ x86_64-linux
51
73
 
52
74
  DEPENDENCIES
75
+ base64
53
76
  debug
54
- minitest
77
+ fiddle
78
+ minitest (< 6)
79
+ ostruct
80
+ parallel (< 2)
55
81
  put!
82
+ racc
56
83
  rake
57
84
  standard
58
85
 
data/README.md CHANGED
@@ -1,11 +1,225 @@
1
- # Put
1
+ # Put puts your objects in order 💎
2
2
 
3
- Put helps you put stuff in order when using
4
- [Enumerable#sort_by](https://ruby-doc.org/core-3.1.2/Enumerable.html#method-i-sort_by).
3
+ Put pairs with
4
+ [Enumerable#sort_by](https://ruby-doc.org/core-3.1.2/Enumerable.html#method-i-sort_by)
5
+ to provide a more expressive, fault-tolerant, and configurable approach to
6
+ sorting Ruby objects with multiple criteria. [Here's a screencast & short blog
7
+ post](https://blog.testdouble.com/talks/2022-09-28-a-better-way-to-sort-ruby-objects/)
8
+ that we put out, in case you're interested.
5
9
 
6
- A neat trick when implementing complex sorting rules is to map them to an
7
- array of arrays of comparable elements in priority-order.
10
+ ## Put "put" in your Gemfile
8
11
 
12
+ You've probably already put a few gems in there, so why not put Put, too:
13
+
14
+ ```ruby
15
+ gem "put"
16
+ ```
17
+
18
+ Of course after you push Put, your colleagues will wonder why you put Put there.
19
+
20
+ ## Before you tell me where to put it
21
+
22
+ A neat trick when applying complex sorting rules to a collection is to map them
23
+ to an array of arrays of comparable values in priority order. It's a common
24
+ approach (and a special subtype of what's called a [Schwartzian
25
+ transform](https://en.wikipedia.org/wiki/Schwartzian_transform)), but the
26
+ pattern doesn't have a widely-accepted name yet, so let's use code to explain.
27
+
28
+ Suppose you have some people:
29
+
30
+ ```ruby
31
+ Person = Struct.new(:name, :age, :rubyist?, keyword_init: true)
32
+
33
+ people = [
34
+ Person.new(name: "Tam", age: 22),
35
+ Person.new(name: "Zak", age: 33),
36
+ Person.new(name: "Axe", age: 33),
37
+ Person.new(name: "Qin", age: 18, rubyist?: true),
38
+ Person.new(name: "Zoe", age: 28, rubyist?: true)
39
+ ]
40
+ ```
41
+
42
+ And you want to sort these people in the following priority order:
43
+
44
+ 1. Put any Rubyists at the _top_ of the list, as is right and good
45
+ 2. If both are (or are not) Rubyists, break the tie by sorting by age descending
46
+ 3. Finally, break any remaining ties by sorting by name ascending
47
+
48
+ Here's what the aforementioned pattern to accomplish this usually looks like
49
+ using
50
+ [Enumerable#sort_by](https://ruby-doc.org/core-3.1.2/Enumerable.html#method-i-sort_by):
51
+
52
+ ```ruby
53
+ people.sort_by { |person|
54
+ [
55
+ person.rubyist? ? 0 : 1,
56
+ person.age * -1,
57
+ person.name
58
+ ]
59
+ } # => Zoe, Qin, Axe, Zak, Tam
60
+ ```
61
+
62
+ The above will return everyone in the right order. This has a few drawbacks,
63
+ though:
64
+
65
+ * Unless you're already familiar with this pattern that nobody's bothered to
66
+ give a name before, this code isn't very expressive. As a result, each line
67
+ is almost begging for a code comment above it to explain its intent
68
+ * Ternary operators are confusing, especially with predicate methods like
69
+ `rubyist?` and especially when returning [magic
70
+ number](https://en.wikipedia.org/wiki/Magic_number_(programming))'s like `1` and
71
+ `0`.
72
+ * Any `nil` values will result in a bad time. If a person's `age` is nil, you'll
73
+ get "_undefined method '*' for nil:NilClass_" `NoMethodError`
74
+ * Relatedly, if any two items aren't comparable (i.e. `<=>` returns nil), you'll
75
+ be greeted with an inscrutable `ArgumentError` that just says "_comparison of
76
+ Array with Array failed_"
77
+
78
+ Here's the same code example if you put Put in there:
79
+
80
+ ```ruby
81
+ people.sort_by { |person|
82
+ [
83
+ (Put.first if person.rubyist?),
84
+ Put.desc(person.age),
85
+ Put.asc(person.name)
86
+ ]
87
+ } # => Zoe, Qin, Axe, Zak, Tam
88
+ ```
89
+
90
+ The Put gem solves every one of the above issues:
91
+
92
+ * Put's methods have actual names. In fact, let's just call this the "Put
93
+ pattern" while we're at it
94
+ * No ternaries necessary
95
+ * It's quite `nil` friendly
96
+ * It ships with a `Put.debug` method that helps you introspect those
97
+ impenetrable `ArgumentError` messages whenever any two values turn out not to
98
+ be comparable
99
+
100
+ After reading this, your teammates will be glad they put you in charge of
101
+ putting gems like Put in the Gemfile.
102
+
103
+ ## When you Put it that way
104
+
105
+ Put's API is short and sweet. In fact, you've already put up with most of it.
106
+
107
+ ### Put.first
108
+
109
+ When a particular condition indicates an item should go to the top of a list,
110
+ you'll want to designate a position in your mapped `sort_by` arrays to return
111
+ either `Put.first` or `nil`, like this:
112
+
113
+ ```ruby
114
+ [42, 12, 65, 99, 49].sort_by { |n|
115
+ [(Put.first if n.odd?)]
116
+ } # => 65, 99, 49, 42, 12
117
+ ```
118
+
119
+ ### Put.last
120
+
121
+ When a sort criteria should go to the bottom of the list, you can do the same
122
+ sort of conditional expression with `Put.last`:
123
+
124
+ ```ruby
125
+ %w[Jin drinks Gin on Gym day].sort_by { |s|
126
+ [(Put.last unless s.match?(/[A-Z]/))]
127
+ } # => ["Jin", "Gin", "Gym", "drinks", "on", "day"]
128
+ ```
129
+
130
+ ### Put.asc(value, nils_first: false)
131
+
132
+ The `Put.asc` method provides a nil-safe way to sort a value in ascending order:
133
+
134
+ ```ruby
135
+ %w[The quick brown fox].sort_by { |s|
136
+ [Put.asc(s)]
137
+ } # => ["The", "brown", "fox", "quick"]
138
+ ```
139
+
140
+ It also supports an optional `nils_first` keyword argument that defaults to
141
+ false (translation: nils are sorted last by default), which looks like this:
142
+
143
+ ```ruby
144
+ [3, nil, 1, 5].sort_by { |n|
145
+ [Put.asc(n, nils_first: true)]
146
+ } # => [nil, 1, 3, 5]
147
+ ```
148
+
149
+ ### Put.desc(value, nils_first: false)
150
+
151
+ The opposite of `Put.asc` is `Put.desc`, and it works as you might suspect:
152
+
153
+ ```ruby
154
+ %w[Aardvark Zebra].sort_by { |s|
155
+ [Put.desc(s)]
156
+ } # => ["Zebra", "Aardvark"]
157
+ ```
158
+
159
+ And also like `Put.asc`, `Put.desc` has an optional `nils_first` keyword
160
+ argument when you want nils on top:
161
+
162
+ ```ruby
163
+ [1, nil, 2, 3].sort_by { |n|
164
+ [Put.desc(n, nils_first: true)]
165
+ } # => [nil, 3, 2, 1]
166
+ ```
167
+
168
+ ### Put.anywhere
169
+
170
+ You're sorting stuff, so naturally _order matters_. But when building a compound
171
+ `sort_by` expression, order matters less as you add more and more tiebreaking
172
+ criteria. In fact, sometimes shuffling items is the more appropriate than
173
+ leaving things in their original order. Enter `Put.anywhere`, which can be
174
+ called without any argument at any index in the mapped sorting array:
175
+
176
+ ```ruby
177
+ [1, 3, 4, 7, 8, 9].sort_by { |n|
178
+ [
179
+ (Put.first if n.even?),
180
+ Put.anywhere
181
+ ]
182
+ } # => [8, 4, 1, 7, 9, 3]
183
+ ```
184
+
185
+ ### Put.nils_first(value)
186
+
187
+ If you're sorting items and you know some not-comparable `nil` values are going
188
+ to appear, you can put all the nils on top with `Put.nil_first(value)`. Note
189
+ that _unlike_ `Put.asc` and `Put.desc`, it won't actually sort the values—it'll
190
+ just pull all the nils up!
191
+
192
+ ```ruby
193
+ [:fun, :stuff, nil, :here].sort_by { |val|
194
+ [Put.nils_first(val)]
195
+ } # => [nil, :fun, :stuff, :here]
196
+ ```
197
+
198
+ ### Put.nils_last(value)
199
+
200
+ As you might be able to guess, `Put.nils_last` puts the nils last:
201
+
202
+ ```ruby
203
+ [:every, nil, :counts].sort_by { |val|
204
+ [Put.nils_last(val)]
205
+ } # => [:every, :counts, nil]
206
+ ```
207
+
208
+ ### Put.debug(sorting_arrays)
209
+
210
+ If you see "comparison of Array with Array failed" and you don't have any idea
211
+ what is going on, try debugging by changing `sort_by` to `map` and passing it
212
+ to `Put.debug`.
213
+
214
+ For an interactive example of how to debug this issue with `Put.debug`, take a
215
+ look [at this test case](/test/put_test.rb#L53-L98).
216
+
217
+ ## Put your hands together! 👏
218
+
219
+ Many thanks to [Matt Jones](https://github.com/al2o3cr) and [Matthew
220
+ Draper](https://github.com/matthewd) for answering a bunch of obscure questions
221
+ about comparisons in Ruby and implementing the initial prototype, respectively.
222
+ 👏👏👏
9
223
 
10
224
  ## Code of Conduct
11
225
 
@@ -14,4 +228,4 @@ conduct](https://testdouble.com/code-of-conduct) for all community interactions,
14
228
  including (but not limited to) one-on-one communications, public posts/comments,
15
229
  code reviews, pull requests, and GitHub issues. If violations occur, Test Double
16
230
  will take any action they deem appropriate for the infraction, up to and
17
- including blocking a user from the organization's repositories.
231
+ including blocking a user from the organization's repositories.
data/lib/put/debug.rb ADDED
@@ -0,0 +1,45 @@
1
+ module Put
2
+ class Debug
3
+ Result = Struct.new(:success?, :incomparables, keyword_init: true)
4
+ Incomparable = Struct.new(
5
+ :sorting_index, :left, :left_index, :left_value,
6
+ :right, :right_index, :right_value, keyword_init: true
7
+ ) {
8
+ def inspect
9
+ both_puts_things = left.is_a?(PutsThing) && right.is_a?(PutsThing)
10
+ left_desc = (both_puts_things ? left_value : left).inspect
11
+ right_desc = (both_puts_things ? right_value : right).inspect
12
+ "Sorting comparator at index #{sorting_index} failed, because items at indices #{left_index} and #{right_index} were not comparable. Their values were `#{left_desc}' and `#{right_desc}', respectively."
13
+ end
14
+ }
15
+
16
+ def call(sorting_arrays)
17
+ sorting_arrays.sort
18
+ Result.new(success?: true, incomparables: [])
19
+ rescue ArgumentError
20
+ # TODO this is O(n^lol)
21
+ incomparables = sorting_arrays.transpose.map.with_index { |comparables, sorting_index|
22
+ comparables.map.with_index { |comparable, comparable_index|
23
+ comparables.map.with_index { |other, other_index|
24
+ next if comparable_index == other_index
25
+ if (comparable <=> other).nil?
26
+ Incomparable.new(
27
+ sorting_index: sorting_index,
28
+ left: comparable,
29
+ left_index: comparable_index,
30
+ left_value: (comparable.value if comparable.is_a?(PutsThing)),
31
+ right: other,
32
+ right_index: other_index,
33
+ right_value: (other.value if other.is_a?(PutsThing))
34
+ )
35
+ end
36
+ }
37
+ }
38
+ }.flatten.compact.uniq { |inc|
39
+ # Remove dupes where two items are incomparable in both <=> directions:
40
+ [inc.sorting_index] + [inc.left_index, inc.right_index].sort
41
+ }
42
+ Result.new(success?: false, incomparables: incomparables)
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,13 @@
1
+ module Put
2
+ class PutsThing
3
+ class Anywhere < PutsThing
4
+ def initialize(seed)
5
+ @random = seed.nil? ? Random.new : Random.new(seed)
6
+ end
7
+
8
+ def value
9
+ @random.rand
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,6 @@
1
+ module Put
2
+ class PutsThing
3
+ class Ascending < InOrder
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ module Put
2
+ class PutsThing
3
+ class Descending < InOrder
4
+ def reverse?
5
+ true
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Put
2
+ class PutsThing
3
+ class First < PutsThing
4
+ def value
5
+ -Float::INFINITY
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ module Put
2
+ class PutsThing
3
+ class InOrder < PutsThing
4
+ def initialize(value, nils_first:)
5
+ @value = value
6
+ @nils_first = nils_first
7
+ end
8
+
9
+ attr_reader :value
10
+
11
+ def nils_first?
12
+ @nils_first
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,13 @@
1
+ module Put
2
+ class PutsThing
3
+ class Last < PutsThing
4
+ def value
5
+ Float::INFINITY
6
+ end
7
+
8
+ def nils_first?
9
+ true
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ module Put
2
+ class PutsThing
3
+ class NilOrder < PutsThing
4
+ def initialize(value)
5
+ @value = value
6
+ end
7
+
8
+ def value
9
+ if @value.nil?
10
+ nil
11
+ else
12
+ 0
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ module Put
2
+ class PutsThing
3
+ class NilsFirst < NilOrder
4
+ def nils_first?
5
+ true
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Put
2
+ class PutsThing
3
+ class NilsLast < NilOrder
4
+ def nils_first?
5
+ false
6
+ end
7
+ end
8
+ end
9
+ end
@@ -23,43 +23,5 @@ module Put
23
23
  def nils_first?
24
24
  false
25
25
  end
26
-
27
- class First < PutsThing
28
- def value
29
- -Float::INFINITY
30
- end
31
- end
32
-
33
- class Last < PutsThing
34
- def value
35
- Float::INFINITY
36
- end
37
-
38
- def nils_first?
39
- true
40
- end
41
- end
42
-
43
- class InOrder < PutsThing
44
- def initialize(value, nils_first:)
45
- @value = value
46
- @nils_first = nils_first
47
- end
48
-
49
- attr_reader :value
50
-
51
- def nils_first?
52
- @nils_first
53
- end
54
- end
55
-
56
- class Ascending < InOrder
57
- end
58
-
59
- class Descending < InOrder
60
- def reverse?
61
- true
62
- end
63
- end
64
26
  end
65
27
  end
data/lib/put/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Put
2
- VERSION = "0.0.2"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/put.rb CHANGED
@@ -1,6 +1,16 @@
1
+ require_relative "put/debug"
1
2
  require_relative "put/version"
2
3
  require_relative "put/nil_ext"
3
4
  require_relative "put/puts_thing"
5
+ require_relative "put/puts_thing/anywhere"
6
+ require_relative "put/puts_thing/first"
7
+ require_relative "put/puts_thing/last"
8
+ require_relative "put/puts_thing/in_order"
9
+ require_relative "put/puts_thing/ascending"
10
+ require_relative "put/puts_thing/descending"
11
+ require_relative "put/puts_thing/nil_order"
12
+ require_relative "put/puts_thing/nils_first"
13
+ require_relative "put/puts_thing/nils_last"
4
14
 
5
15
  module Put
6
16
  def self.first
@@ -18,4 +28,20 @@ module Put
18
28
  def self.asc(value, nils_first: false)
19
29
  PutsThing::Ascending.new(value, nils_first: nils_first)
20
30
  end
31
+
32
+ def self.nils_first(value)
33
+ PutsThing::NilsFirst.new(value)
34
+ end
35
+
36
+ def self.nils_last(value)
37
+ PutsThing::NilsLast.new(value)
38
+ end
39
+
40
+ def self.anywhere(seed: nil)
41
+ PutsThing::Anywhere.new(seed)
42
+ end
43
+
44
+ def self.debug(sorting_arrays)
45
+ Debug.new.call(sorting_arrays)
46
+ end
21
47
  end
metadata CHANGED
@@ -1,16 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: put
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2022-09-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description:
14
12
  email:
15
13
  - searls@gmail.com
16
14
  executables: []
@@ -25,10 +23,19 @@ files:
25
23
  - README.md
26
24
  - Rakefile
27
25
  - lib/put.rb
26
+ - lib/put/debug.rb
28
27
  - lib/put/nil_ext.rb
29
28
  - lib/put/puts_thing.rb
29
+ - lib/put/puts_thing/anywhere.rb
30
+ - lib/put/puts_thing/ascending.rb
31
+ - lib/put/puts_thing/descending.rb
32
+ - lib/put/puts_thing/first.rb
33
+ - lib/put/puts_thing/in_order.rb
34
+ - lib/put/puts_thing/last.rb
35
+ - lib/put/puts_thing/nil_order.rb
36
+ - lib/put/puts_thing/nils_first.rb
37
+ - lib/put/puts_thing/nils_last.rb
30
38
  - lib/put/version.rb
31
- - put.gemspec
32
39
  - sig/put.rbs
33
40
  homepage: https://github.com/testdouble/put
34
41
  licenses:
@@ -37,7 +44,6 @@ metadata:
37
44
  homepage_uri: https://github.com/testdouble/put
38
45
  source_code_uri: https://github.com/testdouble/put
39
46
  changelog_uri: https://github.com/testdouble/put/blob/main/CHANGELOG.md
40
- post_install_message:
41
47
  rdoc_options: []
42
48
  require_paths:
43
49
  - lib
@@ -45,15 +51,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
45
51
  requirements:
46
52
  - - ">="
47
53
  - !ruby/object:Gem::Version
48
- version: 2.6.0
54
+ version: 3.1.0
49
55
  required_rubygems_version: !ruby/object:Gem::Requirement
50
56
  requirements:
51
57
  - - ">="
52
58
  - !ruby/object:Gem::Version
53
59
  version: '0'
54
60
  requirements: []
55
- rubygems_version: 3.3.7
56
- signing_key:
61
+ rubygems_version: 4.0.21
57
62
  specification_version: 4
58
63
  summary: Put helps you write prioritized, multi-variate sort_by blocks
59
64
  test_files: []
data/put.gemspec DELETED
@@ -1,28 +0,0 @@
1
- require_relative "lib/put/version"
2
-
3
- Gem::Specification.new do |spec|
4
- spec.name = "put"
5
- spec.version = Put::VERSION
6
- spec.authors = ["Justin Searls"]
7
- spec.email = ["searls@gmail.com"]
8
-
9
- spec.summary = "Put helps you write prioritized, multi-variate sort_by blocks"
10
- spec.homepage = "https://github.com/testdouble/put"
11
- spec.license = "MIT"
12
- spec.required_ruby_version = ">= 2.6.0"
13
-
14
- spec.metadata["homepage_uri"] = spec.homepage
15
- spec.metadata["source_code_uri"] = spec.homepage
16
- spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
17
-
18
- # Specify which files should be added to the gem when it is released.
19
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
- spec.files = Dir.chdir(__dir__) do
21
- `git ls-files -z`.split("\x0").reject do |f|
22
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
23
- end
24
- end
25
- spec.bindir = "exe"
26
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
27
- spec.require_paths = ["lib"]
28
- end