hdo-storting-importer 0.3.6 → 0.3.7
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 +4 -4
- data/lib/hdo/storting_importer/promise.rb +13 -6
- data/lib/hdo/storting_importer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6dd6d7e280a3b4652fdba0b86b7575d1dd9ca4e3
|
|
4
|
+
data.tar.gz: 03ef9bebf0c9ccad233f3ca5065b9b21422bd97c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0b656209a26d71e97d2ac31f9973f9c6632e5404e6518272d4a2bcb431b8b62cb4df86cccf9bb10b849a99eac165809b47602ca828bb0c566899767ad62c0e9
|
|
7
|
+
data.tar.gz: 5a292ad4053c5fdc0fcdf09e0066d410d1551ceb29a084a46b6f0fff8a02d0aa5490c353aa9ef58a01755361ab17151d38a7827f0754746e51868dd755c3cbbb
|
|
@@ -60,19 +60,26 @@ module Hdo
|
|
|
60
60
|
|
|
61
61
|
unless %w[ja nei].include?(general)
|
|
62
62
|
errors << "row #{external_id}: unexpected value #{general.inspect} for general"
|
|
63
|
-
next
|
|
64
63
|
end
|
|
65
64
|
|
|
66
65
|
if page.to_s !~ /^\d+(\.\d+)?$/ || page.to_i == 0
|
|
67
66
|
errors << "row #{external_id}: unexpected value #{page.inspect} for page"
|
|
68
|
-
next
|
|
69
67
|
end
|
|
70
68
|
|
|
71
|
-
|
|
69
|
+
if parties.nil? || parties.empty?
|
|
72
70
|
errors << "row #{external_id}: parties missing"
|
|
73
|
-
next
|
|
74
71
|
end
|
|
75
72
|
|
|
73
|
+
if categories.nil? || categories.empty?
|
|
74
|
+
errors << "row #{external_id}: categories missing"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
unless period
|
|
78
|
+
errors << "row #{external_id}: period is missing"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
next if errors.any?
|
|
82
|
+
|
|
76
83
|
unless body.strip =~ /\.$/
|
|
77
84
|
body = "#{body.strip}."
|
|
78
85
|
end
|
|
@@ -91,7 +98,7 @@ module Hdo
|
|
|
91
98
|
clean_invalid_unicode.call(categories),
|
|
92
99
|
source.strip,
|
|
93
100
|
Integer(page),
|
|
94
|
-
period
|
|
101
|
+
period
|
|
95
102
|
|
|
96
103
|
begin
|
|
97
104
|
promise.validate!
|
|
@@ -165,4 +172,4 @@ module Hdo
|
|
|
165
172
|
|
|
166
173
|
end
|
|
167
174
|
end
|
|
168
|
-
end
|
|
175
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hdo-storting-importer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jari Bakken
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-06-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: builder
|