ip_to_country 0.1.0 → 0.2.0

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.
@@ -6,23 +6,23 @@ require 'test_helper'
6
6
  class RequestTest < Test::Unit::TestCase
7
7
  class MockRequest
8
8
  include IpToCountry::Request
9
- attr_accessor :env, :ip
9
+ attr_accessor :env, :remote_ip
10
10
  def initialize(env={}, ip="")
11
11
  @env = env
12
- @ip = ip
12
+ @remote_ip = ip
13
13
  end
14
14
  end
15
-
15
+
16
16
  def test_http_x_real_ip
17
17
  req = MockRequest.new({"HTTP_X_REAL_IP" => "192.168.1.2"})
18
18
  assert req.geoip.is_a?(IpToCountry::Geoip)
19
19
  end
20
-
20
+
21
21
  def test_http_x_forwarded_for_without_proxy
22
22
  req = MockRequest.new({"HTTP_X_FORWARDED_FOR" => "192.168.1.2"})
23
23
  assert req.geoip.is_a?(IpToCountry::Geoip)
24
24
  end
25
-
25
+
26
26
  def test_http_x_forwarded_for_with_proxy
27
27
  req = MockRequest.new({"HTTP_X_FORWARDED_FOR" => "192.168.1.2, 192.168.1.7"})
28
28
  assert req.geoip.is_a?(IpToCountry::Geoip)
@@ -1,15 +1,16 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
3
+ require 'coveralls'
4
+ Coveralls.wear!
5
+
2
6
  # Configure Rails Environment
3
7
  ENV["RAILS_ENV"] = "test"
4
8
 
5
9
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
6
10
  require "rails/test_help"
7
11
  require "simplecov"
8
- require 'coveralls'
9
12
  require "mocha/setup"
10
13
 
11
- Coveralls.wear!
12
-
13
14
  Rails.backtrace_cleaner.remove_silencers!
14
15
 
15
16
  # Run any available migration
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ip_to_country
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Pochet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-21 00:00:00.000000000 Z
11
+ date: 2014-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -39,55 +39,55 @@ extensions: []
39
39
  extra_rdoc_files: []
40
40
  files:
41
41
  - app/models/ip_to_country/geoip.rb
42
- - lib/ip_to_country/engine.rb
43
- - lib/ip_to_country/loader.rb
44
42
  - lib/ip_to_country/version.rb
43
+ - lib/ip_to_country/loader.rb
44
+ - lib/ip_to_country/engine.rb
45
45
  - lib/ip_to_country/request.rb
46
- - lib/ip_to_country.rb
46
+ - lib/tasks/ip_to_country.rake
47
47
  - lib/generators/geoip/geoip_generator.rb
48
48
  - lib/generators/geoip/templates/migration.rb
49
- - lib/tasks/ip_to_country.rake
49
+ - lib/ip_to_country.rb
50
50
  - MIT-LICENSE
51
51
  - Rakefile
52
52
  - README.md
53
- - test/ip_to_country_test.rb
54
53
  - test/loader_test.rb
55
- - test/geoip_test.rb
56
- - test/test_helper.rb
54
+ - test/request_test.rb
55
+ - test/ip_to_country_test.rb
57
56
  - test/fixtures/geoips.yml
58
57
  - test/fixtures/ips/test_ips.csv
59
58
  - test/fixtures/ips/test_ips.zip
60
- - test/request_test.rb
61
- - test/dummy/log/test.log
62
- - test/dummy/script/rails
63
- - test/dummy/public/favicon.ico
59
+ - test/geoip_test.rb
60
+ - test/dummy/app/views/layouts/application.html.erb
61
+ - test/dummy/app/controllers/application_controller.rb
62
+ - test/dummy/app/helpers/application_helper.rb
63
+ - test/dummy/app/assets/javascripts/application.js
64
+ - test/dummy/app/assets/stylesheets/application.css
65
+ - test/dummy/README.rdoc
66
+ - test/dummy/config.ru
64
67
  - test/dummy/public/500.html
65
- - test/dummy/public/422.html
66
68
  - test/dummy/public/404.html
67
- - test/dummy/config/application.rb
68
- - test/dummy/config/database.yml
69
- - test/dummy/config/initializers/wrap_parameters.rb
69
+ - test/dummy/public/422.html
70
+ - test/dummy/public/favicon.ico
70
71
  - test/dummy/config/initializers/mime_types.rb
71
72
  - test/dummy/config/initializers/backtrace_silencers.rb
72
- - test/dummy/config/initializers/inflections.rb
73
73
  - test/dummy/config/initializers/session_store.rb
74
+ - test/dummy/config/initializers/inflections.rb
74
75
  - test/dummy/config/initializers/secret_token.rb
75
- - test/dummy/config/locales/en.yml
76
+ - test/dummy/config/initializers/wrap_parameters.rb
77
+ - test/dummy/config/application.rb
76
78
  - test/dummy/config/boot.rb
79
+ - test/dummy/config/locales/en.yml
80
+ - test/dummy/config/database.yml
77
81
  - test/dummy/config/routes.rb
78
82
  - test/dummy/config/environment.rb
79
83
  - test/dummy/config/environments/development.rb
80
84
  - test/dummy/config/environments/test.rb
81
85
  - test/dummy/config/environments/production.rb
82
- - test/dummy/README.rdoc
83
- - test/dummy/app/helpers/application_helper.rb
84
- - test/dummy/app/controllers/application_controller.rb
85
- - test/dummy/app/assets/stylesheets/application.css
86
- - test/dummy/app/assets/javascripts/application.js
87
- - test/dummy/app/views/layouts/application.html.erb
88
- - test/dummy/config.ru
89
- - test/dummy/Rakefile
90
86
  - test/dummy/db/migrate/001_create_geoips.rb
87
+ - test/dummy/Rakefile
88
+ - test/dummy/script/rails
89
+ - test/dummy/log/test.log
90
+ - test/test_helper.rb
91
91
  homepage: https://github.com/vincent-pochet/ip_to_country
92
92
  licenses: []
93
93
  metadata: {}
@@ -107,46 +107,46 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.0.0.rc.2
110
+ rubygems_version: 2.1.11
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Rails extension to get country name or country code from an IP address.
114
114
  test_files:
115
- - test/ip_to_country_test.rb
116
115
  - test/loader_test.rb
117
- - test/geoip_test.rb
118
- - test/test_helper.rb
116
+ - test/request_test.rb
117
+ - test/ip_to_country_test.rb
119
118
  - test/fixtures/geoips.yml
120
119
  - test/fixtures/ips/test_ips.csv
121
120
  - test/fixtures/ips/test_ips.zip
122
- - test/request_test.rb
123
- - test/dummy/log/test.log
124
- - test/dummy/script/rails
125
- - test/dummy/public/favicon.ico
121
+ - test/geoip_test.rb
122
+ - test/dummy/app/views/layouts/application.html.erb
123
+ - test/dummy/app/controllers/application_controller.rb
124
+ - test/dummy/app/helpers/application_helper.rb
125
+ - test/dummy/app/assets/javascripts/application.js
126
+ - test/dummy/app/assets/stylesheets/application.css
127
+ - test/dummy/README.rdoc
128
+ - test/dummy/config.ru
126
129
  - test/dummy/public/500.html
127
- - test/dummy/public/422.html
128
130
  - test/dummy/public/404.html
129
- - test/dummy/config/application.rb
130
- - test/dummy/config/database.yml
131
- - test/dummy/config/initializers/wrap_parameters.rb
131
+ - test/dummy/public/422.html
132
+ - test/dummy/public/favicon.ico
132
133
  - test/dummy/config/initializers/mime_types.rb
133
134
  - test/dummy/config/initializers/backtrace_silencers.rb
134
- - test/dummy/config/initializers/inflections.rb
135
135
  - test/dummy/config/initializers/session_store.rb
136
+ - test/dummy/config/initializers/inflections.rb
136
137
  - test/dummy/config/initializers/secret_token.rb
137
- - test/dummy/config/locales/en.yml
138
+ - test/dummy/config/initializers/wrap_parameters.rb
139
+ - test/dummy/config/application.rb
138
140
  - test/dummy/config/boot.rb
141
+ - test/dummy/config/locales/en.yml
142
+ - test/dummy/config/database.yml
139
143
  - test/dummy/config/routes.rb
140
144
  - test/dummy/config/environment.rb
141
145
  - test/dummy/config/environments/development.rb
142
146
  - test/dummy/config/environments/test.rb
143
147
  - test/dummy/config/environments/production.rb
144
- - test/dummy/README.rdoc
145
- - test/dummy/app/helpers/application_helper.rb
146
- - test/dummy/app/controllers/application_controller.rb
147
- - test/dummy/app/assets/stylesheets/application.css
148
- - test/dummy/app/assets/javascripts/application.js
149
- - test/dummy/app/views/layouts/application.html.erb
150
- - test/dummy/config.ru
151
- - test/dummy/Rakefile
152
148
  - test/dummy/db/migrate/001_create_geoips.rb
149
+ - test/dummy/Rakefile
150
+ - test/dummy/script/rails
151
+ - test/dummy/log/test.log
152
+ - test/test_helper.rb