hdo-storting-importer 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,7 +44,7 @@ module Hdo
44
44
  fetch "eksport/emner"
45
45
  end
46
46
 
47
- def issues(session_id = DEFAULT_SESSION)
47
+ def parliament_issues(session_id = DEFAULT_SESSION)
48
48
  fetch "eksport/saker?sesjonid=#{session_id}"
49
49
  end
50
50
 
@@ -77,17 +77,9 @@ module Hdo
77
77
  end
78
78
 
79
79
  def read_promises
80
- csvs = @files.any? ? @files : Dir[StortingImporter.root.join('data/promises-*.csv').to_s].sort_by { |e| File.basename(e) }
81
- content = ''
82
- csvs.each do |csv|
83
- if csv =~ /^http/
84
- content << open(csv).read
85
- else
86
- content << File.read(File.expand_path(csv))
87
- end
88
- end
80
+ file = @files.first or raise "no spreadsheet given"
89
81
 
90
- Util.json_pretty Promise.from_csv(content)
82
+ Util.json_pretty Promise.from_xlsx(file)
91
83
  end
92
84
 
93
85
  end
@@ -22,7 +22,7 @@ module Hdo
22
22
  fetch "eksport/emner/index.html"
23
23
  end
24
24
 
25
- def issues(session_id = DEFAULT_SESSION)
25
+ def parliament_issues(session_id = DEFAULT_SESSION)
26
26
  fetch "eksport/saker/index.html?sesjonid=#{session_id}"
27
27
  end
28
28
 
@@ -1,5 +1,5 @@
1
1
  module Hdo
2
2
  module StortingImporter
3
- VERSION = "0.1.9"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hdo-storting-importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: