iraq_unrest 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/CHANGELOG.md +8 -0
- data/README.md +15 -6
- data/Rakefile +2 -0
- data/examples/example_01.png +0 -0
- data/examples/example_02.png +0 -0
- data/examples/example_03.png +0 -0
- data/iraq_unrest.gemspec +1 -3
- data/lib/iraq_unrest/format.rb +0 -7
- data/lib/iraq_unrest/serializers.rb +0 -2
- data/lib/iraq_unrest/version.rb +1 -1
- data/test/fixtures/vcr_cassettes/iraq_government_casualty_figure.yml +5 -7
- data/test/fixtures/vcr_cassettes/iraqi_casualties_comparison.yml +7 -9
- data/test/iraq_government_casualty_figure_test.rb +1 -1
- data/test/iraqi_casualties_comparison_test.rb +1 -1
- data/test/test_helper.rb +0 -2
- metadata +5 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aca321b32f6c018c88b5f8894b3a1cd2879cceab
|
4
|
+
data.tar.gz: 9ae9de618c461a54a193aa81896c5431473f6ca5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55de22f9b8d424c6786bbb2d5e4d98adc3617db376f9c2983b9b8d58aa088aac93a36850ebb3b8534d19c9c7c6eae143328e86949c82f9f7168d927d9fa30534
|
7
|
+
data.tar.gz: 55c092f657abd59165272909e7869fbc3cf849806ce12ddb7d7dcdd3187a01910162234f0e82c360aca82ff226e62b666941460d187ba92d04fabb4245f2fd7b
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
# IraqUnrest
|
2
2
|
|
3
|
+
[![Code Climate](https://codeclimate.com/github/bds/iraq_unrest.png)](https://codeclimate.com/github/bds/iraq_unrest)
|
4
|
+
[![Build Status](https://travis-ci.org/bds/iraq_unrest.png?branch=master)](https://travis-ci.org/bds/iraq_unrest)
|
5
|
+
|
3
6
|
Ruby library to assist in the visualization of Iraq data shared by Agence France-Presse.
|
4
7
|
|
8
|
+
<a href="http://bds.github.io/iraq_unrest/iraq_government_casualty_figure.html">
|
5
9
|
<img src="examples/example_01.png" alt="Example" style="width: 640px; height: 480px;"/>
|
10
|
+
</a>
|
6
11
|
|
7
12
|
* Supports serialzing into JSON, and Rickshaw.js data structures.
|
8
13
|
* Renders formatted CSV or HTML to file or string.
|
@@ -29,17 +34,21 @@ Each data set has Ruby methods for serializing and formatting records.
|
|
29
34
|
|
30
35
|
A <code>visualize!</code> method is provided to create a time-series chart using HTML/Rickshaw.js
|
31
36
|
|
32
|
-
irb(main):
|
37
|
+
irb(main):002:0> IraqUnrest::IraqiCasualtiesComparison.visualize!
|
33
38
|
|
34
|
-
=> #<File:
|
39
|
+
=> #<File:iraqi_casualties_comparison.html (closed)>
|
35
40
|
|
36
|
-
<
|
41
|
+
<a href="http://bds.github.io/iraq_unrest/iraqi_casualties_comparison.html">
|
42
|
+
<img src="examples/example_02.png" alt="Iraqi Casualties Comparison Graph" style="width: 640px; height: 480px;"/>
|
43
|
+
</a>
|
37
44
|
|
38
|
-
irb(main):
|
45
|
+
irb(main):001:0> IraqUnrest::IraqGovernmentCasualtyFigure.visualize!
|
39
46
|
|
40
|
-
=> #<File:
|
47
|
+
=> #<File:iraq_government_casualty_figure.html (closed)>
|
41
48
|
|
42
|
-
<
|
49
|
+
<a href="http://bds.github.io/iraq_unrest/iraq_government_casualty_figure.html">
|
50
|
+
<img src="examples/example_03.png" alt="Iraq Government Casualty Figure Graph" style="width: 640px; height: 480px;"/>
|
51
|
+
</a>
|
43
52
|
|
44
53
|
### Serialization
|
45
54
|
|
data/Rakefile
CHANGED
data/examples/example_01.png
CHANGED
Binary file
|
data/examples/example_02.png
CHANGED
Binary file
|
data/examples/example_03.png
CHANGED
Binary file
|
data/iraq_unrest.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["bd9302@gmail.com"]
|
11
11
|
spec.description = %q{Ruby library to serialize, format, and visualize Iraq data shared by Agence France-Presse.}
|
12
12
|
spec.summary = %q{Generates Rickshaw/D3.js graphs and formatted data files for Iraq data}
|
13
|
-
spec.homepage = "
|
13
|
+
spec.homepage = "http://bds.github.io/iraq_unrest"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -28,6 +28,4 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency "vcr"
|
29
29
|
spec.add_development_dependency "minitest"
|
30
30
|
spec.add_development_dependency "rake"
|
31
|
-
spec.add_development_dependency "awesome_print"
|
32
|
-
spec.add_development_dependency "byebug"
|
33
31
|
end
|
data/lib/iraq_unrest/format.rb
CHANGED
@@ -3,9 +3,6 @@ module IraqUnrest
|
|
3
3
|
# Code from https://github.com/sandal/fatty
|
4
4
|
class Format
|
5
5
|
attr_accessor :params
|
6
|
-
|
7
|
-
# FIXME: Need to understand where the methods to be
|
8
|
-
# implemented are declared
|
9
6
|
def validate
|
10
7
|
end
|
11
8
|
end
|
@@ -30,15 +27,11 @@ module IraqUnrest
|
|
30
27
|
check_required_params(params)
|
31
28
|
end
|
32
29
|
|
33
|
-
# puts ListFormatter.render(:csv, :data => data)
|
34
30
|
def render(format, params={})
|
35
31
|
validate(format, params)
|
36
32
|
|
37
|
-
# Each format object implements all the required steps
|
38
|
-
# so they they can be used interchangeably
|
39
33
|
format_obj = formats[format].new
|
40
34
|
|
41
|
-
# Customize
|
42
35
|
format_obj.params = params
|
43
36
|
format_obj.validate
|
44
37
|
format_obj.render
|
data/lib/iraq_unrest/version.rb
CHANGED
@@ -19,15 +19,15 @@ http_interactions:
|
|
19
19
|
Content-Disposition:
|
20
20
|
- attachment; filename="Iraq Unrest.csv"
|
21
21
|
Set-Cookie:
|
22
|
-
- NID=67=
|
23
|
-
|
22
|
+
- NID=67=MdlP_4zuyYvbo5vpGdEx-4sS9lNYJkEaApXW73np79cC2-SKpvraeuJYqRBySYNuPHeyUDkLepvd-omb4sK3wk4v3miYWDCBJC9bm_BmYAvGWhrr006pmJPUkex7jgp_;Domain=.google.com;Path=/;Expires=Thu,
|
23
|
+
15-May-2014 21:17:18 GMT;HttpOnly
|
24
24
|
P3p:
|
25
25
|
- CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657
|
26
26
|
for more info."
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Wed, 13 Nov 2013 21:17:18 GMT
|
29
29
|
Expires:
|
30
|
-
-
|
30
|
+
- Wed, 13 Nov 2013 21:17:18 GMT
|
31
31
|
Cache-Control:
|
32
32
|
- private, max-age=0
|
33
33
|
X-Content-Type-Options:
|
@@ -36,8 +36,6 @@ http_interactions:
|
|
36
36
|
- 1; mode=block
|
37
37
|
Server:
|
38
38
|
- GSE
|
39
|
-
Alternate-Protocol:
|
40
|
-
- 443:quic
|
41
39
|
Transfer-Encoding:
|
42
40
|
- chunked
|
43
41
|
body:
|
@@ -157,5 +155,5 @@ http_interactions:
|
|
157
155
|
,,,,,,,,,,
|
158
156
|
NB: Months with only police figures are combined police/army tolls,,,,,,,,,,
|
159
157
|
http_version:
|
160
|
-
recorded_at:
|
158
|
+
recorded_at: Wed, 13 Nov 2013 21:17:19 GMT
|
161
159
|
recorded_with: VCR 2.6.0
|
@@ -19,15 +19,15 @@ http_interactions:
|
|
19
19
|
Content-Disposition:
|
20
20
|
- attachment; filename="Iraq Unrest.csv"
|
21
21
|
Set-Cookie:
|
22
|
-
- NID=67=
|
23
|
-
|
22
|
+
- NID=67=OwJapndPe9wUUQmFC6N0ie7EpqNKdgx28WmFETIXK1VcjaxsVYXLUT0xvdXzXXZgWfXgdpKYLrRDzuBasMsu4pRFuHwxmaVDeHYiNMOx73ewgvpK7TxVDnxac89_AEKJ;Domain=.google.com;Path=/;Expires=Thu,
|
23
|
+
15-May-2014 21:17:20 GMT;HttpOnly
|
24
24
|
P3p:
|
25
25
|
- CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657
|
26
26
|
for more info."
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Wed, 13 Nov 2013 21:17:20 GMT
|
29
29
|
Expires:
|
30
|
-
-
|
30
|
+
- Wed, 13 Nov 2013 21:17:20 GMT
|
31
31
|
Cache-Control:
|
32
32
|
- private, max-age=0
|
33
33
|
X-Content-Type-Options:
|
@@ -36,8 +36,6 @@ http_interactions:
|
|
36
36
|
- 1; mode=block
|
37
37
|
Server:
|
38
38
|
- GSE
|
39
|
-
Alternate-Protocol:
|
40
|
-
- 443:quic
|
41
39
|
Transfer-Encoding:
|
42
40
|
- chunked
|
43
41
|
body:
|
@@ -50,7 +48,7 @@ http_interactions:
|
|
50
48
|
,KILLED,,
|
51
49
|
,Iraq Government,Iraq Body Count,AFP
|
52
50
|
Dec-2013,0,,
|
53
|
-
Nov-2013,0,,
|
51
|
+
Nov-2013,0,,144
|
54
52
|
Oct-2013,964,,743
|
55
53
|
Sep-2013,885,,880
|
56
54
|
Aug-2013,356,,693
|
@@ -61,7 +59,7 @@ http_interactions:
|
|
61
59
|
Mar-2013,163,395,271
|
62
60
|
Feb-2013,136,358,220
|
63
61
|
Jan-2013,177,357,246
|
64
|
-
2013,4677,2541,
|
62
|
+
2013,4677,2541,5599
|
65
63
|
Dec-2012,208,275,144
|
66
64
|
Nov-2012,166,240,160
|
67
65
|
Oct-2012,144,290,136
|
@@ -180,5 +178,5 @@ http_interactions:
|
|
180
178
|
Jan-2004,,609,
|
181
179
|
2004,,11617,
|
182
180
|
http_version:
|
183
|
-
recorded_at:
|
181
|
+
recorded_at: Wed, 13 Nov 2013 21:17:22 GMT
|
184
182
|
recorded_with: VCR 2.6.0
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iraq_unrest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian D. Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curb
|
@@ -136,34 +136,6 @@ dependencies:
|
|
136
136
|
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: awesome_print
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - '>='
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - '>='
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: byebug
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - '>='
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - '>='
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
139
|
description: Ruby library to serialize, format, and visualize Iraq data shared by
|
168
140
|
Agence France-Presse.
|
169
141
|
email:
|
@@ -173,6 +145,8 @@ extensions: []
|
|
173
145
|
extra_rdoc_files: []
|
174
146
|
files:
|
175
147
|
- .gitignore
|
148
|
+
- .travis.yml
|
149
|
+
- CHANGELOG.md
|
176
150
|
- Gemfile
|
177
151
|
- LICENSE.txt
|
178
152
|
- README.md
|
@@ -208,7 +182,7 @@ files:
|
|
208
182
|
- test/iraqi_casualties_comparison_test.rb
|
209
183
|
- test/test_helper.rb
|
210
184
|
- test/validatable_test.rb
|
211
|
-
homepage:
|
185
|
+
homepage: http://bds.github.io/iraq_unrest
|
212
186
|
licenses:
|
213
187
|
- MIT
|
214
188
|
metadata: {}
|