everypolitician-popolo 0.5.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -51
- data/.rubocop_todo.yml +25 -1
- data/CHANGELOG.md +23 -1
- data/Gemfile +0 -1
- data/README.md +26 -3
- data/lib/everypolitician/popolo/entity.rb +4 -0
- data/lib/everypolitician/popolo/person.rb +0 -4
- data/lib/everypolitician/popolo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 262682eaaa9963c7749cd96f5a5134fab88e815f
|
4
|
+
data.tar.gz: 3d90b328a132fba3ea0a3d2100f5a00e585dd1b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29f9a20d955a4281608a4482fc8374c5dee19d75c0b040f6f7a46aeaa70715c1104000b6c074655394c48717226bffd755396d873a6a56bd946f146649fd5786
|
7
|
+
data.tar.gz: 593e9de9b997aa687a2e3967918938ed49a30b2964953e772b3fd7dd0369d0caf4462f8c0765a769c6e21f8d6e4ec0bed0e75328276f1dcb2dc2e6bc9d574dc9
|
data/.rubocop.yml
CHANGED
@@ -1,53 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
inherit_from:
|
2
|
+
- https://raw.githubusercontent.com/everypolitician/everypolitician-data/master/.rubocop_base.yml
|
3
|
+
- .rubocop_todo.yml
|
4
4
|
|
5
|
-
Style/ClassAndModuleCamelCase:
|
6
|
-
Enabled: false
|
7
5
|
|
8
|
-
Style/CollectionMethods:
|
9
|
-
Enabled: true
|
10
|
-
|
11
|
-
Style/Documentation:
|
12
|
-
Enabled: false
|
13
|
-
|
14
|
-
Style/FormatString:
|
15
|
-
EnforcedStyle: percent
|
16
|
-
|
17
|
-
Style/HashSyntax:
|
18
|
-
EnforcedStyle: ruby19_no_mixed_keys
|
19
|
-
|
20
|
-
Style/RescueModifier:
|
21
|
-
Enabled: false
|
22
|
-
|
23
|
-
Style/SignalException:
|
24
|
-
Enabled: false
|
25
|
-
|
26
|
-
Style/SymbolArray:
|
27
|
-
Enabled: true
|
28
|
-
|
29
|
-
Style/TrailingCommaInLiteral:
|
30
|
-
EnforcedStyleForMultiline: consistent_comma
|
31
|
-
|
32
|
-
|
33
|
-
Metrics/ClassLength:
|
34
|
-
Max: 250
|
35
|
-
|
36
|
-
Metrics/MethodLength:
|
37
|
-
Max: 20
|
38
|
-
|
39
|
-
Metrics/LineLength:
|
40
|
-
Max: 150
|
41
|
-
|
42
|
-
Metrics/AbcSize:
|
43
|
-
Max: 50
|
44
|
-
|
45
|
-
Metrics/CyclomaticComplexity:
|
46
|
-
Max: 7
|
47
|
-
|
48
|
-
Metrics/PerceivedComplexity:
|
49
|
-
Max: 8
|
50
|
-
|
51
|
-
|
52
|
-
# Temporarily! (2016-08-01)
|
53
|
-
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
CHANGED
@@ -1,7 +1,31 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2016-08-
|
3
|
+
# on 2016-08-08 18:05:16 +0100 using RuboCop version 0.42.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
Metrics/AbcSize:
|
11
|
+
Max: 21
|
12
|
+
|
13
|
+
# Offense count: 1
|
14
|
+
# Configuration parameters: CountComments.
|
15
|
+
Metrics/ClassLength:
|
16
|
+
Max: 164
|
17
|
+
|
18
|
+
# Offense count: 2
|
19
|
+
Metrics/CyclomaticComplexity:
|
20
|
+
Max: 7
|
21
|
+
|
22
|
+
# Offense count: 42
|
23
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
24
|
+
# URISchemes: http, https
|
25
|
+
Metrics/LineLength:
|
26
|
+
Max: 148
|
27
|
+
|
28
|
+
# Offense count: 3
|
29
|
+
# Configuration parameters: CountComments.
|
30
|
+
Metrics/MethodLength:
|
31
|
+
Max: 19
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,24 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## [0.6.1] - 2016-09-12
|
7
|
+
|
8
|
+
### Fixes
|
9
|
+
|
10
|
+
- Version 0.6.0 was accidentally tagged at the wrong (broken) point in history,
|
11
|
+
which included a broken fix for removing the `id` prefix from entities
|
12
|
+
([#48](https://github.com/everypolitician/everypolitician-popolo/pull/48)),
|
13
|
+
but not the pull request reverting that change
|
14
|
+
([#49](https://github.com/everypolitician/everypolitician-popolo/pull/49)).
|
15
|
+
0.6.0 has been yanked from RubyGems and we recommend using version 0.6.1.
|
16
|
+
|
17
|
+
## [0.6.0] (yanked from RubyGems.org) - 2016-09-03
|
18
|
+
|
19
|
+
### Fixed
|
20
|
+
|
21
|
+
- `Entitiy#identifiers` will now return an empty list if no identifiers
|
22
|
+
exist, rather than blowing up.
|
23
|
+
|
6
24
|
## [0.5.0] - 2016-08-01
|
7
25
|
|
8
26
|
### Added
|
@@ -52,4 +70,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
52
70
|
|
53
71
|
[0.2.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.1.0...v0.2.0
|
54
72
|
[0.3.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.2.0...v0.3.0
|
55
|
-
[0.3.
|
73
|
+
[0.3.1]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.3.0...v0.3.1
|
74
|
+
[0.3.2]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.3.1...v0.3.2
|
75
|
+
[0.4.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.3.0...v0.4.0
|
76
|
+
[0.5.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.4.0...v0.5.0
|
77
|
+
[0.6.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.5.0...v0.6.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Everypolitician::Popolo
|
2
2
|
|
3
|
-
[EveryPolitician](http://everypolitician.org) provides its data in [Popolo](http://www.popoloproject.com/) format. If you want to interact with this data from Ruby then this library
|
3
|
+
[EveryPolitician](http://everypolitician.org) provides its data in [Popolo](http://www.popoloproject.com/) format. If you want to interact with this data from Ruby then this library makes that task simpler.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,7 +20,9 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
You
|
23
|
+
You can download a Popolo file manually from [EveryPolitician](http://everypolitician.org/)
|
24
|
+
(although there's [another library](#see-also-everypolitician-ruby)
|
25
|
+
if you want to automate that). The following example uses [Åland Lagting](https://github.com/everypolitician/everypolitician-data/raw/master/data/Aland/Lagting/ep-popolo-v1.0.json) (which is the legislature of the Åland islands,
|
24
26
|
available as JSON data from the
|
25
27
|
[EveryPolitician page for Åland](http://everypolitician.org/aland/)).
|
26
28
|
|
@@ -53,7 +55,7 @@ person.wikidata # => "Q4934081"
|
|
53
55
|
You can also find individual records or collections based on their attributes:
|
54
56
|
|
55
57
|
```ruby
|
56
|
-
popolo.persons.find_by(name: "Aaltonen Carina"
|
58
|
+
popolo.persons.find_by(name: "Aaltonen Carina")
|
57
59
|
# => #<Everypolitician::Popolo::Person:0x0000000237dfc8
|
58
60
|
# @document={:id=>"0c705344-23aa-4fa2-9391-af41c1c775b7",
|
59
61
|
# :identifiers=>[{:identifier=>"Q4934081", :scheme=>"wikidata"}],
|
@@ -72,6 +74,27 @@ popolo.organizations.where(classification: "party")
|
|
72
74
|
# ]
|
73
75
|
```
|
74
76
|
|
77
|
+
### See also: everypolitician-ruby
|
78
|
+
|
79
|
+
In the example above, the Popolo data comes from a downloaded file
|
80
|
+
(`ep-popolo-v1.0.json`), which is the kind of file you can get from the
|
81
|
+
[EveryPolitician website](http://everypolitician.org).
|
82
|
+
But your Ruby application can also interact directly with the EveryPolitician
|
83
|
+
data using the
|
84
|
+
[everypolitician-ruby gem](http://github.com/everypolitician/everypolitician-ruby),
|
85
|
+
so you don't need to handle JSON files at all. The data the gem returns is in
|
86
|
+
`Everypolitician::Popolo` format.
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
require 'everypolitician'
|
90
|
+
|
91
|
+
australia = Everypolitician::Index.new.country('Australia')
|
92
|
+
australia.code # => "AU"
|
93
|
+
senate = australia.legislature('Senate')
|
94
|
+
senate.persons.find_by(name: "Aden Ridgeway")
|
95
|
+
```
|
96
|
+
|
97
|
+
|
75
98
|
## Development
|
76
99
|
|
77
100
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|