brand2csv 0.2.9 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/lib/brand2csv.rb +2 -2
- data/lib/brand2csv/version.rb +1 -1
- data/spec/csv_spec.rb +1 -1
- data/spec/swissreg_spec.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ac6466b50f94574643e0f2d44aad8df563415d3
|
4
|
+
data.tar.gz: 51f0797bc1a14d38bb7e3c58794c85412c2f9019
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: befd70c4323638bdfdfab9226ef9d0b5fb4a1a466f9d603f3961e54019a2177d3fc88ec57b07e50b7377bddeefea538da74e717ffb45a387e631c1fa97d13793
|
7
|
+
data.tar.gz: 7d67cd338cf64b7bf0b1f7af89fe5578493ba420e794812054f64cb89987590a36fcee38cb5535bd40badbab441eae5e97a8c78705b70818336bfb57e1a4f715
|
data/History.txt
CHANGED
data/lib/brand2csv.rb
CHANGED
@@ -313,7 +313,7 @@ module Brand2csv
|
|
313
313
|
bezeichnung = nil
|
314
314
|
inhaber = nil
|
315
315
|
hinterlegungsdatum = nil
|
316
|
-
hatVertreter =
|
316
|
+
hatVertreter = 'Nein'
|
317
317
|
doc.xpath("//html/body/form/div/div/fieldset/div/table/tbody/tr").each{
|
318
318
|
|x|
|
319
319
|
if x.children.first.text.eql?('Marke')
|
@@ -330,7 +330,7 @@ module Brand2csv
|
|
330
330
|
end
|
331
331
|
|
332
332
|
if x.children.first.text.eql?('Vertreter/in')
|
333
|
-
hatVertreter =
|
333
|
+
hatVertreter = 'Ja' if x.children[1].text.length > 0
|
334
334
|
end
|
335
335
|
hinterlegungsdatum = x.children[1].text if x.children.first.text.eql?('Hinterlegungsdatum')
|
336
336
|
number = x.children[1].text if x.children.first.text.eql?('Gesuch Nr.')
|
data/lib/brand2csv/version.rb
CHANGED
data/spec/csv_spec.rb
CHANGED
@@ -20,7 +20,7 @@ describe 'Csv' do
|
|
20
20
|
Swissreg::emitCsv(results, file.path)
|
21
21
|
inhalte = IO.readlines(file.path)
|
22
22
|
inhalte[0].chomp.should == 'name;markennummer;inhaber;land;hatVertreter;hinterlegungsdatum;zeile_1;zeile_2;zeile_3;zeile_4;zeile_5;plz;ort'
|
23
|
-
inhalte[1].chomp.should == 'https://www.swissreg.ch/srclient/images/loadImage?Action=LoadImg&ItemType=tm&ImageType=print&ImageHash=F431E13A9D8F363BD06604796634142A18A5BA7C.jpeg;00135/2013;Peter Löcker Bauart, Trollstrasse 20, 8400 Winterthur;Schweiz;
|
23
|
+
inhalte[1].chomp.should == 'https://www.swissreg.ch/srclient/images/loadImage?Action=LoadImg&ItemType=tm&ImageType=print&ImageHash=F431E13A9D8F363BD06604796634142A18A5BA7C.jpeg;00135/2013;Peter Löcker Bauart, Trollstrasse 20, 8400 Winterthur;Schweiz;Nein;13.03.2013;Peter Löcker Bauart;Trollstrasse 20;;;;8400;Winterthur'
|
24
24
|
inhalte[2].should == nil
|
25
25
|
end
|
26
26
|
|
data/spec/swissreg_spec.rb
CHANGED
@@ -18,9 +18,9 @@ describe 'Get some simple example from swissreg' do
|
|
18
18
|
results[0].ort.should == 'Zürich'
|
19
19
|
csv = "#{timespan}.csv"
|
20
20
|
csv_lines = IO.readlines(csv)
|
21
|
-
csv_lines[1].split(';')[HasVertreterPos].should == "
|
22
|
-
csv_lines[2].split(';')[HasVertreterPos].should == "
|
23
|
-
csv_lines[3].split(';')[HasVertreterPos].should == "
|
21
|
+
csv_lines[1].split(';')[HasVertreterPos].should == "Ja"
|
22
|
+
csv_lines[2].split(';')[HasVertreterPos].should == "Ja"
|
23
|
+
csv_lines[3].split(';')[HasVertreterPos].should == "Nein"
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should get correct results from swissreg when owner has two postal addresses" do
|
@@ -38,7 +38,7 @@ describe 'Get some simple example from swissreg' do
|
|
38
38
|
csv = "#{timespan}.csv"
|
39
39
|
csv_lines = IO.readlines(csv)
|
40
40
|
csv_lines[1].split(';')[2].should == 'Philipp Arnold, Seestrasse 37a, 6454 Flüelen'
|
41
|
-
csv_lines[1].split(';')[HasVertreterPos].should == "
|
41
|
+
csv_lines[1].split(';')[HasVertreterPos].should == "Ja"
|
42
42
|
end
|
43
43
|
|
44
44
|
end
|