table_setter 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ begin
14
14
  gem.add_development_dependency "rspec", "~> 1.2.9"
15
15
  gem.add_dependency "rack", ">= 1.1.0"
16
16
  gem.add_dependency "thin", ">= 1.2.5"
17
- gem.add_dependency "table_fu", ">= 0.2.1"
17
+ gem.add_dependency "table_fu", ">= 0.3.2"
18
18
  gem.add_dependency "sinatra", ">= 1.0.0"
19
19
  gem.add_dependency "sinatra-static-assets", ">= 0.5.0"
20
20
  gem.add_dependency "emk-sinatra-url-for", ">= 0.2.1"
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :minor: 2
3
3
  :build:
4
- :patch: 3
4
+ :patch: 4
5
5
  :major: 0
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby -rrubygems
2
-
3
- require File.dirname(__FILE__ ) + "/../lib/table_setter"
2
+
3
+ require "#{File.expand_path(File.dirname(__FILE__ ))}/../lib/table_setter.rb"
4
4
 
5
5
  TableSetter::Command.new
@@ -219,12 +219,17 @@ script/generate table-setter</pre>
219
219
  <li>
220
220
  <a href="http://media.apps.chicagotribune.com/tables/speed.html">In the Wild: Chicago Tribune</a><br>
221
221
  A table showing leniency rates of Chicago area judges in speeding cases.
222
-
222
+ </li>
223
+ <li>
224
+ <a href="https://github.com/newsapps/tostones">In the Wild: Tostones, easy TableSetter testing and deployment</a><br>
225
+ A set of fabric deploy scripts for deploying TableSetter to s3.
223
226
  </li>
224
227
  </ul>
225
228
  <h2><a id="credits" href="#toc">Credits</a></h2>
226
229
  <p><a href="http://github.com/thejefflarson">Jeff Larson</a> (Maintainer), <a href="http://github.com/brianboyer/">Brian Boyer</a>, <a href="http://github.com/kleinmatic">Scott Klein</a>, <a href="http://github.com/markpercival">Mark Percival</a>, <a href="http://github.com/seebq">Charles Brian Quinn</a>, <a href="http://github.com/bouvard">Christopher Groskopf</a>, and <a href="http://github.com/ryanmark">Ryan Mark</a>.</p>
227
230
  <h2><a id="changes" href="#toc">Change Log</a></h2>
231
+ <strong>0.2.4</strong>
232
+ <p>Fixes encodings issues and the FasterCSV name change for ruby 1.9.</p>
228
233
  <strong>0.2.3</strong>
229
234
  <p>JavaScript fix for table-sorter.</p>
230
235
  <strong>0.2.2</strong>
data/index.html CHANGED
@@ -8,7 +8,7 @@
8
8
  </head>
9
9
  <body>
10
10
  <a href="http://www.propublica.org" class="propublica">&nbsp;</a>
11
- <h1>TableSetter <small>&ndash; Version: 0.2.2</small></h1>
11
+ <h1>TableSetter <small>&ndash; Version: 0.2.4</small></h1>
12
12
  <p><a href="https://github.com/propublica/table-setter">TableSetter</a> is a Ruby app that provides an easy way to present CSVs hosted locally or remotely (e.g. on google, etc) in custom HTML. TableSetter in the wild: <a href="http://projects.propublica.org/tables/failed-banks">a list of all stimulus projects from last year</a>, <a href="http://projects.propublica.org/tables/stimulus-spending-progress">the stimulus spending progress</a>, or <a href="http://projects.propublica.org/tables/failed-banks">a list of failed banks due to the last recession</a>.</p>
13
13
  <p>Each table is filterable and sortable on multiple columns. Also each column can be formatted in one of many different styles. In production mode, <strong>TableSetter</strong> provides valid expires headers and can be coupled with an upstream cache like <a href="http://rtomayko.github.com/rack-cache/">Rack::Cache</a> or varnish for speedy presentation.</p>
14
14
  <h2><a id="toc">Table of Contents</a></h2>
@@ -216,12 +216,17 @@ script/generate table-setter</pre>
216
216
  <li>
217
217
  <a href="http://media.apps.chicagotribune.com/tables/speed.html">In the Wild: Chicago Tribune</a><br>
218
218
  A table showing leniency rates of Chicago area judges in speeding cases.
219
-
219
+ </li>
220
+ <li>
221
+ <a href="http://blog.apps.chicagotribune.com/2010/11/19/tostones-easy-tablesetter-testing-and-deployment/">In the Wild: Tostones, easy TableSetter testing and deployment</a><br>
222
+ A set of fabric deploy scripts for deploying TableSetter to s3.
220
223
  </li>
221
224
  </ul>
222
225
  <h2><a id="credits" href="#toc">Credits</a></h2>
223
226
  <p><a href="http://github.com/thejefflarson">Jeff Larson</a> (Maintainer), <a href="http://github.com/brianboyer/">Brian Boyer</a>, <a href="http://github.com/kleinmatic">Scott Klein</a>, <a href="http://github.com/markpercival">Mark Percival</a>, <a href="http://github.com/seebq">Charles Brian Quinn</a>, <a href="http://github.com/bouvard">Christopher Groskopf</a>, and <a href="http://github.com/ryanmark">Ryan Mark</a>.</p>
224
227
  <h2><a id="changes" href="#toc">Change Log</a></h2>
228
+ <strong>0.2.4</strong>
229
+ <p>Fixes encodings issues and the FasterCSV name change for ruby 1.9.</p>
225
230
  <strong>0.2.3</strong>
226
231
  <p>JavaScript fix for table-sorter.</p>
227
232
  <strong>0.2.2</strong>
@@ -3,10 +3,18 @@ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
3
3
  require 'table_fu'
4
4
  require 'yaml'
5
5
 
6
+ if RUBY_VERSION > "1.9"
7
+ require 'csv'
8
+ Encoding.default_external = Encoding::UTF_8
9
+ Encoding.default_internal = Encoding::UTF_8
10
+ ::FasterCSV = CSV unless defined? ::FasterCSV
11
+ else
12
+ require 'fastercsv'
13
+ end
14
+
6
15
  autoload :Sinatra, 'sinatra/base'
7
16
  autoload :Thin, 'thin'
8
17
  autoload :ERB, 'erb'
9
- autoload :FasterCSV, 'FasterCSV'
10
18
  autoload :Curb, 'curb'
11
19
  autoload :RDiscount, 'rdiscount'
12
20
 
@@ -130,6 +130,7 @@ options:
130
130
 
131
131
  def install_file(body, dest)
132
132
  ensure_directory dest
133
+ body.force_encoding("UTF-8") if RUBY_VERSION > "1.9"
133
134
  File.open(dest, "w") do |file|
134
135
  file.write(body)
135
136
  end
@@ -1,5 +1,5 @@
1
+ # encoding: utf-8
1
2
  require 'curb'
2
- require 'fastercsv'
3
3
  require 'table_fu'
4
4
  require 'net/http'
5
5
 
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ require 'spec_helper'
2
2
 
3
3
 
4
4
  describe TableSetter::App, "in the application" do
@@ -16,7 +16,7 @@ describe TableSetter::App, "in the application" do
16
16
 
17
17
 
18
18
  it "should render a table" do
19
- get '/example'
19
+ get '/example/'
20
20
  last_response.ok?.should be_true
21
21
  last_response.body.include?("Failed Banks List").should be_true
22
22
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{table_setter}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeff Larson"]
12
- s.date = %q{2010-11-12}
12
+ s.date = %q{2010-11-19}
13
13
  s.description = %q{A sinatra based app for rendering CSVs hosted on google docs or locally in custom HTML}
14
14
  s.email = %q{thejefflarson@gmail.com}
15
15
  s.executables = ["table-setter", "table-setter"]
@@ -144,7 +144,7 @@ Gem::Specification.new do |s|
144
144
  s.add_development_dependency(%q<rspec>, ["~> 1.2.9"])
145
145
  s.add_runtime_dependency(%q<rack>, [">= 1.1.0"])
146
146
  s.add_runtime_dependency(%q<thin>, [">= 1.2.5"])
147
- s.add_runtime_dependency(%q<table_fu>, [">= 0.2.1"])
147
+ s.add_runtime_dependency(%q<table_fu>, [">= 0.3.2"])
148
148
  s.add_runtime_dependency(%q<sinatra>, [">= 1.0.0"])
149
149
  s.add_runtime_dependency(%q<sinatra-static-assets>, [">= 0.5.0"])
150
150
  s.add_runtime_dependency(%q<emk-sinatra-url-for>, [">= 0.2.1"])
@@ -154,7 +154,7 @@ Gem::Specification.new do |s|
154
154
  s.add_dependency(%q<rspec>, ["~> 1.2.9"])
155
155
  s.add_dependency(%q<rack>, [">= 1.1.0"])
156
156
  s.add_dependency(%q<thin>, [">= 1.2.5"])
157
- s.add_dependency(%q<table_fu>, [">= 0.2.1"])
157
+ s.add_dependency(%q<table_fu>, [">= 0.3.2"])
158
158
  s.add_dependency(%q<sinatra>, [">= 1.0.0"])
159
159
  s.add_dependency(%q<sinatra-static-assets>, [">= 0.5.0"])
160
160
  s.add_dependency(%q<emk-sinatra-url-for>, [">= 0.2.1"])
@@ -165,7 +165,7 @@ Gem::Specification.new do |s|
165
165
  s.add_dependency(%q<rspec>, ["~> 1.2.9"])
166
166
  s.add_dependency(%q<rack>, [">= 1.1.0"])
167
167
  s.add_dependency(%q<thin>, [">= 1.2.5"])
168
- s.add_dependency(%q<table_fu>, [">= 0.2.1"])
168
+ s.add_dependency(%q<table_fu>, [">= 0.3.2"])
169
169
  s.add_dependency(%q<sinatra>, [">= 1.0.0"])
170
170
  s.add_dependency(%q<sinatra-static-assets>, [">= 0.5.0"])
171
171
  s.add_dependency(%q<emk-sinatra-url-for>, [">= 0.2.1"])
@@ -9,13 +9,12 @@ table:
9
9
  columns:
10
10
  - Bank
11
11
  - State
12
- - Closing Date
13
- - Our Coverage
12
+ - Closing Date
13
+ - Our Coverage
14
14
  - Federal Regulators
15
15
  - Public Enforcement Documents
16
16
  style:
17
17
  Bank: 'text-align:left;'
18
- sorted_by:
18
+ sorted_by:
19
19
  Closing Date: 'ascending'
20
20
  live: true
21
-
@@ -6,7 +6,7 @@ table:
6
6
  footer:
7
7
  <p>This chart and other stories are part of <a href="http://www.propublica.org/ion/stimulus/">Eye on the Stimulus</a>, our blog dedicated to tracking the stimulus from bill to building.</p>
8
8
  column_options:
9
- columns:
9
+ columns:
10
10
  - State
11
11
  - Cong. District
12
12
  - Representative
@@ -21,7 +21,7 @@ table:
21
21
  total: ['Total Appropriation', 'Projects']
22
22
  sorted_by:
23
23
  Cong. District: descending
24
- faceting:
24
+ faceting:
25
25
  facet_by: State
26
26
  live: false
27
-
27
+
@@ -4,7 +4,7 @@ table:
4
4
  deck:
5
5
  <p>Road and bridge projects are expected to make up one of the biggest chunks of the jobs created in the stimulus package. Below, you’ll find a chart of more than 5,800 projects that have been approved by the U.S. Department of Transportation. Once given the green light, states can put the projects out to bid, contract them and begin construction work. So far, about 2,300 projects are under way.</p>
6
6
  <p>Help us find out how much progress has been made on these projects by participating in our <a href="http://projects.propublica.org/spotcheck/">Stimulus Spot Check</a>.</p>
7
-
7
+
8
8
  <p>For more on the stimulus, check out our <a href="http://www.propublica.org/ion/stimulus">blog and resource page</a>.</p>
9
9
  footer:
10
10
  <p>Source:&nbsp;<a href="http://www.fdic.gov/bank/individual/failed/banklist.html">FDIC</a></p>
@@ -14,14 +14,14 @@ table:
14
14
  - Urban Area
15
15
  - Project Description
16
16
  - Improvement Type
17
- - ARRA Funds Obligated
17
+ - ARRA Funds Obligated
18
18
  style:
19
19
  State: 'text-align:left;'
20
- Project Description: 'text-align:right;'
20
+ Project Description: 'text-align:right;'
21
21
  sorted_by:
22
22
  State: ascending
23
23
  formatting:
24
24
  ARRA Funds Obligated: currency
25
25
  hard_paginate: true
26
26
  per_page: 250
27
- live: false
27
+ live: false
@@ -1,3 +1,4 @@
1
+ <%# encoding: UTF-8 %>
1
2
  <% table ||= nil %>
2
3
  <!DOCTYPE html>
3
4
  <html>
@@ -14,7 +15,7 @@
14
15
  <%= javascript_script_tag "/javascripts/jquery.tablesorter.multipagefilter.js" %>
15
16
  <%= javascript_script_tag "/javascripts/application.js" %>
16
17
  <%= stylesheet_link_tag "/stylesheets/stylesheet.css", :media=>"screen" %>
17
-
18
+
18
19
  <script>
19
20
  <% if !table.nil? %>
20
21
  var sortPlease = <%= table.sortable? %>;
@@ -24,7 +25,7 @@
24
25
  var sortPlease = false;
25
26
  <% end %>
26
27
  </script>
27
-
28
+
28
29
  </head>
29
30
  <body>
30
31
  <div id="table_fu">
@@ -1,3 +1,5 @@
1
+ <%# encoding: UTF-8 %>
2
+
1
3
  <div id="table_title"><%= table.title %></div>
2
4
  <div id="deck"><%= table.deck %></div>
3
5
  <div id="controls">
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_setter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeff Larson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-12 00:00:00 -05:00
18
+ date: 2010-11-19 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -74,12 +74,12 @@ dependencies:
74
74
  requirements:
75
75
  - - ">="
76
76
  - !ruby/object:Gem::Version
77
- hash: 21
77
+ hash: 23
78
78
  segments:
79
79
  - 0
80
+ - 3
80
81
  - 2
81
- - 1
82
- version: 0.2.1
82
+ version: 0.3.2
83
83
  type: :runtime
84
84
  version_requirements: *id004
85
85
  - !ruby/object:Gem::Dependency