polish_postal_codes 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a8f2457daf808e3b3b3bd689de09d27f54df61b
4
- data.tar.gz: fb7835a095a9f0cacf675d5ef67e51adcf012616
3
+ metadata.gz: 454c84acb6a13c24dd20140a25c224c2c5a23990
4
+ data.tar.gz: 94e78adaba8c2fd8fdcbaadefe60e76b948883b3
5
5
  SHA512:
6
- metadata.gz: c5799b3d9492af3942c0f06bdf7f32271c02c49fb4dc9be2764d0231806931cd3b7b53482f50e2d0b2bf94a1928bc960fb6fe65e911a31826bd83edaa527f0ab
7
- data.tar.gz: 428543331c1ca5c51c01d902940c79d0f9d5413c1dacde3bf3f2f3ab2ca3903a12faa647509f0baa0b2321307647bf5e4befb17b20d20aec9fce07c87cdeeb75
6
+ metadata.gz: 12c8f9f094cbcc5276f4141657c87dc800cd258ab206ad421e6a7499170692bd822ab32b3c1d39f4964edd7950cc6ca3d225181e62bcb360ae59e05fe4c09eea
7
+ data.tar.gz: 9f8af4b93a8bfcd65a595a7cb53d121056e4d6c574b2c3cbe29494ea3b1aa822982efb5839983f1e3fd3f5af2153e0b969f4d2b7240bc1427d134d4014d34a5a
data/bin/update CHANGED
@@ -18,22 +18,17 @@ system("pdftotext -layout #{tmp_file.path}")
18
18
  data.transaction do
19
19
  File.open("#{tmp_file.path}.txt", 'r').each_line do |line|
20
20
  break if line =~ /Podmioty posiadające odrębne PNA/
21
+ next unless line =~ /([0-9]{2}-[0-9]{3})/
21
22
 
22
- if line =~ /([0-9]{2}-[0-9]{3})/
23
- t = line.gsub(/\ {2,}/, ' ').split(/ /)
24
-
25
- data[t[0].strip] ||= { city: t[1].split('(').first.strip,
26
- community: t[-3].strip,
27
- county: t[-2].strip,
28
- province: t[-1].strip }
29
- end
23
+ t = line.gsub(/\ {2,}/, ' ').split(/ /)
24
+ data[t[0].strip] ||= { city: t[1].split('(').first.strip,
25
+ community: t[-3].strip,
26
+ county: t[-2].strip,
27
+ province: t[-1].strip }
30
28
  end
31
29
  end
32
30
 
33
31
  at_exit do
34
32
  converted_txt_file_path = "#{tmp_file.path}.txt"
35
-
36
- if File.exist? converted_txt_file_path
37
- File.delete converted_txt_file_path
38
- end
33
+ File.delete converted_txt_file_path if File.exist? converted_txt_file_path
39
34
  end
@@ -1,3 +1,3 @@
1
1
  module PolishPostalCodes
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polish_postal_codes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damian Baćkowski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-03 00:00:00.000000000 Z
11
+ date: 2016-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec