portal_scraper 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64ff22e3f3fc86f6db06fbee7fcef9f81e671c487eb9970eb200854b35d632ab
4
- data.tar.gz: 95bd91bbbc537a433a0d0c9f8be8a772c12df3bd94d9663fbf46e1f253fb5549
3
+ metadata.gz: bda292894076f02d59473052af9ae3daa5e05e62bba31b453d86581abd809877
4
+ data.tar.gz: f5ae9d449f2ff4b868e1984eee05e949182b2a4c800dce15edecfcd3dd86ddc3
5
5
  SHA512:
6
- metadata.gz: 291bad49b4ea5774b82bccbb00668789e902b20939d41888961f72c739bf75a68e29d4055b03983cdd2ba6feb7de0d85410ceb848972c4f5c81e2cd30214d09a
7
- data.tar.gz: 98e73d79dff179d8be8f5a02c6d671c2a9e60040dae0464f5ed0a05d0f85c6f59d861b8ed6e8310cefd3a40ade43a7276e0d0274ac226e2ab699e719c1dd182b
6
+ metadata.gz: 4520278d5064e24b6b8850d02289ee75299db9c6b84b098f4b3b654fd7e81594e687830510feec6d98a6192aa88a519816987c89e8fb7c0f5b4990dcde53b513
7
+ data.tar.gz: e135e07774135f0a319e2575d334ad3c3c3f6ba6f8395cd380e776f288f43b223e4552306502043b03a66a886a1d1c1fa0d5968e3028fd4850918d9e4fbe0b5e
@@ -77,8 +77,10 @@ module PortalScraper
77
77
 
78
78
  def fill_commune(app, form, postal_code, city)
79
79
  app.post(url_for('/tiersCommunes.do'), { codPos: postal_code }).tap do |mappings|
80
- code = mappings.search('td.t').find { |c| c.text.strip == city }.parent.search('a.PL_LST').text.strip
81
- form['commune'] = code
80
+ mapping = mappings.search('td.t').find { |c| c.text.strip.include?(city) }
81
+ code = mapping&.parent.search('a.PL_LST').text.strip
82
+ form['commune'] = code
83
+ form['libCommune'] = mapping&.text.strip
82
84
  end
83
85
  end
84
86
 
@@ -2,7 +2,7 @@ module PortalScraper
2
2
  class Version
3
3
  MAJOR = 1
4
4
  MINOR = 2
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  def self.to_s
8
8
  [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: portal_scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Armand Mégrot