localized_country_select 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,7 @@ See http://github.com/rails/country_select/tree/master/lib/country_select.rb
22
22
 
23
23
  In your Gemfile add:
24
24
 
25
- gem 'localized_country_select', '>= 0.9.8'
25
+ gem 'localized_country_select', '>= 0.9.9'
26
26
 
27
27
  == Rails 2.3
28
28
 
@@ -1,3 +1,3 @@
1
1
  module LocalizedCountrySelect
2
- VERSION = "0.9.8"
2
+ VERSION = "0.9.9"
3
3
  end
@@ -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 >= 7 && g[4].inner_html =~ /^[A-Z]{2}/
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 >= 7 && g[4].inner_xml =~ /^[A-Z]{2}/
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.8
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-03-28 00:00:00.000000000 Z
18
+ date: 2014-07-25 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: actionpack