hdo-storting-importer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/.gitignore +16 -0
  2. data/.gitmodules +3 -0
  3. data/.travis.yml +7 -0
  4. data/Gemfile +8 -0
  5. data/LICENSE +20 -0
  6. data/README.md +14 -0
  7. data/Rakefile +11 -0
  8. data/bin/hdo-converter +7 -0
  9. data/features/import.feature +85 -0
  10. data/features/step_definitions/import_steps.rb +0 -0
  11. data/features/support/env.rb +7 -0
  12. data/hdo-storting-importer.gemspec +17 -0
  13. data/lib/hdo/storting_importer/api_data_source.rb +62 -0
  14. data/lib/hdo/storting_importer/category.rb +55 -0
  15. data/lib/hdo/storting_importer/cli.rb +141 -0
  16. data/lib/hdo/storting_importer/committee.rb +35 -0
  17. data/lib/hdo/storting_importer/converter.rb +45 -0
  18. data/lib/hdo/storting_importer/core_ext/enumerable.rb +12 -0
  19. data/lib/hdo/storting_importer/data_source.rb +22 -0
  20. data/lib/hdo/storting_importer/disk_data_source.rb +61 -0
  21. data/lib/hdo/storting_importer/district.rb +36 -0
  22. data/lib/hdo/storting_importer/issue.rb +90 -0
  23. data/lib/hdo/storting_importer/ivar_equality.rb +22 -0
  24. data/lib/hdo/storting_importer/parsing_data_source.rb +59 -0
  25. data/lib/hdo/storting_importer/party.rb +31 -0
  26. data/lib/hdo/storting_importer/promise.rb +49 -0
  27. data/lib/hdo/storting_importer/promise_converter.rb +48 -0
  28. data/lib/hdo/storting_importer/representative.rb +106 -0
  29. data/lib/hdo/storting_importer/script_importer.rb +20 -0
  30. data/lib/hdo/storting_importer/util.rb +26 -0
  31. data/lib/hdo/storting_importer/version.rb +5 -0
  32. data/lib/hdo/storting_importer/vote.rb +171 -0
  33. data/lib/hdo/storting_importer.rb +41 -0
  34. data/spec/fixtures/input/categories.xml +1351 -0
  35. data/spec/fixtures/input/committees.xml +92 -0
  36. data/spec/fixtures/input/districts.xml +101 -0
  37. data/spec/fixtures/input/issues.xml +2852 -0
  38. data/spec/fixtures/input/parties.xml +42 -0
  39. data/spec/fixtures/input/promises-a.csv +341 -0
  40. data/spec/fixtures/input/propositions_2175.xml +64 -0
  41. data/spec/fixtures/input/propositions_2176.xml +64 -0
  42. data/spec/fixtures/input/representatives.xml +3218 -0
  43. data/spec/fixtures/input/representatives_today.xml +4872 -0
  44. data/spec/fixtures/input/vote_results_2175.xml +4400 -0
  45. data/spec/fixtures/input/vote_results_2176.xml +4400 -0
  46. data/spec/fixtures/input/votes.xml +85 -0
  47. data/spec/fixtures/output/categories.xml +803 -0
  48. data/spec/fixtures/output/committees.xml +71 -0
  49. data/spec/fixtures/output/districts.xml +79 -0
  50. data/spec/fixtures/output/issues.xml +836 -0
  51. data/spec/fixtures/output/parties.xml +31 -0
  52. data/spec/fixtures/output/promises-a.xml +3224 -0
  53. data/spec/fixtures/output/representatives.xml +2567 -0
  54. data/spec/fixtures/output/votes.xml +4899 -0
  55. data/spec/hdo/storting_importer/category_spec.rb +76 -0
  56. data/spec/hdo/storting_importer/committee_spec.rb +46 -0
  57. data/spec/hdo/storting_importer/converter_spec.rb +72 -0
  58. data/spec/hdo/storting_importer/district_spec.rb +54 -0
  59. data/spec/hdo/storting_importer/issue_spec.rb +115 -0
  60. data/spec/hdo/storting_importer/party_spec.rb +52 -0
  61. data/spec/hdo/storting_importer/promise_spec.rb +38 -0
  62. data/spec/hdo/storting_importer/representative_spec.rb +81 -0
  63. data/spec/hdo/storting_importer/vote_spec.rb +155 -0
  64. data/spec/spec_helper.rb +39 -0
  65. metadata +145 -0
@@ -0,0 +1,85 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <sak_votering_oversikt xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://data.stortinget.no">
3
+ <versjon>1.0</versjon>
4
+ <sak_id>51448</sak_id>
5
+ <sak_votering_liste>
6
+ <sak_votering>
7
+ <versjon>1.0</versjon>
8
+ <alternativ_votering_id>-1</alternativ_votering_id>
9
+ <antall_for>2</antall_for>
10
+ <antall_ikke_tilstede>71</antall_ikke_tilstede>
11
+ <antall_mot>96</antall_mot>
12
+ <behandlingsrekkefoelge>1</behandlingsrekkefoelge>
13
+ <dagsorden_sak_nummer>2</dagsorden_sak_nummer>
14
+ <fri_votering>false</fri_votering>
15
+ <kommentar i:nil="true" />
16
+ <personlig_votering>true</personlig_votering>
17
+ <president>
18
+ <versjon>1.0</versjon>
19
+ <doedsdato>0001-01-01T00:00:00</doedsdato>
20
+ <etternavn>Nybakk</etternavn>
21
+ <foedselsdato>1947-02-14T00:00:00</foedselsdato>
22
+ <fornavn>Marit</fornavn>
23
+ <id>MN</id>
24
+ <kjoenn>kvinne</kjoenn>
25
+ <fylke>
26
+ <versjon>1.0</versjon>
27
+ <id>Os</id>
28
+ <navn>Oslo</navn>
29
+ </fylke>
30
+ <parti>
31
+ <versjon>1.0</versjon>
32
+ <id>A</id>
33
+ <navn>Arbeiderpartiet</navn>
34
+ </parti>
35
+ </president>
36
+ <sak_id>51448</sak_id>
37
+ <vedtatt>false</vedtatt>
38
+ <votering_id>2175</votering_id>
39
+ <votering_metode>ikke_spesifisert</votering_metode>
40
+ <votering_resultat_type>ikke_spesifisert</votering_resultat_type>
41
+ <votering_resultat_type_tekst i:nil="true" />
42
+ <votering_tema>Forslag 24 - 26 på vegne av Per Olaf Lundteigen</votering_tema>
43
+ <votering_tid>2012-04-12T16:37:27.053</votering_tid>
44
+ </sak_votering>
45
+ <sak_votering>
46
+ <versjon>1.0</versjon>
47
+ <alternativ_votering_id>-1</alternativ_votering_id>
48
+ <antall_for>2</antall_for>
49
+ <antall_ikke_tilstede>68</antall_ikke_tilstede>
50
+ <antall_mot>99</antall_mot>
51
+ <behandlingsrekkefoelge>1</behandlingsrekkefoelge>
52
+ <dagsorden_sak_nummer>2</dagsorden_sak_nummer>
53
+ <fri_votering>false</fri_votering>
54
+ <kommentar i:nil="true" />
55
+ <personlig_votering>true</personlig_votering>
56
+ <president>
57
+ <versjon>1.0</versjon>
58
+ <doedsdato>0001-01-01T00:00:00</doedsdato>
59
+ <etternavn>Nybakk</etternavn>
60
+ <foedselsdato>1947-02-14T00:00:00</foedselsdato>
61
+ <fornavn>Marit</fornavn>
62
+ <id>MN</id>
63
+ <kjoenn>kvinne</kjoenn>
64
+ <fylke>
65
+ <versjon>1.0</versjon>
66
+ <id>Os</id>
67
+ <navn>Oslo</navn>
68
+ </fylke>
69
+ <parti>
70
+ <versjon>1.0</versjon>
71
+ <id>A</id>
72
+ <navn>Arbeiderpartiet</navn>
73
+ </parti>
74
+ </president>
75
+ <sak_id>51448</sak_id>
76
+ <vedtatt>false</vedtatt>
77
+ <votering_id>2176</votering_id>
78
+ <votering_metode>ikke_spesifisert</votering_metode>
79
+ <votering_resultat_type>ikke_spesifisert</votering_resultat_type>
80
+ <votering_resultat_type_tekst i:nil="true" />
81
+ <votering_tema>Forslag nr. 19, 21 og 22 på vegne av V.</votering_tema>
82
+ <votering_tid>2012-04-12T16:38:22.28</votering_tid>
83
+ </sak_votering>
84
+ </sak_votering_liste>
85
+ </sak_votering_oversikt>