pupa 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/pupa/version.rb +1 -1
- data/schemas/popolo/area.json +3 -3
- data/schemas/popolo/contact_detail.json +2 -2
- data/schemas/popolo/count.json +1 -1
- data/schemas/popolo/group_result.json +1 -1
- data/schemas/popolo/identifier.json +1 -1
- data/schemas/popolo/link.json +1 -1
- data/schemas/popolo/membership.json +9 -9
- data/schemas/popolo/motion.json +5 -5
- data/schemas/popolo/organization.json +10 -10
- data/schemas/popolo/other_name.json +1 -1
- data/schemas/popolo/person.json +7 -7
- data/schemas/popolo/post.json +7 -7
- data/schemas/popolo/vote.json +4 -4
- data/schemas/popolo/vote_event.json +7 -7
- data/spec/processor_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ff448a08241852d405068e030d4b689b45373e0
|
4
|
+
data.tar.gz: 7b1327e204e05de6659155659ac6b3b7c1f3d853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45805c371d13c20c22a600197df6d7a57ff70d6e1323ece52c51b108c7973d379ba2523d91afa7bf39e977a0a7c91538e437ada33be24aecdc83e8535dbe865d
|
7
|
+
data.tar.gz: 66fa473a639735566a13c2c2ad7c782a037865c3f5f38c7da4524f8865f25b0a3fb64c8a0d0687823968a0eadab1c908e3e6eeecd336a1b9c4e5a10bd123c2e6
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Pupa.rb is a Ruby 2.x fork of Sunlight Labs' [Pupa](https://github.com/opencivic
|
|
12
12
|
|
13
13
|
## Usage
|
14
14
|
|
15
|
-
You can scrape any sort of data with Pupa.rb using your own models. You can also use Pupa.rb to scrape people, organizations, memberships and posts according to the [Popolo](http://popoloproject.com/) open government data specification. This gem is up-to-date with Popolo's 2014-05-09 version, but omits the Motion, VoteEvent, Count, Vote and Area classes.
|
15
|
+
You can scrape any sort of data with Pupa.rb using your own models. You can also use Pupa.rb to scrape people, organizations, memberships and posts according to the [Popolo](http://www.popoloproject.com/) open government data specification. This gem is up-to-date with Popolo's 2014-05-09 version, but omits the Motion, VoteEvent, Count, Vote and Area classes.
|
16
16
|
|
17
17
|
The [cat.rb](http://opennorth.github.io/pupa-ruby/docs/cat.html) example shows you how to:
|
18
18
|
|
@@ -97,7 +97,7 @@ Pupa.rb is extensible, so that you can add your own models, parsers, helpers, ac
|
|
97
97
|
|
98
98
|
## [OpenCivicData](http://opencivicdata.org/) compatibility
|
99
99
|
|
100
|
-
Both Pupa.rb and Sunlight Labs' [Pupa](https://github.com/opencivicdata/pupa) implement models for people, organizations and memberships from the [Popolo](http://popoloproject.com/) open government data specification. Pupa.rb lets you use your own classes, but Pupa only supports a fixed set of classes. A consequence of Pupa.rb's flexibility is that the value of the `_type` property for `Person`, `Organization` and `Membership` objects differs between Pupa.rb and Pupa. Pupa.rb has namespaced types like `pupa/person` – to allow Ruby to load the `Person` class in the `Pupa` module – whereas Pupa has unnamespaced types like `person`.
|
100
|
+
Both Pupa.rb and Sunlight Labs' [Pupa](https://github.com/opencivicdata/pupa) implement models for people, organizations and memberships from the [Popolo](http://www.popoloproject.com/) open government data specification. Pupa.rb lets you use your own classes, but Pupa only supports a fixed set of classes. A consequence of Pupa.rb's flexibility is that the value of the `_type` property for `Person`, `Organization` and `Membership` objects differs between Pupa.rb and Pupa. Pupa.rb has namespaced types like `pupa/person` – to allow Ruby to load the `Person` class in the `Pupa` module – whereas Pupa has unnamespaced types like `person`.
|
101
101
|
|
102
102
|
To save objects to MongoDB with unnamespaced types like Sunlight Labs' Pupa – in order to benefit from other tools in the [OpenCivicData](http://opencivicdata.org/) stack – add this line to the top of your script:
|
103
103
|
|
data/lib/pupa/version.rb
CHANGED
data/schemas/popolo/area.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/area.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/area.json#",
|
4
4
|
"title": "Area",
|
5
5
|
"description": "A geographic area whose geometry may change over time",
|
6
6
|
"type": "object",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
},
|
28
28
|
"parent": {
|
29
29
|
"description": "The area that contains this area",
|
30
|
-
"$ref": "http://popoloproject.com/schemas/area.json#"
|
30
|
+
"$ref": "http://www.popoloproject.com/schemas/area.json#"
|
31
31
|
},
|
32
32
|
"geometry": {
|
33
33
|
"description": "A geometry",
|
@@ -47,7 +47,7 @@
|
|
47
47
|
"description": "URLs to documents from which the area is derived",
|
48
48
|
"type": "array",
|
49
49
|
"items": {
|
50
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
50
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
51
51
|
}
|
52
52
|
}
|
53
53
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/contact_detail.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/contact_detail.json#",
|
4
4
|
"title": "Contact detail",
|
5
5
|
"description": "A means of contacting an entity",
|
6
6
|
"type": "object",
|
@@ -47,7 +47,7 @@
|
|
47
47
|
"description": "URLs to documents from which the contact detail is derived",
|
48
48
|
"type": "array",
|
49
49
|
"items": {
|
50
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
50
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
51
51
|
}
|
52
52
|
}
|
53
53
|
}
|
data/schemas/popolo/count.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/count.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/count.json#",
|
4
4
|
"title": "Count",
|
5
5
|
"description": "The number of votes for an option in a vote event",
|
6
6
|
"type": "object",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/group_result.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/group_result.json#",
|
4
4
|
"title": "Group result",
|
5
5
|
"description": "A result of a vote event within a group of voters",
|
6
6
|
"type": "object",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/identifier.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/identifier.json#",
|
4
4
|
"title": "Identifier",
|
5
5
|
"description": "An issued identifier",
|
6
6
|
"type": "object",
|
data/schemas/popolo/link.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/membership.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/membership.json#",
|
4
4
|
"title": "Membership",
|
5
5
|
"description": "A relationship between a member and an organization",
|
6
6
|
"type": "object",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
},
|
28
28
|
"person": {
|
29
29
|
"description": "The person who is a member of the organization",
|
30
|
-
"$ref": "http://popoloproject.com/schemas/person.json#"
|
30
|
+
"$ref": "http://www.popoloproject.com/schemas/person.json#"
|
31
31
|
},
|
32
32
|
"organization_id": {
|
33
33
|
"description": "The ID of the organization in which the person or organization is a member",
|
@@ -35,7 +35,7 @@
|
|
35
35
|
},
|
36
36
|
"organization": {
|
37
37
|
"description": "The organization in which the person or organization is a member",
|
38
|
-
"$ref": "http://popoloproject.com/schemas/organization.json#"
|
38
|
+
"$ref": "http://www.popoloproject.com/schemas/organization.json#"
|
39
39
|
},
|
40
40
|
"post_id": {
|
41
41
|
"description": "The ID of the post held by the member in the organization through this membership",
|
@@ -43,7 +43,7 @@
|
|
43
43
|
},
|
44
44
|
"post": {
|
45
45
|
"description": "The post held by the member in the organization through this membership",
|
46
|
-
"$ref": "http://popoloproject.com/schemas/post.json#"
|
46
|
+
"$ref": "http://www.popoloproject.com/schemas/post.json#"
|
47
47
|
},
|
48
48
|
"on_behalf_of_id": {
|
49
49
|
"description": "The ID of the organization on whose behalf the person is a member of the organization",
|
@@ -51,7 +51,7 @@
|
|
51
51
|
},
|
52
52
|
"on_behalf_of": {
|
53
53
|
"description": "The organization on whose behalf the person is a member of the organization",
|
54
|
-
"$ref": "http://popoloproject.com/schemas/organization.json#"
|
54
|
+
"$ref": "http://www.popoloproject.com/schemas/organization.json#"
|
55
55
|
},
|
56
56
|
"area_id": {
|
57
57
|
"description": "The ID of the geographic area to which this membership is related",
|
@@ -59,7 +59,7 @@
|
|
59
59
|
},
|
60
60
|
"area": {
|
61
61
|
"description": "The geographic area to which this membership is related",
|
62
|
-
"$ref": "http://popoloproject.com/schemas/area.json#"
|
62
|
+
"$ref": "http://www.popoloproject.com/schemas/area.json#"
|
63
63
|
},
|
64
64
|
"start_date": {
|
65
65
|
"description": "The date on which the relationship began",
|
@@ -75,14 +75,14 @@
|
|
75
75
|
"description": "Means of contacting the member of the organization",
|
76
76
|
"type": "array",
|
77
77
|
"items": {
|
78
|
-
"$ref": "http://popoloproject.com/schemas/contact_detail.json#"
|
78
|
+
"$ref": "http://www.popoloproject.com/schemas/contact_detail.json#"
|
79
79
|
}
|
80
80
|
},
|
81
81
|
"links": {
|
82
82
|
"description": "URLs to documents about the membership",
|
83
83
|
"type": "array",
|
84
84
|
"items": {
|
85
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
85
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
86
86
|
}
|
87
87
|
},
|
88
88
|
"created_at": {
|
@@ -99,7 +99,7 @@
|
|
99
99
|
"description": "URLs to documents from which the membership is derived",
|
100
100
|
"type": "array",
|
101
101
|
"items": {
|
102
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
102
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
103
103
|
}
|
104
104
|
}
|
105
105
|
}
|
data/schemas/popolo/motion.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/motion.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/motion.json#",
|
4
4
|
"title": "Motion",
|
5
5
|
"description": "A formal step to introduce a matter for consideration by an organization",
|
6
6
|
"type": "object",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
},
|
16
16
|
"organization": {
|
17
17
|
"description": "The organization in which the motion is proposed",
|
18
|
-
"$ref": "http://popoloproject.com/schemas/organization.json#"
|
18
|
+
"$ref": "http://www.popoloproject.com/schemas/organization.json#"
|
19
19
|
},
|
20
20
|
"legislative_session_id": {
|
21
21
|
"description": "The ID of the legislative session in which the motion is proposed",
|
@@ -31,7 +31,7 @@
|
|
31
31
|
},
|
32
32
|
"creator": {
|
33
33
|
"description": "The person who proposed the motion",
|
34
|
-
"$ref": "http://popoloproject.com/schemas/person.json#"
|
34
|
+
"$ref": "http://www.popoloproject.com/schemas/person.json#"
|
35
35
|
},
|
36
36
|
"text": {
|
37
37
|
"description": "The transcript or text of the motion",
|
@@ -58,7 +58,7 @@
|
|
58
58
|
"description": "Events at which people vote on the motion",
|
59
59
|
"type": "array",
|
60
60
|
"items": {
|
61
|
-
"$ref": "http://popoloproject.com/schemas/vote_event.json#"
|
61
|
+
"$ref": "http://www.popoloproject.com/schemas/vote_event.json#"
|
62
62
|
}
|
63
63
|
},
|
64
64
|
"created_at": {
|
@@ -75,7 +75,7 @@
|
|
75
75
|
"description": "URLs to documents from which the motion is derived",
|
76
76
|
"type": "array",
|
77
77
|
"items": {
|
78
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
78
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
79
79
|
}
|
80
80
|
}
|
81
81
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/organization.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/organization.json#",
|
4
4
|
"title": "Organization",
|
5
5
|
"description": "A group with a common purpose or reason for existence that goes beyond the set of people belonging to it",
|
6
6
|
"type": "object",
|
@@ -17,14 +17,14 @@
|
|
17
17
|
"description": "Alternate or former names",
|
18
18
|
"type": "array",
|
19
19
|
"items": {
|
20
|
-
"$ref": "http://popoloproject.com/schemas/other_name.json#"
|
20
|
+
"$ref": "http://www.popoloproject.com/schemas/other_name.json#"
|
21
21
|
}
|
22
22
|
},
|
23
23
|
"identifiers": {
|
24
24
|
"description": "Issued identifiers",
|
25
25
|
"type": "array",
|
26
26
|
"items": {
|
27
|
-
"$ref": "http://popoloproject.com/schemas/identifier.json#"
|
27
|
+
"$ref": "http://www.popoloproject.com/schemas/identifier.json#"
|
28
28
|
}
|
29
29
|
},
|
30
30
|
"classification": {
|
@@ -37,7 +37,7 @@
|
|
37
37
|
},
|
38
38
|
"parent": {
|
39
39
|
"description": "The organization that contains this organization",
|
40
|
-
"$ref": "http://popoloproject.com/schemas/organization.json#"
|
40
|
+
"$ref": "http://www.popoloproject.com/schemas/organization.json#"
|
41
41
|
},
|
42
42
|
"area_id": {
|
43
43
|
"description": "The ID of the geographic area to which this organization is related",
|
@@ -45,7 +45,7 @@
|
|
45
45
|
},
|
46
46
|
"area": {
|
47
47
|
"description": "The geographic area to which this organization is related",
|
48
|
-
"$ref": "http://popoloproject.com/schemas/area.json#"
|
48
|
+
"$ref": "http://www.popoloproject.com/schemas/area.json#"
|
49
49
|
},
|
50
50
|
"founding_date": {
|
51
51
|
"description": "A date of founding",
|
@@ -66,28 +66,28 @@
|
|
66
66
|
"description": "Means of contacting the organization",
|
67
67
|
"type": "array",
|
68
68
|
"items": {
|
69
|
-
"$ref": "http://popoloproject.com/schemas/contact_detail.json#"
|
69
|
+
"$ref": "http://www.popoloproject.com/schemas/contact_detail.json#"
|
70
70
|
}
|
71
71
|
},
|
72
72
|
"links": {
|
73
73
|
"description": "URLs to documents about the organization",
|
74
74
|
"type": "array",
|
75
75
|
"items": {
|
76
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
76
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
77
77
|
}
|
78
78
|
},
|
79
79
|
"memberships": {
|
80
80
|
"description": "Memberships",
|
81
81
|
"type": "array",
|
82
82
|
"items": {
|
83
|
-
"$ref": "http://popoloproject.com/schemas/membership.json#"
|
83
|
+
"$ref": "http://www.popoloproject.com/schemas/membership.json#"
|
84
84
|
}
|
85
85
|
},
|
86
86
|
"posts": {
|
87
87
|
"description": "Posts within the organization",
|
88
88
|
"type": "array",
|
89
89
|
"items": {
|
90
|
-
"$ref": "http://popoloproject.com/schemas/post.json#"
|
90
|
+
"$ref": "http://www.popoloproject.com/schemas/post.json#"
|
91
91
|
}
|
92
92
|
},
|
93
93
|
"created_at": {
|
@@ -104,7 +104,7 @@
|
|
104
104
|
"description": "URLs to documents from which the organization is derived",
|
105
105
|
"type": "array",
|
106
106
|
"items": {
|
107
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
107
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
108
108
|
}
|
109
109
|
}
|
110
110
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/other_name.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/other_name.json#",
|
4
4
|
"title": "Other name",
|
5
5
|
"description": "An alternate or former name",
|
6
6
|
"type": "object",
|
data/schemas/popolo/person.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/person.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/person.json#",
|
4
4
|
"title": "Person",
|
5
5
|
"description": "A real person, alive or dead",
|
6
6
|
"type": "object",
|
@@ -17,14 +17,14 @@
|
|
17
17
|
"description": "Alternate or former names",
|
18
18
|
"type": "array",
|
19
19
|
"items": {
|
20
|
-
"$ref": "http://popoloproject.com/schemas/other_name.json#"
|
20
|
+
"$ref": "http://www.popoloproject.com/schemas/other_name.json#"
|
21
21
|
}
|
22
22
|
},
|
23
23
|
"identifiers": {
|
24
24
|
"description": "Issued identifiers",
|
25
25
|
"type": "array",
|
26
26
|
"items": {
|
27
|
-
"$ref": "http://popoloproject.com/schemas/identifier.json#"
|
27
|
+
"$ref": "http://www.popoloproject.com/schemas/identifier.json#"
|
28
28
|
}
|
29
29
|
},
|
30
30
|
"family_name": {
|
@@ -95,21 +95,21 @@
|
|
95
95
|
"description": "Means of contacting the person",
|
96
96
|
"type": "array",
|
97
97
|
"items": {
|
98
|
-
"$ref": "http://popoloproject.com/schemas/contact_detail.json#"
|
98
|
+
"$ref": "http://www.popoloproject.com/schemas/contact_detail.json#"
|
99
99
|
}
|
100
100
|
},
|
101
101
|
"links": {
|
102
102
|
"description": "URLs to documents about the person",
|
103
103
|
"type": "array",
|
104
104
|
"items": {
|
105
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
105
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
106
106
|
}
|
107
107
|
},
|
108
108
|
"memberships": {
|
109
109
|
"description": "Memberships",
|
110
110
|
"type": "array",
|
111
111
|
"items": {
|
112
|
-
"$ref": "http://popoloproject.com/schemas/membership.json#"
|
112
|
+
"$ref": "http://www.popoloproject.com/schemas/membership.json#"
|
113
113
|
}
|
114
114
|
},
|
115
115
|
"created_at": {
|
@@ -126,7 +126,7 @@
|
|
126
126
|
"description": "URLs to documents from which the person is derived",
|
127
127
|
"type": "array",
|
128
128
|
"items": {
|
129
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
129
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
130
130
|
}
|
131
131
|
}
|
132
132
|
}
|
data/schemas/popolo/post.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/post.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/post.json#",
|
4
4
|
"title": "Post",
|
5
5
|
"description": "A position that exists independent of the person holding it",
|
6
6
|
"type": "object",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
},
|
31
31
|
"organization": {
|
32
32
|
"description": "The organization in which the post is held",
|
33
|
-
"$ref": "http://popoloproject.com/schemas/organization.json#"
|
33
|
+
"$ref": "http://www.popoloproject.com/schemas/organization.json#"
|
34
34
|
},
|
35
35
|
"area_id": {
|
36
36
|
"description": "The ID of the geographic area to which this post is related",
|
@@ -38,7 +38,7 @@
|
|
38
38
|
},
|
39
39
|
"area": {
|
40
40
|
"description": "The geographic area to which this post is related",
|
41
|
-
"$ref": "http://popoloproject.com/schemas/area.json#"
|
41
|
+
"$ref": "http://www.popoloproject.com/schemas/area.json#"
|
42
42
|
},
|
43
43
|
"start_date": {
|
44
44
|
"description": "The date on which the post was created",
|
@@ -54,21 +54,21 @@
|
|
54
54
|
"description": "Means of contacting the holder of the post",
|
55
55
|
"type": "array",
|
56
56
|
"items": {
|
57
|
-
"$ref": "http://popoloproject.com/schemas/contact_detail.json#"
|
57
|
+
"$ref": "http://www.popoloproject.com/schemas/contact_detail.json#"
|
58
58
|
}
|
59
59
|
},
|
60
60
|
"links": {
|
61
61
|
"description": "URLs to documents about the post",
|
62
62
|
"type": "array",
|
63
63
|
"items": {
|
64
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
64
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
65
65
|
}
|
66
66
|
},
|
67
67
|
"memberships": {
|
68
68
|
"description": "The memberships through which people hold the post in the organization",
|
69
69
|
"type": "array",
|
70
70
|
"items": {
|
71
|
-
"$ref": "http://popoloproject.com/schemas/membership.json#"
|
71
|
+
"$ref": "http://www.popoloproject.com/schemas/membership.json#"
|
72
72
|
}
|
73
73
|
},
|
74
74
|
"created_at": {
|
@@ -85,7 +85,7 @@
|
|
85
85
|
"description": "URLs to documents from which the post is derived",
|
86
86
|
"type": "array",
|
87
87
|
"items": {
|
88
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
88
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
89
89
|
}
|
90
90
|
}
|
91
91
|
}
|
data/schemas/popolo/vote.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/vote.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/vote.json#",
|
4
4
|
"title": "Vote",
|
5
5
|
"description": "A voter's vote in a vote event",
|
6
6
|
"type": "object",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
},
|
16
16
|
"vote_event": {
|
17
17
|
"description": "A vote event",
|
18
|
-
"$ref": "http://popoloproject.com/schemas/vote_event.json#"
|
18
|
+
"$ref": "http://www.popoloproject.com/schemas/vote_event.json#"
|
19
19
|
},
|
20
20
|
"voter_id": {
|
21
21
|
"description": "The ID of the person or organization that is voting",
|
@@ -35,7 +35,7 @@
|
|
35
35
|
},
|
36
36
|
"group": {
|
37
37
|
"description": "The voter's primary political group",
|
38
|
-
"$ref": "http://popoloproject.com/schemas/organization.json#"
|
38
|
+
"$ref": "http://www.popoloproject.com/schemas/organization.json#"
|
39
39
|
},
|
40
40
|
"role": {
|
41
41
|
"description": "The voter's role in the event",
|
@@ -51,7 +51,7 @@
|
|
51
51
|
},
|
52
52
|
"pair": {
|
53
53
|
"description": "The person with whom the voter is paired",
|
54
|
-
"$ref": "http://popoloproject.com/schemas/person.json#"
|
54
|
+
"$ref": "http://www.popoloproject.com/schemas/person.json#"
|
55
55
|
}
|
56
56
|
}
|
57
57
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "http://json-schema.org/draft-03/schema#",
|
3
|
-
"id": "http://popoloproject.com/schemas/vote_event.json#",
|
3
|
+
"id": "http://www.popoloproject.com/schemas/vote_event.json#",
|
4
4
|
"title": "Vote event",
|
5
5
|
"description": "An event at which people's votes are recorded",
|
6
6
|
"type": "object",
|
@@ -19,7 +19,7 @@
|
|
19
19
|
},
|
20
20
|
"motion": {
|
21
21
|
"description": "The motion being decided",
|
22
|
-
"$ref": "http://popoloproject.com/schemas/motion.json#"
|
22
|
+
"$ref": "http://www.popoloproject.com/schemas/motion.json#"
|
23
23
|
},
|
24
24
|
"organization_id": {
|
25
25
|
"description": "The ID of the organization whose members are voting",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
},
|
28
28
|
"organization": {
|
29
29
|
"description": "The organization whose members are voting",
|
30
|
-
"$ref": "http://popoloproject.com/schemas/organization.json#"
|
30
|
+
"$ref": "http://www.popoloproject.com/schemas/organization.json#"
|
31
31
|
},
|
32
32
|
"legislative_session_id": {
|
33
33
|
"description": "The ID of the legislative session in which the vote occurs",
|
@@ -55,21 +55,21 @@
|
|
55
55
|
"description": "The result of the vote event within groups of voters",
|
56
56
|
"type": "array",
|
57
57
|
"items": {
|
58
|
-
"$ref": "http://popoloproject.com/schemas/group_result.json#"
|
58
|
+
"$ref": "http://www.popoloproject.com/schemas/group_result.json#"
|
59
59
|
}
|
60
60
|
},
|
61
61
|
"counts": {
|
62
62
|
"description": "The number of votes for options",
|
63
63
|
"type": "array",
|
64
64
|
"items": {
|
65
|
-
"$ref": "http://popoloproject.com/schemas/count.json#"
|
65
|
+
"$ref": "http://www.popoloproject.com/schemas/count.json#"
|
66
66
|
}
|
67
67
|
},
|
68
68
|
"votes": {
|
69
69
|
"description": "Voters' votes",
|
70
70
|
"type": "array",
|
71
71
|
"items": {
|
72
|
-
"$ref": "http://popoloproject.com/schemas/vote.json#"
|
72
|
+
"$ref": "http://www.popoloproject.com/schemas/vote.json#"
|
73
73
|
}
|
74
74
|
},
|
75
75
|
"created_at": {
|
@@ -86,7 +86,7 @@
|
|
86
86
|
"description": "URLs to documents from which the vote event is derived",
|
87
87
|
"type": "array",
|
88
88
|
"items": {
|
89
|
-
"$ref": "http://popoloproject.com/schemas/link.json#"
|
89
|
+
"$ref": "http://www.popoloproject.com/schemas/link.json#"
|
90
90
|
}
|
91
91
|
}
|
92
92
|
}
|
data/spec/processor_spec.rb
CHANGED
@@ -80,19 +80,19 @@ describe Pupa::Processor do
|
|
80
80
|
it 'should dump a JSON document' do
|
81
81
|
processor.dump_scraped_objects(:people)
|
82
82
|
File.exist?(path).should == true
|
83
|
-
io.string.should_not match('http://popoloproject.com/schemas/person.json')
|
83
|
+
io.string.should_not match('http://www.popoloproject.com/schemas/person.json')
|
84
84
|
end
|
85
85
|
|
86
86
|
it 'should validate the object' do
|
87
87
|
processor.make_person_invalid
|
88
88
|
processor.dump_scraped_objects(:people)
|
89
|
-
io.string.should match('http://popoloproject.com/schemas/person.json')
|
89
|
+
io.string.should match('http://www.popoloproject.com/schemas/person.json')
|
90
90
|
end
|
91
91
|
|
92
92
|
it 'should not validate the object' do
|
93
93
|
novalidate.make_person_invalid
|
94
94
|
novalidate.dump_scraped_objects(:people)
|
95
|
-
io.string.should_not match('http://popoloproject.com/schemas/person.json')
|
95
|
+
io.string.should_not match('http://www.popoloproject.com/schemas/person.json')
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pupa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Open North
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|