direct_address 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{direct_address}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mike Nelson"]
12
- s.date = %q{2010-02-17}
12
+ s.date = %q{2010-02-20}
13
13
  s.description = %q{Direct Address provides a rails app with simple address features. This is a streamlined implementation of address functionality. Direct Address provides you with address, country, and region classes. It also provides a generator which generates the necessary javascript and rake tasks to implement properly. You'll also get form helpers to easily implement Direct Address in your views. A rake task is provided that allows up to date country and region information to be downloaded from geoname.org.}
14
14
  s.email = %q{mdnelson30@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -17,6 +17,7 @@ class DirectAddressGenerator < Rails::Generator::Base
17
17
 
18
18
  m.migration_template "migrations/direct_address_migration.rb", "db/migrate", {:migration_file_name => "direct_address_migration"}
19
19
 
20
+ m.directory "lib/tasks"
20
21
  m.file "tasks/harvest.rake", "lib/tasks/direct_address_harvest.rake"
21
22
 
22
23
  end
@@ -1,13 +1,17 @@
1
1
 
2
2
  begin
3
- require File.dirname(__FILE__) + '/../../config/environment.rb'
4
-
3
+
5
4
  namespace :direct_address do
6
5
  desc "pulls up to date country and region data from geonames.org"
7
- task :pull do
6
+ task :seed do
7
+ require File.join(File.dirname(__FILE__),'..','..','config','boot')
8
+ Rails::Initializer.run do |config|
9
+ config.gem 'direct_address'
10
+ end
8
11
  Geoname.retrieve_to_db
9
12
  end
10
13
  end
14
+
11
15
  rescue
12
16
  puts "Direct address harvester not properly installed"
13
17
  end
data/spec/debug.log CHANGED
@@ -410,3 +410,74 @@ WARNING: Can't mass-assign these protected attributes: region, country, addressa
410
410
  SQL (0.1ms) BEGIN
411
411
  Country Create (0.2ms) INSERT INTO `countries` (`name`, `created_at`, `updated_at`, `abbreviation`) VALUES('All Americas', '2010-02-17 17:59:03', '2010-02-17 17:59:03', 'AA')
412
412
  SQL (0.7ms) COMMIT
413
+ SQL (0.2ms) SET NAMES 'utf8'
414
+ SQL (0.1ms) SET SQL_AUTO_IS_NULL=0
415
+ SQL (46.1ms) SHOW TABLES
416
+ SQL (69.1ms) DROP TABLE `addresses`
417
+ SQL (119.5ms) CREATE TABLE `addresses` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `addressable_id` int(11) NOT NULL, `addressable_type` varchar(255) NOT NULL, `country_id` int(11), `region_id` int(11), `street1` varchar(255), `street2` varchar(255), `city` varchar(255), `postal` varchar(255), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
418
+ SQL (0.5ms) SHOW TABLES
419
+ SQL (1.8ms) DROP TABLE `countries`
420
+ SQL (253.6ms) CREATE TABLE `countries` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `abbreviation` varchar(255), `name` varchar(255), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
421
+ SQL (0.8ms) SHOW TABLES
422
+ SQL (3.8ms) DROP TABLE `regions`
423
+ SQL (117.2ms) CREATE TABLE `regions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `country_id` int(11), `name` varchar(255), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
424
+ SQL (0.6ms) SHOW TABLES
425
+ SQL (120.4ms) CREATE TABLE `users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
426
+ SQL (1.0ms) SHOW TABLES
427
+ SQL (0.4ms) SELECT version FROM `schema_migrations`
428
+ SQL (0.7ms) INSERT INTO `schema_migrations` (version) VALUES ('0')
429
+ Country Columns (1.5ms) SHOW FIELDS FROM `countries`
430
+ SQL (0.1ms) BEGIN
431
+ Country Create (0.3ms) INSERT INTO `countries` (`name`, `created_at`, `updated_at`, `abbreviation`) VALUES('United States', '2010-02-18 12:33:52', '2010-02-18 12:33:52', 'US')
432
+ SQL (0.6ms) COMMIT
433
+ Region Columns (1.3ms) SHOW FIELDS FROM `regions`
434
+ SQL (0.1ms) BEGIN
435
+ Region Create (0.2ms) INSERT INTO `regions` (`name`, `created_at`, `updated_at`, `country_id`) VALUES('Kansas', '2010-02-18 12:33:52', '2010-02-18 12:33:52', 1)
436
+ SQL (0.9ms) COMMIT
437
+ User Columns (1.3ms) SHOW FIELDS FROM `users`
438
+ SQL (0.1ms) BEGIN
439
+ User Create (0.6ms) INSERT INTO `users` (`name`, `created_at`, `updated_at`) VALUES('Mike', '2010-02-18 12:33:52', '2010-02-18 12:33:52')
440
+ SQL (0.6ms) COMMIT
441
+ Address Columns (1.4ms) SHOW FIELDS FROM `addresses`
442
+ SQL (0.1ms) BEGIN
443
+ Address Create (0.6ms) INSERT INTO `addresses` (`city`, `created_at`, `postal`, `street1`, `updated_at`, `addressable_type`, `country_id`, `street2`, `addressable_id`, `region_id`) VALUES('Whitmore', '2010-02-18 12:33:52', '04330', '54 Parkins Way', '2010-02-18 12:33:52', 'User', 1, NULL, 1, 1)
444
+ SQL (0.5ms) COMMIT
445
+ SQL (0.1ms) BEGIN
446
+ Country Create (0.2ms) INSERT INTO `countries` (`name`, `created_at`, `updated_at`, `abbreviation`) VALUES('All Americas', '2010-02-18 12:33:52', '2010-02-18 12:33:52', 'AA')
447
+ SQL (0.5ms) COMMIT
448
+ SQL (0.2ms) SET NAMES 'utf8'
449
+ SQL (0.1ms) SET SQL_AUTO_IS_NULL=0
450
+ SQL (0.4ms) SHOW TABLES
451
+ SQL (1.9ms) DROP TABLE `addresses`
452
+ SQL (61.2ms) CREATE TABLE `addresses` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `addressable_id` int(11) NOT NULL, `addressable_type` varchar(255) NOT NULL, `country_id` int(11), `region_id` int(11), `street1` varchar(255), `street2` varchar(255), `city` varchar(255), `postal` varchar(255), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
453
+ SQL (0.8ms) SHOW TABLES
454
+ SQL (2.3ms) DROP TABLE `countries`
455
+ SQL (148.3ms) CREATE TABLE `countries` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `abbreviation` varchar(255), `name` varchar(255), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
456
+ SQL (0.7ms) SHOW TABLES
457
+ SQL (2.5ms) DROP TABLE `regions`
458
+ SQL (107.0ms) CREATE TABLE `regions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `country_id` int(11), `name` varchar(255), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
459
+ SQL (1.4ms) SHOW TABLES
460
+ SQL (2.3ms) DROP TABLE `users`
461
+ SQL (116.1ms) CREATE TABLE `users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
462
+ SQL (0.7ms) SHOW TABLES
463
+ SQL (0.3ms) SELECT version FROM `schema_migrations`
464
+ Country Columns (2.1ms) SHOW FIELDS FROM `countries`
465
+ SQL (0.1ms) BEGIN
466
+ Country Create (0.3ms) INSERT INTO `countries` (`name`, `created_at`, `updated_at`, `abbreviation`) VALUES('United States', '2010-02-18 12:34:07', '2010-02-18 12:34:07', 'US')
467
+ SQL (0.6ms) COMMIT
468
+ Region Columns (1.4ms) SHOW FIELDS FROM `regions`
469
+ SQL (0.1ms) BEGIN
470
+ Region Create (0.2ms) INSERT INTO `regions` (`name`, `created_at`, `updated_at`, `country_id`) VALUES('Kansas', '2010-02-18 12:34:07', '2010-02-18 12:34:07', 1)
471
+ SQL (0.6ms) COMMIT
472
+ User Columns (1.3ms) SHOW FIELDS FROM `users`
473
+ WARNING: Can't mass-assign these protected attributes: name
474
+ SQL (0.1ms) BEGIN
475
+ User Create (0.3ms) INSERT INTO `users` (`name`, `created_at`, `updated_at`) VALUES(NULL, '2010-02-18 12:34:07', '2010-02-18 12:34:07')
476
+ SQL (0.6ms) COMMIT
477
+ Address Columns (1.5ms) SHOW FIELDS FROM `addresses`
478
+ SQL (0.1ms) BEGIN
479
+ Address Create (0.2ms) INSERT INTO `addresses` (`city`, `created_at`, `postal`, `street1`, `updated_at`, `addressable_type`, `country_id`, `street2`, `addressable_id`, `region_id`) VALUES('Whitmore', '2010-02-18 12:34:07', '04330', '54 Parkins Way', '2010-02-18 12:34:07', 'User', 1, NULL, 1, 1)
480
+ SQL (0.6ms) COMMIT
481
+ SQL (0.2ms) BEGIN
482
+ Country Create (0.2ms) INSERT INTO `countries` (`name`, `created_at`, `updated_at`, `abbreviation`) VALUES('All Americas', '2010-02-18 12:34:07', '2010-02-18 12:34:07', 'AA')
483
+ SQL (0.7ms) COMMIT
data/spec/model/user.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class User < ActiveRecord::Base
2
2
 
3
- has_one :address, :as => :addressable
3
+ acts_as_addressable
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: direct_address
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Nelson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-17 00:00:00 -05:00
12
+ date: 2010-02-20 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency