hive_geoip2 0.1.1 → 0.1.3

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
- SHA1:
3
- metadata.gz: 4d4afa678b6f16d1b3930d2097190ffa062314b5
4
- data.tar.gz: a28800070b21496a1ff4fcac98675de12f08f9c7
2
+ SHA256:
3
+ metadata.gz: 0b348c2c8f75bccacdd82a1b16721519d8b96d39c395b44fb8ff90df15c9b1f0
4
+ data.tar.gz: 21ad1005e09d5b6e14f1c30e0ba7f03a57dce167fc472501132be2e3a5f45a6c
5
5
  SHA512:
6
- metadata.gz: 7fb3f12ad482847d12f730b788a4670567d642c318bba406bd1c915576487ba999c51721fafa91a6ad7e05da3a02e21c76d3cc381a8e1b73b9d1fcf320e08da3
7
- data.tar.gz: a617549a489b8e3895d61c75e46574d4efb80e365de2098c45999c8eea94ece737fad297bd6c35d3ed9924f49a3e05a7f10f2a76afaa1d31ec3cdbf26b1d9983
6
+ metadata.gz: 25a0c7587f29c6b083175fe1af32ef95bccf371d84b768ffeb3e6700f8beb22e3e2b889b513bf1f822110b4ed342cd7a757a08c83907f4119567debc51d60663
7
+ data.tar.gz: 2512935d151ee581c91604695b78c3229386e5ad5cb7a8794bd399b1b4b5b155f8ea889115e974b2e31ad840ba8a0661d4490a9a3a1f3fd8e4dfbe0fd0e831f4
@@ -8,7 +8,7 @@
8
8
  VALUE rb_mHive;
9
9
  VALUE rb_cGeoIP2;
10
10
 
11
- static void guard_parse_data_list(VALUE arg);
11
+ static VALUE guard_parse_data_list(VALUE arg);
12
12
  static MMDB_entry_data_list_s * parse_data_list(
13
13
  MMDB_entry_data_list_s *data_list, VALUE *ret_obj
14
14
  );
@@ -30,10 +30,12 @@ struct args_parse_data_list {
30
30
  VALUE *ret_obj;
31
31
  };
32
32
 
33
- static void guard_parse_data_list(VALUE arg) {
33
+ static VALUE guard_parse_data_list(VALUE arg) {
34
34
  struct args_parse_data_list *args = (struct args_parse_data_list *)arg;
35
35
 
36
36
  parse_data_list(args->data_list, args->ret_obj);
37
+
38
+ return RUBY_Qnil;
37
39
  }
38
40
 
39
41
  static MMDB_entry_data_list_s *
@@ -162,9 +164,12 @@ parse_data_list(MMDB_entry_data_list_s *data_list, VALUE *ret_obj) {
162
164
 
163
165
  size_t size = sizeof(uint64_t);
164
166
  char buf[size * 2 + 1];
165
- uint8_t *data = &data_list->entry_data.uint64;
166
-
167
+ uint8_t *data = (uint8_t *)&data_list->entry_data.uint64;
168
+ #ifdef WORDS_BIGENDIAN
169
+ for (i = 0; i < size; ++i) {
170
+ #else
167
171
  for (i = size - 1; i >= 0; i--) {
172
+ #endif
168
173
  buf[idx++] = hex[data[i] >> 4];
169
174
  buf[idx++] = hex[data[i] & 0x0f];
170
175
  }
@@ -194,9 +199,13 @@ parse_data_list(MMDB_entry_data_list_s *data_list, VALUE *ret_obj) {
194
199
  #else
195
200
  size_t size = sizeof(mmdb_uint128_t);
196
201
  uint8_t buf[size * 2 + 1];
197
- uint8_t *data = &data_list->entry_data.uint128;
202
+ uint8_t *data = (uint8_t *)&data_list->entry_data.uint128;
198
203
 
204
+ #ifdef WORDS_BIGENDIAN
205
+ for (i = 0; i < size; ++i) {
206
+ #else
199
207
  for (i = size - 1; i >= 0; i--) {
208
+ #endif
200
209
  buf[idx++] = hex[data[i] >> 4];
201
210
  buf[idx++] = hex[data[i] & 0x0f];
202
211
  }
data/hive_geoip2.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'hive_geoip2'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.3'
4
4
  s.summary = 'libmaxminddb GeoIP2 Ruby bindings'
5
5
  s.author = 'Maxime Youdine'
6
6
  s.license = 'MIT'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hive_geoip2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxime Youdine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-06 00:00:00.000000000 Z
11
+ date: 2024-04-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -17,10 +17,10 @@ extensions:
17
17
  - ext/hive_geoip2/extconf.rb
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - hive_geoip2.gemspec
21
- - lib/hive_geoip2/hive_geoip2.rb
22
20
  - ext/hive_geoip2/extconf.rb
23
21
  - ext/hive_geoip2/hive_geoip2.c
22
+ - hive_geoip2.gemspec
23
+ - lib/hive_geoip2/hive_geoip2.rb
24
24
  homepage: https://github.com/desuwa/hive_geoip2
25
25
  licenses:
26
26
  - MIT
@@ -31,17 +31,16 @@ require_paths:
31
31
  - lib
32
32
  required_ruby_version: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - '>='
34
+ - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: 1.9.2
37
37
  required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  requirements: []
43
- rubyforge_project:
44
- rubygems_version: 2.0.14
43
+ rubygems_version: 3.0.1
45
44
  signing_key:
46
45
  specification_version: 4
47
46
  summary: libmaxminddb GeoIP2 Ruby bindings