hdo-storting-importer 0.3.7 → 0.3.8
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5af832dfe75f36ebe57837c1765372a3006db7ce
|
4
|
+
data.tar.gz: 188fc6fa520a69fa71e3fc062bcfdc35942e8dc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f0014cc7fc871d881a6bd035d346a340cc475dc856e93690f925726f365041943072f9e01fd49e1a2f0a4e774b9f16fe008e47aae0f4006c09f0125e1074163
|
7
|
+
data.tar.gz: c05a862e059dfa37ac2e6d7a2b95b144e156429c17427d850877ede306996b56c680adefec25e93cfb952c912d398941c6e1c9e2cf4541ad41a9ad506748f256
|
data/.travis.yml
CHANGED
@@ -41,12 +41,11 @@ module Hdo
|
|
41
41
|
attr_reader :schema
|
42
42
|
|
43
43
|
def schema_path(path)
|
44
|
-
@
|
45
|
-
HasJsonSchema.schemas << @schema
|
44
|
+
@schema_path = path
|
46
45
|
end
|
47
46
|
|
48
47
|
def schema
|
49
|
-
@schema
|
48
|
+
@schema ||= load_schema
|
50
49
|
end
|
51
50
|
|
52
51
|
def json_example
|
@@ -95,6 +94,17 @@ module Hdo
|
|
95
94
|
rescue Jschematic::ValidationError => ex
|
96
95
|
raise ValidationError, "#{ex.message}: #{e.inspect}"
|
97
96
|
end
|
97
|
+
|
98
|
+
private
|
99
|
+
|
100
|
+
def load_schema
|
101
|
+
@schema_path or raise "schema must be set with #{self}.schema_path"
|
102
|
+
|
103
|
+
schema = MultiJson.decode(File.read(@schema_path))
|
104
|
+
HasJsonSchema.schemas << schema
|
105
|
+
|
106
|
+
schema
|
107
|
+
end
|
98
108
|
end
|
99
109
|
|
100
110
|
end
|
@@ -38,7 +38,14 @@ module Hdo
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def self.from_xlsx(path)
|
41
|
-
|
41
|
+
from_spreadsheet Roo::Excelx.new(path)
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.from_xls(path)
|
45
|
+
from_spreadsheet Roo::Excel.new(path)
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.from_spreadsheet(table)
|
42
49
|
raise "empty spreadsheet" unless table.first_row
|
43
50
|
|
44
51
|
errors = []
|
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.8
|
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-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -347,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
347
347
|
version: '0'
|
348
348
|
requirements: []
|
349
349
|
rubyforge_project:
|
350
|
-
rubygems_version: 2.0.
|
350
|
+
rubygems_version: 2.0.7
|
351
351
|
signing_key:
|
352
352
|
specification_version: 4
|
353
353
|
summary: Gem to process data from data.stortinget.no
|