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,31 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <parties>
3
+ <party>
4
+ <externalId>A</externalId>
5
+ <name>Arbeiderpartiet</name>
6
+ </party>
7
+ <party>
8
+ <externalId>FrP</externalId>
9
+ <name>Fremskrittspartiet</name>
10
+ </party>
11
+ <party>
12
+ <externalId>H</externalId>
13
+ <name>Høyre</name>
14
+ </party>
15
+ <party>
16
+ <externalId>Sp</externalId>
17
+ <name>Senterpartiet</name>
18
+ </party>
19
+ <party>
20
+ <externalId>SV</externalId>
21
+ <name>Sosialistisk Venstreparti</name>
22
+ </party>
23
+ <party>
24
+ <externalId>KrF</externalId>
25
+ <name>Kristelig Folkeparti</name>
26
+ </party>
27
+ <party>
28
+ <externalId>V</externalId>
29
+ <name>Venstre</name>
30
+ </party>
31
+ </parties>