uncharted 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,3 +31,4 @@ module Uncharted
31
31
  Territory.new('BR-SP', :state, 'São Paulo')
32
32
  Territory.new('BR-TO', :state, 'Tocantins')
33
33
  end
34
+
@@ -254,3 +254,4 @@ module Uncharted
254
254
  Country.new('ZW', 'ZWE', 'Zimbabwe')
255
255
 
256
256
  end
257
+
File without changes
File without changes
@@ -1,4 +1,3 @@
1
- require 'i18n'
2
1
 
3
2
  module Uncharted
4
3
 
@@ -48,7 +47,7 @@ module Uncharted
48
47
  def self.data
49
48
  @data ||= {}
50
49
  end
51
-
50
+
52
51
  end
53
52
 
54
53
  end
@@ -6,7 +6,7 @@ module Uncharted
6
6
  include Mongoid::Fields::Serializable if defined? Mongoid
7
7
 
8
8
  def deserialize(code)
9
- code && Uncharted::Country.find(code)
9
+ code && Country.find(code)
10
10
  end
11
11
 
12
12
  def serialize(country)
@@ -18,7 +18,7 @@ module Uncharted
18
18
  include Mongoid::Fields::Serializable if defined? Mongoid
19
19
 
20
20
  def deserialize(code)
21
- code && Uncharted::Territory.find(code)
21
+ code && Territory.find(code)
22
22
  end
23
23
 
24
24
  def serialize(territory)
@@ -1,4 +1,3 @@
1
- require 'uncharted/country'
2
1
 
3
2
  module Uncharted
4
3
 
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Uncharted
3
- VERSION = '0.0.9'
3
+ VERSION = '0.0.10'
4
4
  end
data/lib/uncharted.rb CHANGED
@@ -1,15 +1,21 @@
1
1
  # encoding: utf-8
2
2
 
3
- require 'uncharted/i18n'
3
+ require 'i18n'
4
4
 
5
5
  require 'uncharted/country'
6
6
  require 'uncharted/territory'
7
7
 
8
- require 'uncharted/data/countries'
9
- require 'uncharted/data/br'
10
-
11
8
  require 'uncharted/extensions/mongoid'
12
9
  require 'uncharted/extensions/rails'
13
10
 
14
- Country = Uncharted::Country
15
- Territory = Uncharted::Territory
11
+
12
+ # Load ISO 3166 country and territory lists
13
+ require 'uncharted/config/countries'
14
+ require 'uncharted/config/br'
15
+
16
+ # Load default locales
17
+ I18n.load_path += Dir["#{File.dirname(__FILE__)}/uncharted/config/locales/*.yml"]
18
+
19
+ # Use shortcut if classes are not already defined
20
+ Country = Uncharted::Country unless defined?(Country)
21
+ Territory = Uncharted::Territory unless defined?(Territory)
data/test/test_helper.rb CHANGED
@@ -7,7 +7,6 @@ require 'minitest/autorun'
7
7
  require 'purdytest'
8
8
  require 'simplecov-rcov'
9
9
 
10
- require 'i18n'
11
10
  require 'uncharted'
12
11
 
13
12
  class SimpleCov::Formatter::MergedFormatter
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uncharted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-10 00:00:00.000000000 Z
12
+ date: 2011-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
16
- requirement: &2160716480 !ruby/object:Gem::Requirement
16
+ requirement: &2160633940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2160716480
24
+ version_requirements: *2160633940
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: minitest
27
- requirement: &2160737840 !ruby/object:Gem::Requirement
27
+ requirement: &2160632820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2160737840
35
+ version_requirements: *2160632820
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: purdytest
38
- requirement: &2160737180 !ruby/object:Gem::Requirement
38
+ requirement: &2160631820 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2160737180
46
+ version_requirements: *2160631820
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: simplecov
49
- requirement: &2160736080 !ruby/object:Gem::Requirement
49
+ requirement: &2160647380 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2160736080
57
+ version_requirements: *2160647380
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: simplecov-rcov
60
- requirement: &2160734700 !ruby/object:Gem::Requirement
60
+ requirement: &2160646440 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2160734700
68
+ version_requirements: *2160646440
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: yard
71
- requirement: &2160733560 !ruby/object:Gem::Requirement
71
+ requirement: &2160645880 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2160733560
79
+ version_requirements: *2160645880
80
80
  description: Provide ISO 3166 codes and english name for countries and their political
81
81
  divisions
82
82
  email:
@@ -93,20 +93,18 @@ files:
93
93
  - README.md
94
94
  - Rakefile
95
95
  - lib/uncharted.rb
96
+ - lib/uncharted/config/br.rb
97
+ - lib/uncharted/config/countries.rb
98
+ - lib/uncharted/config/locales/en.yml
99
+ - lib/uncharted/config/locales/pt-BR.yml
96
100
  - lib/uncharted/country.rb
97
- - lib/uncharted/data/br.rb
98
- - lib/uncharted/data/countries.rb
99
101
  - lib/uncharted/extensions/mongoid.rb
100
102
  - lib/uncharted/extensions/rails.rb
101
- - lib/uncharted/i18n.rb
102
- - lib/uncharted/locales/en.yml
103
- - lib/uncharted/locales/pt-BR.yml
104
103
  - lib/uncharted/territory.rb
105
104
  - lib/uncharted/version.rb
106
105
  - test/country_test.rb
107
106
  - test/mongoid_test.rb
108
107
  - test/test_helper.rb
109
- - test/uncharted_test.rb
110
108
  - uncharted.gemspec
111
109
  homepage: http://github.com/cenize/uncharted
112
110
  licenses: []
@@ -136,5 +134,4 @@ test_files:
136
134
  - test/country_test.rb
137
135
  - test/mongoid_test.rb
138
136
  - test/test_helper.rb
139
- - test/uncharted_test.rb
140
137
  has_rdoc:
@@ -1,4 +0,0 @@
1
-
2
- require 'i18n'
3
-
4
- I18n.load_path += Dir['lib/uncharted/locales/*.yml']
@@ -1,8 +0,0 @@
1
- # encoding: utf-8
2
- require 'test_helper'
3
- require 'uncharted'
4
-
5
- class TestUncharted < MiniTest::Unit::TestCase
6
-
7
-
8
- end