ip_to_country 0.0.1

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.
Files changed (45) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +16 -0
  3. data/Rakefile +40 -0
  4. data/app/models/ip_to_country/geoip.rb +34 -0
  5. data/lib/generators/geoip/geoip_generator.rb +23 -0
  6. data/lib/generators/geoip/templates/migration.rb +23 -0
  7. data/lib/ip_to_country.rb +5 -0
  8. data/lib/ip_to_country/engine.rb +5 -0
  9. data/lib/ip_to_country/version.rb +4 -0
  10. data/lib/tasks/ip_to_country_tasks.rake +4 -0
  11. data/test/dummy/README.rdoc +261 -0
  12. data/test/dummy/Rakefile +7 -0
  13. data/test/dummy/app/assets/javascripts/application.js +15 -0
  14. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  15. data/test/dummy/app/controllers/application_controller.rb +4 -0
  16. data/test/dummy/app/helpers/application_helper.rb +3 -0
  17. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  18. data/test/dummy/config.ru +4 -0
  19. data/test/dummy/config/application.rb +60 -0
  20. data/test/dummy/config/boot.rb +11 -0
  21. data/test/dummy/config/database.yml +4 -0
  22. data/test/dummy/config/environment.rb +6 -0
  23. data/test/dummy/config/environments/development.rb +38 -0
  24. data/test/dummy/config/environments/production.rb +68 -0
  25. data/test/dummy/config/environments/test.rb +38 -0
  26. data/test/dummy/config/initializers/backtrace_silencers.rb +8 -0
  27. data/test/dummy/config/initializers/inflections.rb +16 -0
  28. data/test/dummy/config/initializers/mime_types.rb +6 -0
  29. data/test/dummy/config/initializers/secret_token.rb +8 -0
  30. data/test/dummy/config/initializers/session_store.rb +9 -0
  31. data/test/dummy/config/initializers/wrap_parameters.rb +15 -0
  32. data/test/dummy/config/locales/en.yml +5 -0
  33. data/test/dummy/config/routes.rb +5 -0
  34. data/test/dummy/db/migrate/001_create_geoips.rb +23 -0
  35. data/test/dummy/log/test.log +322 -0
  36. data/test/dummy/public/404.html +26 -0
  37. data/test/dummy/public/422.html +26 -0
  38. data/test/dummy/public/500.html +25 -0
  39. data/test/dummy/public/favicon.ico +0 -0
  40. data/test/dummy/script/rails +6 -0
  41. data/test/fixtures/geoips.yml +7 -0
  42. data/test/geoip_test.rb +17 -0
  43. data/test/ip_to_country_test.rb +8 -0
  44. data/test/test_helper.rb +28 -0
  45. metadata +145 -0
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,4 @@
1
+ # -*- encoding : utf-8 -*-
2
+ class ApplicationController < ActionController::Base
3
+ protect_from_forgery
4
+ end
@@ -0,0 +1,3 @@
1
+ # -*- encoding : utf-8 -*-
2
+ module ApplicationHelper
3
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,60 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require File.expand_path('../boot', __FILE__)
3
+
4
+ require 'rails/all'
5
+
6
+ Bundler.require
7
+ require "ip_to_country"
8
+
9
+ module Dummy
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Custom directories with classes and modules you want to be autoloadable.
16
+ # config.autoload_paths += %W(#{config.root}/extras)
17
+
18
+ # Only load the plugins named here, in the order given (default is alphabetical).
19
+ # :all can be used as a placeholder for all plugins not explicitly named.
20
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
21
+
22
+ # Activate observers that should always be running.
23
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
24
+
25
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27
+ # config.time_zone = 'Central Time (US & Canada)'
28
+
29
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
+ # config.i18n.default_locale = :de
32
+
33
+ # Configure the default encoding used in templates for Ruby 1.9.
34
+ config.encoding = "utf-8"
35
+
36
+ # Configure sensitive parameters which will be filtered from the log file.
37
+ config.filter_parameters += [:password]
38
+
39
+ # Enable escaping HTML in JSON.
40
+ config.active_support.escape_html_entities_in_json = true
41
+
42
+ # Use SQL instead of Active Record's schema dumper when creating the database.
43
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
44
+ # like if you have constraints or database-specific column types
45
+ # config.active_record.schema_format = :sql
46
+
47
+ # Enforce whitelist mode for mass assignment.
48
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
49
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
50
+ # parameters by using an attr_accessible or attr_protected declaration.
51
+ config.active_record.whitelist_attributes = false
52
+
53
+ # Enable the asset pipeline
54
+ config.assets.enabled = true
55
+
56
+ # Version of your assets, change this if you want to expire all your assets
57
+ config.assets.version = '1.0'
58
+ end
59
+ end
60
+
@@ -0,0 +1,11 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'rubygems'
3
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
4
+
5
+ if File.exist?(gemfile)
6
+ ENV['BUNDLE_GEMFILE'] = gemfile
7
+ require 'bundler'
8
+ Bundler.setup
9
+ end
10
+
11
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,4 @@
1
+ test:
2
+ adapter: postgresql
3
+ database: ip_to_country_test
4
+ username: postgres
@@ -0,0 +1,6 @@
1
+ # -*- encoding : utf-8 -*-
2
+ # Load the rails application
3
+ require File.expand_path('../application', __FILE__)
4
+
5
+ # Initialize the rails application
6
+ Dummy::Application.initialize!
@@ -0,0 +1,38 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Dummy::Application.configure do
3
+ # Settings specified here will take precedence over those in config/application.rb
4
+
5
+ # In the development environment your application's code is reloaded on
6
+ # every request. This slows down response time but is perfect for development
7
+ # since you don't have to restart the web server when you make code changes.
8
+ config.cache_classes = false
9
+
10
+ # Log error messages when you accidentally call methods on nil.
11
+ config.whiny_nils = true
12
+
13
+ # Show full error reports and disable caching
14
+ config.consider_all_requests_local = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Don't care if the mailer can't send
18
+ config.action_mailer.raise_delivery_errors = false
19
+
20
+ # Print deprecation notices to the Rails logger
21
+ config.active_support.deprecation = :log
22
+
23
+ # Only use best-standards-support built into browsers
24
+ config.action_dispatch.best_standards_support = :builtin
25
+
26
+ # Raise exception on mass assignment protection for Active Record models
27
+ config.active_record.mass_assignment_sanitizer = :strict
28
+
29
+ # Log the query plan for queries taking more than this (works
30
+ # with SQLite, MySQL, and PostgreSQL)
31
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
32
+
33
+ # Do not compress assets
34
+ config.assets.compress = false
35
+
36
+ # Expands the lines which load the assets
37
+ config.assets.debug = true
38
+ end
@@ -0,0 +1,68 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Dummy::Application.configure do
3
+ # Settings specified here will take precedence over those in config/application.rb
4
+
5
+ # Code is not reloaded between requests
6
+ config.cache_classes = true
7
+
8
+ # Full error reports are disabled and caching is turned on
9
+ config.consider_all_requests_local = false
10
+ config.action_controller.perform_caching = true
11
+
12
+ # Disable Rails's static asset server (Apache or nginx will already do this)
13
+ config.serve_static_assets = false
14
+
15
+ # Compress JavaScripts and CSS
16
+ config.assets.compress = true
17
+
18
+ # Don't fallback to assets pipeline if a precompiled asset is missed
19
+ config.assets.compile = false
20
+
21
+ # Generate digests for assets URLs
22
+ config.assets.digest = true
23
+
24
+ # Defaults to nil and saved in location specified by config.assets.prefix
25
+ # config.assets.manifest = YOUR_PATH
26
+
27
+ # Specifies the header that your server uses for sending files
28
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
29
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
30
+
31
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
32
+ # config.force_ssl = true
33
+
34
+ # See everything in the log (default is :info)
35
+ # config.log_level = :debug
36
+
37
+ # Prepend all log lines with the following tags
38
+ # config.log_tags = [ :subdomain, :uuid ]
39
+
40
+ # Use a different logger for distributed setups
41
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
42
+
43
+ # Use a different cache store in production
44
+ # config.cache_store = :mem_cache_store
45
+
46
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
47
+ # config.action_controller.asset_host = "http://assets.example.com"
48
+
49
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
50
+ # config.assets.precompile += %w( search.js )
51
+
52
+ # Disable delivery errors, bad email addresses will be ignored
53
+ # config.action_mailer.raise_delivery_errors = false
54
+
55
+ # Enable threaded mode
56
+ # config.threadsafe!
57
+
58
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
59
+ # the I18n.default_locale when a translation can not be found)
60
+ config.i18n.fallbacks = true
61
+
62
+ # Send deprecation notices to registered listeners
63
+ config.active_support.deprecation = :notify
64
+
65
+ # Log the query plan for queries taking more than this (works
66
+ # with SQLite, MySQL, and PostgreSQL)
67
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
68
+ end
@@ -0,0 +1,38 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Dummy::Application.configure do
3
+ # Settings specified here will take precedence over those in config/application.rb
4
+
5
+ # The test environment is used exclusively to run your application's
6
+ # test suite. You never need to work with it otherwise. Remember that
7
+ # your test database is "scratch space" for the test suite and is wiped
8
+ # and recreated between test runs. Don't rely on the data there!
9
+ config.cache_classes = true
10
+
11
+ # Configure static asset server for tests with Cache-Control for performance
12
+ config.serve_static_assets = true
13
+ config.static_cache_control = "public, max-age=3600"
14
+
15
+ # Log error messages when you accidentally call methods on nil
16
+ config.whiny_nils = true
17
+
18
+ # Show full error reports and disable caching
19
+ config.consider_all_requests_local = true
20
+ config.action_controller.perform_caching = false
21
+
22
+ # Raise exceptions instead of rendering exception templates
23
+ config.action_dispatch.show_exceptions = false
24
+
25
+ # Disable request forgery protection in test environment
26
+ config.action_controller.allow_forgery_protection = false
27
+
28
+ # Tell Action Mailer not to deliver emails to the real world.
29
+ # The :test delivery method accumulates sent emails in the
30
+ # ActionMailer::Base.deliveries array.
31
+ config.action_mailer.delivery_method = :test
32
+
33
+ # Raise exception on mass assignment protection for Active Record models
34
+ config.active_record.mass_assignment_sanitizer = :strict
35
+
36
+ # Print deprecation notices to the stderr
37
+ config.active_support.deprecation = :stderr
38
+ end
@@ -0,0 +1,8 @@
1
+ # -*- encoding : utf-8 -*-
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
5
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
6
+
7
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
8
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,16 @@
1
+ # -*- encoding : utf-8 -*-
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Add new inflection rules using the following format
5
+ # (all these examples are active by default):
6
+ # ActiveSupport::Inflector.inflections do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+ #
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,6 @@
1
+ # -*- encoding : utf-8 -*-
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Add new mime types for use in respond_to blocks:
5
+ # Mime::Type.register "text/richtext", :rtf
6
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,8 @@
1
+ # -*- encoding : utf-8 -*-
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ # Your secret key for verifying the integrity of signed cookies.
5
+ # If you change this key, all old signed cookies will become invalid!
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ Dummy::Application.config.secret_token = '3a274874ec4a99e13bea1e833cc6565cfffc0355751a6a21a6db8d6dcbec6694632c9303de445b987c52644e79b6b6419fbe1e3c8011e3598006e3b62ce65169'
@@ -0,0 +1,9 @@
1
+ # -*- encoding : utf-8 -*-
2
+ # Be sure to restart your server when you modify this file.
3
+
4
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
5
+
6
+ # Use the database for sessions instead of the cookie-based default,
7
+ # which shouldn't be used to store highly confidential information
8
+ # (create the session table with "rails generate session_migration")
9
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,15 @@
1
+ # -*- encoding : utf-8 -*-
2
+ # Be sure to restart your server when you modify this file.
3
+ #
4
+ # This file contains settings for ActionController::ParamsWrapper which
5
+ # is enabled by default.
6
+
7
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
8
+ ActiveSupport.on_load(:action_controller) do
9
+ wrap_parameters format: [:json]
10
+ end
11
+
12
+ # Disable root element in JSON by default.
13
+ ActiveSupport.on_load(:active_record) do
14
+ self.include_root_in_json = false
15
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,5 @@
1
+ # -*- encoding : utf-8 -*-
2
+ Rails.application.routes.draw do
3
+
4
+ mount IpToCountry::Engine => "/ip_to_country"
5
+ end
@@ -0,0 +1,23 @@
1
+ # -*- encoding : utf-8 -*-
2
+
3
+ class CreateGeoips < ActiveRecord::Migration
4
+ def self.up
5
+ create_table :geoips, id: false do |t|
6
+ t.string :ip_from_string, null: false, limit: 15
7
+ t.string :ip_to_string, null: false, limit: 15
8
+ t.integer :ip_from, null: false, limit: 8
9
+ t.integer :ip_to, null: false, limit: 8
10
+ t.string :country_code, null: false, limit: 2
11
+ t.string :country_name, null: false, limit: 64
12
+ end
13
+
14
+ execute "ALTER TABLE geoips ADD CONSTRAINT geoips_pkey PRIMARY KEY(ip_from, ip_to);"
15
+
16
+ add_index :geoips, :ip_from, unique: true
17
+ add_index :geoips, :ip_to, unique: true
18
+ end
19
+
20
+ def self.down
21
+ drop_table :geoips
22
+ end
23
+ end
@@ -0,0 +1,322 @@
1
+ Connecting to database specified by database.yml
2
+  (0.4ms) begin transaction
3
+  (0.1ms) rollback transaction
4
+ Connecting to database specified by database.yml
5
+  (0.4ms) begin transaction
6
+  (0.1ms) rollback transaction
7
+ Connecting to database specified by database.yml
8
+  (0.4ms) begin transaction
9
+  (0.1ms) rollback transaction
10
+ Connecting to database specified by database.yml
11
+  (0.4ms) begin transaction
12
+  (0.1ms) rollback transaction
13
+ Connecting to database specified by database.yml
14
+  (0.7ms) begin transaction
15
+  (0.2ms) rollback transaction
16
+ Connecting to database specified by database.yml
17
+  (0.4ms) begin transaction
18
+  (0.1ms) rollback transaction
19
+ Connecting to database specified by database.yml
20
+  (0.4ms) begin transaction
21
+  (0.1ms) rollback transaction
22
+ Connecting to database specified by database.yml
23
+  (0.4ms) begin transaction
24
+  (0.1ms) rollback transaction
25
+  (0.1ms) begin transaction
26
+  (0.1ms) rollback transaction
27
+ Connecting to database specified by database.yml
28
+  (0.5ms) begin transaction
29
+  (0.1ms) rollback transaction
30
+  (0.1ms) begin transaction
31
+  (0.1ms) rollback transaction
32
+ Connecting to database specified by database.yml
33
+ Connecting to database specified by database.yml
34
+ Connecting to database specified by database.yml
35
+ Connecting to database specified by database.yml
36
+ Connecting to database specified by database.yml
37
+ Connecting to database specified by database.yml
38
+ Connecting to database specified by database.yml
39
+ Connecting to database specified by database.yml
40
+  (0.2ms) BEGIN
41
+  (0.2ms) ROLLBACK
42
+  (0.1ms) BEGIN
43
+  (0.2ms) ROLLBACK
44
+ Connecting to database specified by database.yml
45
+  (26.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
46
+  (74.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
47
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
48
+ Migrating to CreateGeoips (1)
49
+  (0.2ms) BEGIN
50
+  (1.8ms) CREATE TABLE "geoips" ("ip_from_string" character varying(15) NOT NULL, "ip_to_string" character varying(15) NOT NULL, "ip_from" bigint NOT NULL, "ip_to" bigint NOT NULL, "country_code" character varying(2) NOT NULL, "country_name" character varying(64) NOT NULL) 
51
+  (114.7ms) ALTER TABLE geoips ADD CONSTRAINT geoips_pkey PRIMARY KEY(ip_from, ip_to);
52
+  (43.1ms) CREATE UNIQUE INDEX "index_geoips_on_ip_from" ON "geoips" ("ip_from")
53
+  (66.3ms) CREATE UNIQUE INDEX "index_geoips_on_ip_to" ON "geoips" ("ip_to")
54
+  (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES ('1')
55
+  (7.8ms) COMMIT
56
+  (0.3ms) BEGIN
57
+  (0.5ms) ROLLBACK
58
+  (0.1ms) BEGIN
59
+  (0.1ms) ROLLBACK
60
+ Connecting to database specified by database.yml
61
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
62
+ Migrating to CreateGeoips (1)
63
+  (0.2ms) BEGIN
64
+  (0.1ms) ROLLBACK
65
+  (0.1ms) BEGIN
66
+  (0.1ms) ROLLBACK
67
+  (0.1ms) BEGIN
68
+  (0.1ms) ROLLBACK
69
+ Connecting to database specified by database.yml
70
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
71
+ Migrating to CreateGeoips (1)
72
+  (0.4ms) BEGIN
73
+  (0.8ms) ROLLBACK
74
+  (0.1ms) BEGIN
75
+  (0.1ms) ROLLBACK
76
+  (0.1ms) BEGIN
77
+  (0.2ms) ROLLBACK
78
+ Connecting to database specified by database.yml
79
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
80
+ Migrating to CreateGeoips (1)
81
+ Connecting to database specified by database.yml
82
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
83
+ Migrating to CreateGeoips (1)
84
+  (0.2ms) BEGIN
85
+  (0.1ms) ROLLBACK
86
+  (0.1ms) BEGIN
87
+  (0.1ms) ROLLBACK
88
+  (0.1ms) BEGIN
89
+  (0.1ms) ROLLBACK
90
+ Connecting to database specified by database.yml
91
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
92
+ Migrating to CreateGeoips (1)
93
+  (0.1ms) BEGIN
94
+ IpToCountry::Geoip Load (1.6ms) SELECT "geoips".* FROM "geoips" WHERE (ip_from = (select max(ip_from) from geoips where ip_from <= 3232235778) and ip_to = (select min(ip_to)
95
+ from geoips where ip_to >= 3232235778)) LIMIT 1
96
+  (0.2ms) ROLLBACK
97
+  (0.1ms) BEGIN
98
+  (0.1ms) ROLLBACK
99
+  (0.1ms) BEGIN
100
+  (0.1ms) ROLLBACK
101
+ Connecting to database specified by database.yml
102
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
103
+ Migrating to CreateGeoips (1)
104
+  (0.2ms) BEGIN
105
+ IpToCountry::Geoip Load (1.3ms) SELECT "geoips".* FROM "geoips" WHERE (ip_from = (select max(ip_from) from geoips where ip_from <= 3232235778) and ip_to = (select min(ip_to)
106
+ from geoips where ip_to >= 3232235778)) LIMIT 1
107
+  (0.1ms) ROLLBACK
108
+  (0.1ms) BEGIN
109
+  (0.1ms) ROLLBACK
110
+  (0.1ms) BEGIN
111
+  (0.1ms) ROLLBACK
112
+ Connecting to database specified by database.yml
113
+  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
114
+ Migrating to CreateGeoips (1)
115
+  (0.2ms) BEGIN
116
+ IpToCountry::Geoip Load (0.5ms) SELECT "geoips".* FROM "geoips" 
117
+  (0.1ms) ROLLBACK
118
+  (0.1ms) BEGIN
119
+  (0.1ms) ROLLBACK
120
+  (0.1ms) BEGIN
121
+  (0.1ms) ROLLBACK
122
+ Connecting to database specified by database.yml
123
+  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
124
+ Migrating to CreateGeoips (1)
125
+  (0.2ms) BEGIN
126
+ IpToCountry::Geoip Load (0.4ms) SELECT "geoips".* FROM "geoips" 
127
+  (0.1ms) ROLLBACK
128
+  (0.1ms) BEGIN
129
+  (0.1ms) ROLLBACK
130
+  (0.1ms) BEGIN
131
+  (0.1ms) ROLLBACK
132
+ Connecting to database specified by database.yml
133
+  (0.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
134
+ Migrating to CreateGeoips (1)
135
+  (0.2ms) BEGIN
136
+  (0.1ms) ROLLBACK
137
+  (0.1ms) BEGIN
138
+  (0.1ms) ROLLBACK
139
+  (0.1ms) BEGIN
140
+  (0.1ms) ROLLBACK
141
+ Connecting to database specified by database.yml
142
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
143
+ Migrating to CreateGeoips (1)
144
+  (0.2ms) BEGIN
145
+  (0.1ms) SAVEPOINT active_record_1
146
+ IpToCountry::Geoip Exists (0.8ms) SELECT 1 AS one FROM "geoips" WHERE "geoips"."ip_from" = 3232235777 LIMIT 1
147
+ IpToCountry::Geoip Exists (0.4ms) SELECT 1 AS one FROM "geoips" WHERE "geoips"."ip_to" = 3232235794 LIMIT 1
148
+ SQL (5.6ms) INSERT INTO "geoips" ("country_code", "country_name", "ip_from", "ip_from_string", "ip_to", "ip_to_string") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "ip_from" [["country_code", "wd"], ["country_name", "wonderland"], ["ip_from", 3232235777], ["ip_from_string", "192.168.1.1"], ["ip_to", 3232235794], ["ip_to_string", "192.168.1.20"]]
149
+  (0.1ms) RELEASE SAVEPOINT active_record_1
150
+ IpToCountry::Geoip Load (0.4ms) SELECT "geoips".* FROM "geoips"
151
+  (0.2ms) ROLLBACK
152
+  (0.1ms) BEGIN
153
+  (0.1ms) ROLLBACK
154
+  (0.1ms) BEGIN
155
+  (0.1ms) ROLLBACK
156
+ Connecting to database specified by database.yml
157
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
158
+ Migrating to CreateGeoips (1)
159
+  (0.2ms) BEGIN
160
+  (0.2ms) ROLLBACK
161
+  (0.1ms) BEGIN
162
+  (0.1ms) ROLLBACK
163
+  (0.1ms) BEGIN
164
+  (0.1ms) ROLLBACK
165
+ Connecting to database specified by database.yml
166
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
167
+ Migrating to CreateGeoips (1)
168
+  (0.4ms) BEGIN
169
+  (0.1ms) ROLLBACK
170
+  (0.1ms) BEGIN
171
+  (0.1ms) ROLLBACK
172
+  (0.1ms) BEGIN
173
+  (0.1ms) ROLLBACK
174
+ Connecting to database specified by database.yml
175
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
176
+ Migrating to CreateGeoips (1)
177
+ Unable to load geoip, underlying cause No such file to load -- geoip
178
+
179
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:317:in `rescue in depend_on'
180
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:312:in `depend_on'
181
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:225:in `require_dependency'
182
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:767:in `try_to_load_dependency'
183
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:782:in `block in require_fixture_classes'
184
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:779:in `each'
185
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:779:in `require_fixture_classes'
186
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:762:in `fixtures'
187
+ /home/vince/Projets/ip_to_country/test/test_helper.rb:26:in `<class:TestCase>'
188
+ /home/vince/Projets/ip_to_country/test/test_helper.rb:23:in `<top (required)>'
189
+ /home/vince/Projets/ip_to_country/test/geoip_test.rb:2:in `require'
190
+ /home/vince/Projets/ip_to_country/test/geoip_test.rb:2:in `<top (required)>'
191
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:10:in `require'
192
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
193
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:9:in `each'
194
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:9:in `block in <main>'
195
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `select'
196
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `<main>'
197
+  (54.5ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "geoips" DISABLE TRIGGER ALL
198
+  (0.2ms) BEGIN
199
+ Fixture Delete (0.5ms) DELETE FROM "geoips"
200
+ Fixture Insert (0.5ms) INSERT INTO "geoips" ("ip_from_string", "ip_to_string", "ip_from", "ip_to", "country_code", "country_name") VALUES ('192.168.1.1', '192.168.1.20', 3232235777, 3232235794, 'wd', 'wonderland')
201
+  (15.3ms) COMMIT
202
+  (0.3ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "geoips" ENABLE TRIGGER ALL
203
+  (0.1ms) BEGIN
204
+  (0.2ms) SAVEPOINT active_record_1
205
+ IpToCountry::Geoip Exists (0.5ms) SELECT 1 AS one FROM "geoips" WHERE "geoips"."ip_from" = 3232235777 LIMIT 1
206
+ IpToCountry::Geoip Exists (0.4ms) SELECT 1 AS one FROM "geoips" WHERE "geoips"."ip_to" = 3232235794 LIMIT 1
207
+  (8.6ms) ROLLBACK TO SAVEPOINT active_record_1
208
+  (0.2ms) ROLLBACK
209
+  (0.1ms) BEGIN
210
+  (0.2ms) ROLLBACK
211
+  (0.1ms) BEGIN
212
+  (0.2ms) ROLLBACK
213
+ Connecting to database specified by database.yml
214
+  (0.8ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
215
+ Migrating to CreateGeoips (1)
216
+ Unable to load geoip, underlying cause No such file to load -- geoip
217
+
218
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:317:in `rescue in depend_on'
219
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:312:in `depend_on'
220
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:225:in `require_dependency'
221
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:767:in `try_to_load_dependency'
222
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:782:in `block in require_fixture_classes'
223
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:779:in `each'
224
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:779:in `require_fixture_classes'
225
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:762:in `fixtures'
226
+ /home/vince/Projets/ip_to_country/test/test_helper.rb:26:in `<class:TestCase>'
227
+ /home/vince/Projets/ip_to_country/test/test_helper.rb:23:in `<top (required)>'
228
+ /home/vince/Projets/ip_to_country/test/geoip_test.rb:2:in `require'
229
+ /home/vince/Projets/ip_to_country/test/geoip_test.rb:2:in `<top (required)>'
230
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:10:in `require'
231
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
232
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:9:in `each'
233
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:9:in `block in <main>'
234
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `select'
235
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `<main>'
236
+  (0.3ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "geoips" DISABLE TRIGGER ALL
237
+  (0.1ms) BEGIN
238
+ Fixture Delete (0.6ms) DELETE FROM "geoips"
239
+ Fixture Insert (0.5ms) INSERT INTO "geoips" ("ip_from_string", "ip_to_string", "ip_from", "ip_to", "country_code", "country_name") VALUES ('192.168.1.1', '192.168.1.20', 3232235777, 3232235794, 'wd', 'wonderland')
240
+  (18.1ms) COMMIT
241
+  (0.4ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "geoips" ENABLE TRIGGER ALL
242
+  (0.2ms) BEGIN
243
+ IpToCountry::Geoip Load (0.2ms) SELECT "geoips".* FROM "geoips" 
244
+  (0.2ms) ROLLBACK
245
+  (0.1ms) BEGIN
246
+  (0.1ms) ROLLBACK
247
+  (0.1ms) BEGIN
248
+  (0.1ms) ROLLBACK
249
+ Connecting to database specified by database.yml
250
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
251
+ Migrating to CreateGeoips (1)
252
+ Unable to load geoip, underlying cause No such file to load -- geoip
253
+
254
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:317:in `rescue in depend_on'
255
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:312:in `depend_on'
256
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:225:in `require_dependency'
257
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:767:in `try_to_load_dependency'
258
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:782:in `block in require_fixture_classes'
259
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:779:in `each'
260
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:779:in `require_fixture_classes'
261
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:762:in `fixtures'
262
+ /home/vince/Projets/ip_to_country/test/test_helper.rb:26:in `<class:TestCase>'
263
+ /home/vince/Projets/ip_to_country/test/test_helper.rb:23:in `<top (required)>'
264
+ /home/vince/Projets/ip_to_country/test/geoip_test.rb:2:in `require'
265
+ /home/vince/Projets/ip_to_country/test/geoip_test.rb:2:in `<top (required)>'
266
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:10:in `require'
267
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
268
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:9:in `each'
269
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:9:in `block in <main>'
270
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `select'
271
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `<main>'
272
+  (0.4ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "geoips" DISABLE TRIGGER ALL
273
+  (0.2ms) BEGIN
274
+ Fixture Delete (0.5ms) DELETE FROM "geoips"
275
+ Fixture Insert (0.5ms) INSERT INTO "geoips" ("ip_from_string", "ip_to_string", "ip_from", "ip_to", "country_code", "country_name") VALUES ('192.168.1.1', '192.168.1.20', 3232235777, 3232235794, 'wd', 'wonderland')
276
+  (18.5ms) COMMIT
277
+  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "geoips" ENABLE TRIGGER ALL
278
+  (0.1ms) BEGIN
279
+ IpToCountry::Geoip Load (1.0ms) SELECT "geoips".* FROM "geoips" WHERE (ip_from = (select max(ip_from) from geoips where ip_from <= 3232235778) and ip_to = (select min(ip_to)
280
+ from geoips where ip_to >= 3232235778)) LIMIT 1
281
+  (0.2ms) ROLLBACK
282
+  (0.1ms) BEGIN
283
+  (0.1ms) ROLLBACK
284
+  (0.1ms) BEGIN
285
+  (0.2ms) ROLLBACK
286
+ Connecting to database specified by database.yml
287
+  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
288
+ Migrating to CreateGeoips (1)
289
+ Unable to load geoip, underlying cause No such file to load -- geoip
290
+
291
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:317:in `rescue in depend_on'
292
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:312:in `depend_on'
293
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:225:in `require_dependency'
294
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:767:in `try_to_load_dependency'
295
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:782:in `block in require_fixture_classes'
296
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:779:in `each'
297
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:779:in `require_fixture_classes'
298
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:762:in `fixtures'
299
+ /home/vince/Projets/ip_to_country/test/test_helper.rb:26:in `<class:TestCase>'
300
+ /home/vince/Projets/ip_to_country/test/test_helper.rb:23:in `<top (required)>'
301
+ /home/vince/Projets/ip_to_country/test/geoip_test.rb:2:in `require'
302
+ /home/vince/Projets/ip_to_country/test/geoip_test.rb:2:in `<top (required)>'
303
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:10:in `require'
304
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
305
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:9:in `each'
306
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:9:in `block in <main>'
307
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `select'
308
+ /home/vince/.rvm/gems/ruby-1.9.3-head/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `<main>'
309
+  (1.2ms) ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "geoips" DISABLE TRIGGER ALL
310
+  (0.1ms) BEGIN
311
+ Fixture Delete (0.5ms) DELETE FROM "geoips"
312
+ Fixture Insert (0.5ms) INSERT INTO "geoips" ("ip_from_string", "ip_to_string", "ip_from", "ip_to", "country_code", "country_name") VALUES ('192.168.1.1', '192.168.1.20', 3232235777, 3232235794, 'wd', 'wonderland')
313
+  (41.2ms) COMMIT
314
+  (0.2ms) ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "geoips" ENABLE TRIGGER ALL
315
+  (0.1ms) BEGIN
316
+ IpToCountry::Geoip Load (1.1ms) SELECT "geoips".* FROM "geoips" WHERE (ip_from = (select max(ip_from) from geoips where ip_from <= 3232235778) and ip_to = (select min(ip_to)
317
+ from geoips where ip_to >= 3232235778)) LIMIT 1
318
+  (0.3ms) ROLLBACK
319
+  (0.1ms) BEGIN
320
+  (0.1ms) ROLLBACK
321
+  (0.1ms) BEGIN
322
+  (0.2ms) ROLLBACK