uncharted 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/uncharted/{data → config}/br.rb +1 -0
- data/lib/uncharted/{data → config}/countries.rb +1 -0
- data/lib/uncharted/{locales → config/locales}/en.yml +0 -0
- data/lib/uncharted/{locales → config/locales}/pt-BR.yml +0 -0
- data/lib/uncharted/country.rb +1 -2
- data/lib/uncharted/extensions/mongoid.rb +2 -2
- data/lib/uncharted/territory.rb +0 -1
- data/lib/uncharted/version.rb +1 -1
- data/lib/uncharted.rb +12 -6
- data/test/test_helper.rb +0 -1
- metadata +18 -21
- data/lib/uncharted/i18n.rb +0 -4
- data/test/uncharted_test.rb +0 -8
File without changes
|
File without changes
|
data/lib/uncharted/country.rb
CHANGED
@@ -6,7 +6,7 @@ module Uncharted
|
|
6
6
|
include Mongoid::Fields::Serializable if defined? Mongoid
|
7
7
|
|
8
8
|
def deserialize(code)
|
9
|
-
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 &&
|
21
|
+
code && Territory.find(code)
|
22
22
|
end
|
23
23
|
|
24
24
|
def serialize(territory)
|
data/lib/uncharted/territory.rb
CHANGED
data/lib/uncharted/version.rb
CHANGED
data/lib/uncharted.rb
CHANGED
@@ -1,15 +1,21 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
require '
|
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
|
-
|
15
|
-
|
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
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.
|
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-
|
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: &
|
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: *
|
24
|
+
version_requirements: *2160633940
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: minitest
|
27
|
-
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: *
|
35
|
+
version_requirements: *2160632820
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: purdytest
|
38
|
-
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: *
|
46
|
+
version_requirements: *2160631820
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: simplecov
|
49
|
-
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: *
|
57
|
+
version_requirements: *2160647380
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: simplecov-rcov
|
60
|
-
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: *
|
68
|
+
version_requirements: *2160646440
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: yard
|
71
|
-
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: *
|
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:
|
data/lib/uncharted/i18n.rb
DELETED