localized_country_select 0.9.8 → 0.9.9
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.
data/README.rdoc
CHANGED
@@ -78,7 +78,7 @@ namespace :import do
|
|
78
78
|
countries:
|
79
79
|
HEAD
|
80
80
|
countries.each do |country|
|
81
|
-
output << " #{country[:code]}: \"#{country[:name]}\"\n"
|
81
|
+
output << " \"#{country[:code]}\": \"#{country[:name]}\"\n"
|
82
82
|
end
|
83
83
|
|
84
84
|
else # rb format
|
@@ -136,10 +136,10 @@ TAIL
|
|
136
136
|
document.search("//tr").inject({}) do |hash, row|
|
137
137
|
n = row.search("td[@class='n']")
|
138
138
|
g = row.search("td")
|
139
|
-
if n.inner_html =~ /NamesTerritories/ && g.count >=
|
139
|
+
if n.inner_html =~ /NamesTerritories/ && g.count >= 6 && g[4].inner_html =~ /^[A-Z]{2}/
|
140
140
|
code = g[4].inner_text
|
141
141
|
code = code[-code.size, 2].to_sym
|
142
|
-
name = row.search("td[@class='v']").inner_text
|
142
|
+
name = row.search("td[@class='v']:not([@title])").inner_text
|
143
143
|
|
144
144
|
hash[code] = {:code => code, :name => name.to_s}
|
145
145
|
end
|
@@ -163,10 +163,10 @@ TAIL
|
|
163
163
|
document.find("//tr").inject({}) do |hash, row|
|
164
164
|
n = row.find("td[@class='n']")
|
165
165
|
g = row.find("td")
|
166
|
-
if n.map(&:content).join =~ /NamesTerritories/ && g.count >=
|
166
|
+
if n.map(&:content).join =~ /NamesTerritories/ && g.count >= 6 && g[4].inner_xml =~ /^[A-Z]{2}/
|
167
167
|
code = g[4].content
|
168
168
|
code = code[-code.size, 2].to_sym
|
169
|
-
name = row.find("td[@class='v']").map(&:content).join
|
169
|
+
name = row.find("td[@class='v' and not(@title)]").map(&:content).join
|
170
170
|
|
171
171
|
hash[code] ||= {:code => code, :name => name.to_s}
|
172
172
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: localized_country_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2014-
|
18
|
+
date: 2014-07-25 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: actionpack
|