geoip-c 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +2 -1
  2. data/Rakefile +2 -2
  3. data/geoip.c +8 -8
  4. metadata +4 -7
data/README.md CHANGED
@@ -138,9 +138,10 @@ Special appreciation and thanks belongs to Ry Dahl for his initial work on this
138
138
 
139
139
  Many thanks to our contributors:
140
140
 
141
- * Charles Brian Quinn
141
+ * Charles Brian Quinn ([seebq](https://github.com/seebq))
142
142
  * Michael Sheakoski
143
143
  * Silvio Quadri
144
+ * Leonardo Almeida ([leogalmeida](https://github.com/leogalmeida))
144
145
 
145
146
  License
146
147
  -------
data/Rakefile CHANGED
@@ -22,9 +22,9 @@ end
22
22
 
23
23
  spec = Gem::Specification.new do |s|
24
24
  s.name = 'geoip-c'
25
- s.version = "0.7.1"
25
+ s.version = "0.7.2"
26
26
 
27
- s.authors = ['Ryah Dahl', 'Matt Todd', 'Charles Brian Quinn', 'Michael Sheakoski', 'Silvio Quadri']
27
+ s.authors = ['Ryah Dahl', 'Matt Todd']
28
28
  s.email = 'mtodd@highgroove.com'
29
29
 
30
30
  s.summary = "A Binding to the GeoIP C library"
data/geoip.c CHANGED
@@ -77,7 +77,7 @@ static VALUE rb_geoip_database_new(VALUE mGeoIP_Database_Class, int argc, VALUE
77
77
 
78
78
  if(RTEST(check_cache)) flag |= GEOIP_CHECK_CACHE;
79
79
 
80
- if(gi = GeoIP_open(STR2CSTR(filename), flag)) {
80
+ if(gi = GeoIP_open(StringValuePtr(filename), flag)) {
81
81
  database = Data_Wrap_Struct(mGeoIP_Database_Class, 0, GeoIP_delete, gi);
82
82
  rb_obj_call_init(database, 0, 0);
83
83
  } else {
@@ -162,7 +162,7 @@ VALUE rb_geoip_city_look_up(VALUE self, VALUE addr) {
162
162
 
163
163
  Check_Type(addr, T_STRING);
164
164
  Data_Get_Struct(self, GeoIP, gi);
165
- if(record = GeoIP_record_by_addr(gi, STR2CSTR(addr))) {
165
+ if(record = GeoIP_record_by_addr(gi, StringValuePtr(addr))) {
166
166
  hash = rb_city_record_to_hash(record);
167
167
  GeoIPRecord_delete(record);
168
168
  }
@@ -193,7 +193,7 @@ VALUE rb_geoip_country_look_up(VALUE self, VALUE addr) {
193
193
 
194
194
  Check_Type(addr, T_STRING);
195
195
  Data_Get_Struct(self, GeoIP, gi);
196
- country_id = GeoIP_id_by_addr(gi, STR2CSTR(addr));
196
+ country_id = GeoIP_id_by_addr(gi, StringValuePtr(addr));
197
197
  if(country_id < 1) return Qnil;
198
198
 
199
199
  hash = rb_hash_new();
@@ -227,7 +227,7 @@ VALUE rb_geoip_org_look_up(VALUE self, VALUE addr) {
227
227
  GeoIP *gi;
228
228
  Check_Type(addr, T_STRING);
229
229
  Data_Get_Struct(self, GeoIP, gi);
230
- return generic_single_value_lookup_response("name", GeoIP_name_by_addr(gi, STR2CSTR(addr)));
230
+ return generic_single_value_lookup_response("name", GeoIP_name_by_addr(gi, StringValuePtr(addr)));
231
231
  }
232
232
 
233
233
  /* GeoIP::ISP *******************************************************/
@@ -253,7 +253,7 @@ VALUE rb_geoip_isp_look_up(VALUE self, VALUE addr) {
253
253
  GeoIP *gi;
254
254
  Check_Type(addr, T_STRING);
255
255
  Data_Get_Struct(self, GeoIP, gi);
256
- return generic_single_value_lookup_response("isp", GeoIP_name_by_addr(gi, STR2CSTR(addr)));
256
+ return generic_single_value_lookup_response("isp", GeoIP_name_by_addr(gi, StringValuePtr(addr)));
257
257
  }
258
258
 
259
259
  /* GeoIP::NetSpeed *******************************************************/
@@ -279,7 +279,7 @@ VALUE rb_geoip_netspeed_look_up(VALUE self, VALUE addr) {
279
279
  GeoIP *gi;
280
280
  Check_Type(addr, T_STRING);
281
281
  Data_Get_Struct(self, GeoIP, gi);
282
- return generic_single_value_lookup_response("netspeed", GeoIP_name_by_addr(gi, STR2CSTR(addr)));
282
+ return generic_single_value_lookup_response("netspeed", GeoIP_name_by_addr(gi, StringValuePtr(addr)));
283
283
  }
284
284
 
285
285
  /* GeoIP::Domain *******************************************************/
@@ -305,7 +305,7 @@ VALUE rb_geoip_domain_look_up(VALUE self, VALUE addr) {
305
305
  GeoIP *gi;
306
306
  Check_Type(addr, T_STRING);
307
307
  Data_Get_Struct(self, GeoIP, gi);
308
- return generic_single_value_lookup_response("domain", GeoIP_name_by_addr(gi, STR2CSTR(addr)));
308
+ return generic_single_value_lookup_response("domain", GeoIP_name_by_addr(gi, StringValuePtr(addr)));
309
309
  }
310
310
 
311
311
  /* GeoIP *********************************************************************/
@@ -320,7 +320,7 @@ VALUE rb_geoip_domain_look_up(VALUE self, VALUE addr) {
320
320
  */
321
321
  VALUE rb_geoip_addr_to_num(VALUE self, VALUE addr) {
322
322
  Check_Type(addr, T_STRING);
323
- return UINT2NUM((unsigned int)_GeoIP_addr_to_num(STR2CSTR(addr)));
323
+ return UINT2NUM((unsigned int)_GeoIP_addr_to_num(StringValuePtr(addr)));
324
324
  }
325
325
 
326
326
  // Fixes a bug with 64bit architectures where this delcaration doesn't exist
metadata CHANGED
@@ -1,25 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoip-c
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 1
10
- version: 0.7.1
9
+ - 2
10
+ version: 0.7.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryah Dahl
14
14
  - Matt Todd
15
- - Charles Brian Quinn
16
- - Michael Sheakoski
17
- - Silvio Quadri
18
15
  autorequire:
19
16
  bindir: bin
20
17
  cert_chain: []
21
18
 
22
- date: 2011-03-08 00:00:00 -05:00
19
+ date: 2011-03-21 00:00:00 -04:00
23
20
  default_executable:
24
21
  dependencies: []
25
22