Skip to content

Commit 799ea5f

Browse files
authored
Merge pull request #326 from Shopify/drop-ruby-2.4
2 parents d97830e + 289822a commit 799ea5f

6 files changed

Lines changed: 5 additions & 19 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu, macos, windows]
18-
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
18+
ruby: ['2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
1919
runs-on: ${{ matrix.os }}-latest
2020
steps:
2121
- uses: actions/checkout@v2

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# versions of RuboCop, may require this file to be generated again.
77

88
AllCops:
9-
TargetRubyVersion: 2.4
9+
TargetRubyVersion: 2.5
1010

1111
# Offense count: 3
1212
Lint/AmbiguousOperator:

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Require Ruby 2.5+.
2+
13
2023-03-03 1.6.1:
24

35
* Undefine `#clone` and `#dup` on `MessagePack::Buffer`, `MessagePack::Packer` and `MessagePack::Unpacker`.

ext/msgpack/buffer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,6 @@ static inline VALUE msgpack_buffer_read_top_as_string(msgpack_buffer_t* b, size_
473473
result = rb_str_new(b->read_buffer, length);
474474
}
475475

476-
#if STR_UMINUS_DEDUPE
477476
if (will_be_frozen) {
478477
#if STR_UMINUS_DEDUPE_FROZEN
479478
// Starting from MRI 2.8 it is preferable to freeze the string
@@ -485,7 +484,6 @@ static inline VALUE msgpack_buffer_read_top_as_string(msgpack_buffer_t* b, size_
485484
// frozen.
486485
result = rb_funcall(result, s_uminus, 0);
487486
}
488-
#endif // STR_UMINUS_DEDUPE
489487
_msgpack_buffer_consumed(b, length);
490488
return result;
491489

ext/msgpack/extconf.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,6 @@
2828
$CFLAGS << ' -DHASH_ASET_DEDUPE=0 '
2929
end
3030

31-
32-
# checking if String#-@ (str_uminus) dedupes... ' (Ruby 2.5+)
33-
begin
34-
a = -(%w(t e s t).join)
35-
b = -(%w(t e s t).join)
36-
if a.equal?(b)
37-
$CFLAGS << ' -DSTR_UMINUS_DEDUPE=1 '
38-
else
39-
$CFLAGS += ' -DSTR_UMINUS_DEDUPE=0 '
40-
end
41-
rescue NoMethodError
42-
$CFLAGS << ' -DSTR_UMINUS_DEDUPE=0 '
43-
end
44-
4531
# checking if String#-@ (str_uminus) directly interns frozen strings... ' (Ruby 3.0+)
4632
begin
4733
s = rand.to_s.freeze

msgpack.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
2121
s.extensions = ["ext/msgpack/extconf.rb"]
2222
end
2323

24-
s.required_ruby_version = ">= 2.4"
24+
s.required_ruby_version = ">= 2.5"
2525

2626
s.add_development_dependency 'bundler'
2727
s.add_development_dependency 'rake'

0 commit comments

Comments
 (0)