hdo-storting-importer 0.5.7 → 0.5.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: 3c84c68937cad8fc60f41a854c96563f4636432e
4
- data.tar.gz: 6c018689a03459290880cedc6327e998003b5a92
3
+ metadata.gz: ee6237e304ec169aee02aab0d0618a741eb3f115
4
+ data.tar.gz: f2c6313359d9090cde4daaef2861290b65d3dfb3
5
5
  SHA512:
6
- metadata.gz: beabc7770b26f7010682b7578f0ef8df848d424ac3391d06fea0066c835880ec5ce416db7ec03f6d0c0b9712fb3c31d06422a006af1b4e08262c57fffd7200f9
7
- data.tar.gz: f49cfe73e20c27db2114633806d6a71b6a921bfcd12fb9e7f098b8928e9a49a0165dc495aff6ef6c2f23d0adc5b4b39dfa7f9d632ec2548f52f96c30aaa8b841
6
+ metadata.gz: 5d86212acfc14acc08615a983c4f48ff145098c110e8a45d3c8fe65db67418baad498de2bdc8196dd6fee828adb4ac096453f863c85083ed6ad2ddf8885df574
7
+ data.tar.gz: ace3798c59cb6ffe14ca47e370c94a8777ee48e18182cef4228f7bc94b145b87a43057167d498460fb5bd5337c901617af90fcea26b008ca794db27b430f53b7
@@ -57,6 +57,10 @@
57
57
  "type": "string",
58
58
  "description": "Not entirely what sure this is at the moment."
59
59
  },
60
+ "comment": {
61
+ "type": "string",
62
+ "description": "A comment for the vote (usually to make corrections)"
63
+ },
60
64
  "representatives": {
61
65
  "type": "array",
62
66
  "description": "An array of each representative's vote. The object should contain a set of <a href='#input-format-representative'>hdo#representative</a> objects with the property 'vote_result' added, for which valid values are 'for', 'against', 'absent'.",
@@ -1,5 +1,5 @@
1
1
  module Hdo
2
2
  module StortingImporter
3
- VERSION = "0.5.7"
3
+ VERSION = "0.5.8"
4
4
  end
5
5
  end
@@ -8,7 +8,7 @@ module Hdo
8
8
  include Inspectable
9
9
 
10
10
  attr_reader :external_id, :external_issue_id, :personal, :enacted, :subject,
11
- :method_name, :result_type, :time, :counts
11
+ :method_name, :result_type, :time, :counts, :comment
12
12
  attr_accessor :propositions, :representatives
13
13
 
14
14
  alias_method :personal?, :personal
@@ -17,7 +17,7 @@ module Hdo
17
17
  schema_path StortingImporter.lib.join("hdo/storting_importer/schema/vote.json").to_s
18
18
 
19
19
  def self.example(overrides = nil)
20
- vote = new('2175', '51448', true, false, 'Forslag 24 - 26 på vegne av Per Olaf Lundteigen', 'ikke_spesifisert', 'ikke_spesifisert', '2012-04-12T16:37:27.053', 2, 96, 71)
20
+ vote = new('2175', '51448', true, false, 'Forslag 24 - 26 på vegne av Per Olaf Lundteigen', 'ikke_spesifisert', 'ikke_spesifisert', '2012-04-12T16:37:27.053', 2, 96, 71, 'hei')
21
21
 
22
22
  rep = Representative.example
23
23
  rep.vote_result = 'for'
@@ -49,6 +49,7 @@ module Hdo
49
49
  method = vote_node.css("votering_metode").text
50
50
  result_type = vote_node.css("votering_resultat_type").text
51
51
  time = vote_node.css("votering_tid").text
52
+ comment = vote_node.css('kommentar').text
52
53
 
53
54
  forc = Integer(vote_node.css("antall_for").text)
54
55
  againstc = Integer(vote_node.css("antall_mot").text)
@@ -59,7 +60,7 @@ module Hdo
59
60
  againstc = 0 if againstc < 0
60
61
  absentc = 0 if absentc < 0
61
62
 
62
- new vote_id, issue_id, personal, enacted, subject, method, result_type, time, forc, againstc, absentc
63
+ new vote_id, issue_id, personal, enacted, subject, method, result_type, time, forc, againstc, absentc, comment
63
64
  end
64
65
  end
65
66
 
@@ -78,6 +79,7 @@ module Hdo
78
79
  counts && counts["for"],
79
80
  counts && counts["against"],
80
81
  counts && counts["absent"],
82
+ hash["comment"],
81
83
  ]
82
84
 
83
85
  vote = new(*args)
@@ -87,7 +89,7 @@ module Hdo
87
89
  vote
88
90
  end
89
91
 
90
- def initialize(external_id, external_issue_id, personal, enacted, subject, method_name, result_type, time, for_count, against_count, absent_count)
92
+ def initialize(external_id, external_issue_id, personal, enacted, subject, method_name, result_type, time, for_count, against_count, absent_count, comment)
91
93
  @external_id = external_id
92
94
  @external_issue_id = external_issue_id
93
95
  @personal = personal
@@ -96,6 +98,7 @@ module Hdo
96
98
  @method_name = method_name
97
99
  @result_type = result_type
98
100
  @time = time
101
+ @comment = comment
99
102
  @counts = Counts.new(Integer(for_count || 0), Integer(against_count || 0), Integer(absent_count || 0))
100
103
 
101
104
  @propositions = []
@@ -144,6 +147,7 @@ module Hdo
144
147
  'method' => @method_name,
145
148
  'result_type' => @result_type,
146
149
  'time' => @time,
150
+ 'comment' => @comment,
147
151
  'representatives' => @representatives.map(&:to_hash),
148
152
  'propositions' => @propositions.map(&:to_hash)
149
153
  }
@@ -24,7 +24,7 @@ module Hdo
24
24
  <behandlingsrekkefoelge>1</behandlingsrekkefoelge>
25
25
  <dagsorden_sak_nummer>2</dagsorden_sak_nummer>
26
26
  <fri_votering>false</fri_votering>
27
- <kommentar i:nil="true" />
27
+ <kommentar>Dette gikk fint.</kommentar>
28
28
  <personlig_votering>true</personlig_votering>
29
29
  <president>
30
30
  <versjon>1.0</versjon>
@@ -73,6 +73,7 @@ module Hdo
73
73
  vote.counts.for.should == 2
74
74
  vote.counts.against.should == 96
75
75
  vote.counts.absent.should == 71
76
+ vote.comment.should == 'Dette gikk fint.'
76
77
  end
77
78
 
78
79
  it 'can serialize as JSON' do
@@ -92,6 +93,7 @@ module Hdo
92
93
  "method": "ikke_spesifisert",
93
94
  "result_type": "ikke_spesifisert",
94
95
  "time": "2012-04-12T16:37:27.053",
96
+ "comment": "hei",
95
97
  "representatives": [
96
98
  {
97
99
  "kind": "hdo#representative",
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.5.7
4
+ version: 0.5.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: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2016-06-01 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.2.0
350
+ rubygems_version: 2.4.5
351
351
  signing_key:
352
352
  specification_version: 4
353
353
  summary: Gem to process data from data.stortinget.no
@@ -372,4 +372,3 @@ test_files:
372
372
  - spec/spec_helper.rb
373
373
  - spec/support/shared_examples_for_json_schema.rb
374
374
  - spec/support/shared_examples_for_short_inspect.rb
375
- has_rdoc: