iso_code 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +9 -0
- data/iso_code.gemspec +2 -2
- data/lib/iso_code/base.rb +1 -1
- data/lib/iso_code/iso3166.rb +7 -2
- data/lib/iso_code/version.rb +1 -1
- metadata +15 -15
data/Rakefile
CHANGED
data/iso_code.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "iso_code"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Thomas Boerger"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2012-02-27"
|
13
13
|
s.description = "Translate many available languages (ISO 639-3) and countries (ISO 3166) into requested languages"
|
14
14
|
s.email = "tboerger@tbpro.de"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/iso_code/base.rb
CHANGED
data/lib/iso_code/iso3166.rb
CHANGED
@@ -28,12 +28,17 @@ module IsoCode
|
|
28
28
|
protected
|
29
29
|
# Parse the base XML file
|
30
30
|
def parse_basexml
|
31
|
-
Nokogiri::XML(open(@basexml)).search('//iso_3166_entries
|
32
|
-
en_name = row.
|
31
|
+
Nokogiri::XML(open(@basexml)).search('//iso_3166_entries/*').each do |row|
|
32
|
+
en_name = if row.has_attribute? 'names'
|
33
|
+
row.attributes['names'].to_s
|
34
|
+
else
|
35
|
+
row.attributes['name'].to_s
|
36
|
+
end
|
33
37
|
|
34
38
|
@dataset[en_name] = {
|
35
39
|
:alpha2 => row.attributes['alpha_2_code'].to_s || '',
|
36
40
|
:alpha3 => row.attributes['alpha_3_code'].to_s || '',
|
41
|
+
:alpha4 => row.attributes['alpha_4_code'].to_s || '',
|
37
42
|
:number => row.attributes['numeric_code'].to_s || '',
|
38
43
|
:withdrawn => row.attributes['date_withdrawn'].to_s || '',
|
39
44
|
:en => en_name
|
data/lib/iso_code/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iso_code
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
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:
|
12
|
+
date: 2012-02-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &70277119696500 !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: *70277119696500
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70277119711140 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.3.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70277119711140
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: yard
|
38
|
-
requirement: &
|
38
|
+
requirement: &70277119706420 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.6.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70277119706420
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &70277119714780 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.0.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70277119714780
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: jeweler
|
60
|
-
requirement: &
|
60
|
+
requirement: &70277119724980 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.6.4
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70277119724980
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rcov
|
71
|
-
requirement: &
|
71
|
+
requirement: &70277119735860 !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: *70277119735860
|
80
80
|
description: Translate many available languages (ISO 639-3) and countries (ISO 3166)
|
81
81
|
into requested languages
|
82
82
|
email: tboerger@tbpro.de
|
@@ -117,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
segments:
|
119
119
|
- 0
|
120
|
-
hash:
|
120
|
+
hash: -1636655785082562488
|
121
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
122
|
none: false
|
123
123
|
requirements:
|