Skip to content

Commit a31f2da

Browse files
authored
Merge pull request #334 from rubyworks/claude/github-connector-capabilities-4qcre6
Give every deprecation a removal date of 2027-09-30
2 parents d59ba78 + 40a1556 commit a31f2da

44 files changed

Lines changed: 106 additions & 52 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎HISTORY.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ Changes:
3939
`Enumerable#uniq_by`, `Kernel#silence_stream` and Facets' fallback
4040
`Time#to_time` are scheduled for removal after 2027-09-30. Each warns
4141
with its replacement and the removal date.
42+
* Every existing deprecation now names a removal date, 2027-09-30, in its
43+
`@deprecated` note and its warning. `String#upper_camelcase`/
44+
`#lower_camelcase`, `Kernel#equate?`, `facets/kernel/tee` and
45+
`Interval#each(n, d)` were deprecated in docs only (or "will be") and
46+
now warn as well.
4247
* `Kernel#with` is deprecated in favor of `instance_eval`, also for removal
4348
after 2027-09-30. Rails 7.1's unrelated `Object#with` (which temporarily
4449
sets attributes) was silently replaced by it when both were loaded.

‎lib/core/facets/array/nonuniq.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ class Array
1111
# CREDIT: Martin DeMello
1212

1313
def nonuniq
14-
warn "Array#nonuniq is deprecated. Use Array#duplicates instead.", uplevel: 1
14+
warn "Array#nonuniq is deprecated. Use Array#duplicates instead. It will be removed after 2027-09-30.", uplevel: 1
1515
duplicates
1616
end
1717

1818
# Same as `#nonuniq` but acts in place.
1919

2020
def nonuniq!
21-
warn "Array#nonuniq! is deprecated. Use Array#duplicates instead.", uplevel: 1
21+
warn "Array#nonuniq! is deprecated. Use Array#duplicates instead. It will be removed after 2027-09-30.", uplevel: 1
2222
self.replace(duplicates)
2323
end
2424

‎lib/core/facets/array/standard_deviation.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def stddev
2020
alias sd stddev
2121

2222
def standard_deviation
23-
warn "Array#standard_deviation is deprecated. Use Array#stddev or Array#sd instead.", uplevel: 1
23+
warn "Array#standard_deviation is deprecated. Use Array#stddev or Array#sd instead. It will be removed after 2027-09-30.", uplevel: 1
2424
stddev
2525
end
2626
end

‎lib/core/facets/binding/self.rb‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
class Binding
22

33
# @deprecated Use Binding#receiver instead (built-in since Ruby 2.6).
4+
# Scheduled for removal after 2027-09-30.
45
def self
5-
warn "Binding#self is deprecated. Use Binding#receiver instead.", uplevel: 1
6+
warn "Binding#self is deprecated. Use Binding#receiver instead. It will be removed after 2027-09-30.", uplevel: 1
67
receiver
78
end
89

‎lib/core/facets/comparable/clip.rb‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
module Comparable
22

33
# @deprecated Use Comparable#clamp instead (built-in since Ruby 2.4).
4+
# Scheduled for removal after 2027-09-30.
45
def clip(lower, upper=nil)
5-
warn "Comparable#clip is deprecated. Use Comparable#clamp instead.", uplevel: 1
6+
warn "Comparable#clip is deprecated. Use Comparable#clamp instead. It will be removed after 2027-09-30.", uplevel: 1
67
upper ? clamp(lower, upper) : clamp(lower..)
78
end
89

‎lib/core/facets/dir/recurse.rb‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ class Dir
66
# yielding each one to the block if given.
77
#
88
# @deprecated Use Dir.find or Find.find instead.
9+
# Scheduled for removal after 2027-09-30.
910
def self.recurse(path='.', &block)
10-
warn "Dir.recurse is deprecated. Use Dir.find or Find.find instead.", uplevel: 1
11+
warn "Dir.recurse is deprecated. Use Dir.find or Find.find instead. It will be removed after 2027-09-30.", uplevel: 1
1112
recurse_entries(path, &block)
1213
end
1314

1415
# @deprecated Use Dir.find or Find.find instead.
16+
# Scheduled for removal after 2027-09-30.
1517
def self.ls_r(path='.', &block)
16-
warn "Dir.ls_r is deprecated. Use Dir.find or Find.find instead.", uplevel: 1
18+
warn "Dir.ls_r is deprecated. Use Dir.find or Find.find instead. It will be removed after 2027-09-30.", uplevel: 1
1719
recurse_entries(path, &block)
1820
end
1921

‎lib/core/facets/enumerable/compact_map.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Enumerable
1515
# does almost the same thing and enum.map{}.compact works too.
1616

1717
def compact_map(&block)
18-
warn "Enumerable#compact_map is deprecated. Use Enumerable#filter_map instead.", uplevel: 1
18+
warn "Enumerable#compact_map is deprecated. Use Enumerable#filter_map instead. It will be removed after 2027-09-30.", uplevel: 1
1919
filter_map(&block)
2020
end
2121

‎lib/core/facets/enumerable/defer.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module Enumerable
2727
# to output each result and discard it.
2828
#
2929
def defer(&blk)
30-
warn "Enumerable#defer is deprecated. Use Enumerable#lazy instead.", uplevel: 1
30+
warn "Enumerable#defer is deprecated. Use Enumerable#lazy instead. It will be removed after 2027-09-30.", uplevel: 1
3131
lazy
3232
end
3333

‎lib/core/facets/enumerable/frequency.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Enumerable
1616
#++
1717

1818
def frequency
19-
warn "Enumerable#frequency is deprecated. Use Enumerable#tally instead.", uplevel: 1
19+
warn "Enumerable#frequency is deprecated. Use Enumerable#tally instead. It will be removed after 2027-09-30.", uplevel: 1
2020
tally
2121
end
2222

‎lib/core/facets/enumerable/hashify.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ module Enumerable
3939

4040
def hashify(val=nil, &block)
4141
if val
42-
warn "The old Enumerable#hashify method has been be deprecated. Use #value_by instead."
42+
warn "The old Enumerable#hashify method is deprecated. Use #value_by instead. It will be removed after 2027-09-30.", uplevel: 1
4343
value_by{ val }
4444
end
4545

4646
if block
47-
warn "The old Enumerable#hashify method has been be deprecated. Use #value_by instead."
47+
warn "The old Enumerable#hashify method is deprecated. Use #value_by instead. It will be removed after 2027-09-30.", uplevel: 1
4848
value_by(&block)
4949
end
5050

0 commit comments

Comments
 (0)