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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89bb33fb08463eb4a3cc1eda3dafbebb766ef7d0
4
- data.tar.gz: eb3689cbc6b8cf718998a5a4d301d3f9805667cf
3
+ metadata.gz: aca321b32f6c018c88b5f8894b3a1cd2879cceab
4
+ data.tar.gz: 9ae9de618c461a54a193aa81896c5431473f6ca5
5
5
  SHA512:
6
- metadata.gz: 2b478ab8a6308a1e615afc5bc5de7d985bf11ad55427661c5711d9f5ff16fd1d71dfb35ce8a939556c7d997a6ecd86429a0c217f3bdc169e9757cd3359564225
7
- data.tar.gz: 2c4c54344444aa5c87109d2aaedd54e128aac3384291ceabbc4d9ed04d0026f26415b21e88b343ec6079813c3dff6d95efa6d3a37c8e3e2099471db809baecb4
6
+ metadata.gz: 55de22f9b8d424c6786bbb2d5e4d98adc3617db376f9c2983b9b8d58aa088aac93a36850ebb3b8534d19c9c7c6eae143328e86949c82f9f7168d927d9fa30534
7
+ data.tar.gz: 55c092f657abd59165272909e7869fbc3cf849806ce12ddb7d7dcdd3187a01910162234f0e82c360aca82ff226e62b666941460d187ba92d04fabb4245f2fd7b
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ > 0.0.2
2
+
3
+ * Adds Travis CI
4
+ * Fixes Ruby 1.9.3 support
5
+
6
+ > 0.0.1
7
+
8
+ * Inital release
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):001:0> IraqUnrest::IraqGovernmentCasualtyFigure.visualize!
37
+ irb(main):002:0> IraqUnrest::IraqiCasualtiesComparison.visualize!
33
38
 
34
- => #<File:iraq_government_casualty_figure.html (closed)>
39
+ => #<File:iraqi_casualties_comparison.html (closed)>
35
40
 
36
- <img src="examples/example_02.png" alt="Iraq Government Casualty Figure Graph" style="width: 640px; height: 480px;"/>
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):002:0> IraqUnrest::IraqiCasualtiesComparison.visualize!
45
+ irb(main):001:0> IraqUnrest::IraqGovernmentCasualtyFigure.visualize!
39
46
 
40
- => #<File:iraqi_casualties_comparison.html (closed)>
47
+ => #<File:iraq_government_casualty_figure.html (closed)>
41
48
 
42
- <img src="examples/example_03.png" alt="Iraqi Casualties Comparison Graph" style="width: 640px; height: 480px;"/>
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
@@ -1,6 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require 'rake/testtask'
3
3
 
4
+ task :default => [:test]
5
+
4
6
  Rake::TestTask.new do |t|
5
7
  t.libs << 'test'
6
8
  t.pattern = "test/*_test.rb"
Binary file
Binary file
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 = "https://github.com/bds/iraq_unrest"
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
@@ -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
@@ -2,8 +2,6 @@ module IraqUnrest
2
2
 
3
3
  module Serializers
4
4
 
5
- # Gives to_json and as_json
6
- # Used by both members and collections
7
5
  class IraqiCasualtiesComparisonSerializer < ::ActiveModel::Serializer
8
6
  attributes :date, :afp, :iraq_gov, :iraq_body_count
9
7
 
@@ -1,3 +1,3 @@
1
1
  module IraqUnrest
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -19,15 +19,15 @@ http_interactions:
19
19
  Content-Disposition:
20
20
  - attachment; filename="Iraq Unrest.csv"
21
21
  Set-Cookie:
22
- - NID=67=uwoB2ugbyq-jGSmZq1XiowMDE5_FXC2Pu4_HQPzWowKD3_xYmyXAOshxb8BiGerBt0oWLDZw1S0WTvuQpCiDYu-0qvBvjorrPCNfbGUOqK-vANG2-qAcQbo2hMq8S7Kd;Domain=.google.com;Path=/;Expires=Wed,
23
- 14-May-2014 16:29:07 GMT;HttpOnly
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
- - Tue, 12 Nov 2013 16:29:07 GMT
28
+ - Wed, 13 Nov 2013 21:17:18 GMT
29
29
  Expires:
30
- - Tue, 12 Nov 2013 16:29:07 GMT
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: Tue, 12 Nov 2013 16:29:07 GMT
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=dJclmwa8iaDNZ4CB0RxHEiP_3spkVXQxeKZpER9-lmcnWKK0luvNaqQXJhyKQg9u8-S1oJIq99n0uwyHao4h1KPz4NSZVy-3wqI8RSumVbTWz4lKwuNEnitFFPOsiD1k;Domain=.google.com;Path=/;Expires=Wed,
23
- 14-May-2014 16:29:13 GMT;HttpOnly
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
- - Tue, 12 Nov 2013 16:29:13 GMT
28
+ - Wed, 13 Nov 2013 21:17:20 GMT
29
29
  Expires:
30
- - Tue, 12 Nov 2013 16:29:13 GMT
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,,139
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,5594
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: Tue, 12 Nov 2013 16:29:13 GMT
181
+ recorded_at: Wed, 13 Nov 2013 21:17:22 GMT
184
182
  recorded_with: VCR 2.6.0
@@ -116,7 +116,7 @@ module IraqUnrest
116
116
  describe "CSV file" do
117
117
 
118
118
  before do
119
- @csv = CSV.table(@file.path, :skip_lines => /#/)
119
+ @csv = CSV.table(@file.path)
120
120
  end
121
121
 
122
122
  it "must have the correct headers" do
@@ -108,7 +108,7 @@ module IraqUnrest
108
108
  describe "CSV file" do
109
109
 
110
110
  before do
111
- @csv = CSV.table(@file.path, :skip_lines => /#/)
111
+ @csv = CSV.table(@file.path)
112
112
  end
113
113
 
114
114
  it "must have the correct headers" do
data/test/test_helper.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  require 'iraq_unrest' # Require our gem so we can test it
2
- require 'byebug'
3
- require 'ap'
4
2
 
5
3
  require 'webmock/minitest'
6
4
  WebMock.allow_net_connect! # Test against the live data source
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.1
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-12 00:00:00.000000000 Z
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: https://github.com/bds/iraq_unrest
185
+ homepage: http://bds.github.io/iraq_unrest
212
186
  licenses:
213
187
  - MIT
214
188
  metadata: {}