Skip to content

Commit 91fd0fa

Browse files
authored
Merge pull request #60 from maxmind/horgh/ruby-version
Test on Ruby 3.1
2 parents e286975 + 78f653f commit 91fd0fa

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

.github/workflows/rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ jobs:
77
- uses: actions/checkout@v2
88
- uses: ruby/setup-ruby@v1
99
with:
10-
ruby-version: 3.0
10+
ruby-version: 3.1
1111
- run: bundle install
1212
- run: bundle exec rake -t rubocop

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
2.5,
1313
2.6,
1414
2.7,
15-
3.0,
15+
'3.0',
16+
3.1,
1617
jruby,
1718
]
1819
exclude:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This library uses [Semantic Versioning](https://semver.org/).
5757

5858
## Copyright and License
5959

60-
This software is Copyright (c) 2018 - 2020 by MaxMind, Inc.
60+
This software is Copyright (c) 2018 - 2021 by MaxMind, Inc.
6161

6262
This is free software, licensed under the [Apache License, Version
6363
2.0](LICENSE-APACHE) or the [MIT License](LICENSE-MIT), at your option.

lib/maxmind/db.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def find_address_in_tree(ip_address, ip_version)
200200
break if depth >= bit_count || node >= node_count
201201

202202
c = packed[depth >> 3].ord
203-
bit = 1 & (c >> 7 - (depth % 8))
203+
bit = 1 & (c >> (7 - (depth % 8)))
204204
node = read_node(node, bit)
205205
depth += 1
206206
end

maxmind-db.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
1717
'documentation_uri' => 'https://www.rubydoc.info/gems/maxmind-db',
1818
'homepage_uri' => 'https://github.com/maxmind/MaxMind-DB-Reader-ruby',
1919
'source_code_uri' => 'https://github.com/maxmind/MaxMind-DB-Reader-ruby',
20+
'rubygems_mfa_required' => 'true',
2021
}
2122
s.required_ruby_version = '>= 2.5.0'
2223

test/data

Submodule data updated 41 files

test/test_decoder.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ def test_pointer
150150
"\x34\x35\x36\x37\x38\x39\x30\x31\x32\x33\x34".b +
151151
"\x35\x36\x37\x38\x39\x30\x31\x32\x33\x34\x35".b +
152152
"\x36\x37\x38\x39\x30".b => '123456789012345678901234567890',
153-
"\x5e\x00\xd7".b + "\x78".b * 500 => 'x' * 500,
154-
"\x5e\x06\xb3".b + "\x78".b * 2000 => 'x' * 2000,
155-
"\x5f\x00\x10\x53".b + "\x78".b * 70_000 => 'x' * 70_000,
153+
"\x5e\x00\xd7".b + ("\x78".b * 500) => 'x' * 500,
154+
"\x5e\x06\xb3".b + ("\x78".b * 2000) => 'x' * 2000,
155+
"\x5f\x00\x10\x53".b + ("\x78".b * 70_000) => 'x' * 70_000,
156156
}
157157
# rubocop:enable Style/ClassVars
158158

@@ -194,9 +194,9 @@ def generate_large_uint(bits)
194194
"\x02".b + ctrl_byte + "\x01\xf4".b => 500,
195195
"\x02".b + ctrl_byte + "\x2a\x78".b => 10_872,
196196
}
197-
(bits / 8 + 1).times do |power|
198-
expected = 2**(8 * power) - 1
199-
input = [power].pack('C') + ctrl_byte + "\xff".b * power
197+
((bits / 8) + 1).times do |power|
198+
expected = (2**(8 * power)) - 1
199+
input = [power].pack('C') + ctrl_byte + ("\xff".b * power)
200200
uints[input] = expected
201201
end
202202
uints

0 commit comments

Comments
 (0)