Skip to content

Commit

Permalink
fastercsv is only for 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ujihisa committed Oct 10, 2010
1 parent 88dda71 commit 04f0bad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -15,7 +15,7 @@ gem 'httparty'

gem 'json'

gem 'fastercsv'
gem 'fastercsv' if RUBY_VERSION < '1.9'

# Use unicorn as the web server
# gem 'unicorn'
Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Expand Up @@ -38,7 +38,6 @@ GEM
warden (~> 0.10.7)
erubis (2.6.6)
abstract (>= 1.0.0)
fastercsv (1.5.3)
haml (3.0.21)
httparty (0.6.1)
crack (= 0.1.8)
Expand Down Expand Up @@ -82,7 +81,6 @@ PLATFORMS

DEPENDENCIES
devise
fastercsv
haml
httparty
json
Expand Down
4 changes: 2 additions & 2 deletions lib/translink.rb
@@ -1,6 +1,6 @@
require 'httparty'
require 'json'
require 'fastercsv'
require RUBY_VERSION < '1.9' ? 'fastercsv' : 'csv'
require 'pp'

# we can use cron to update the schedule every 40 minutes (or something)
Expand Down Expand Up @@ -35,7 +35,7 @@ def csv
# "stop_url"=>" ",
# "stop_desc"=>"BEACH AV @ NICOLA ST",
# "stop_name"=>"EB BEACH AV FS NICOLA ST"}
FasterCSV.open("data/stops.txt",:headers => true).each do |row|
(RUBY_VERSION < '1.9' ? FasterCSV : CSV).open("data/stops.txt",:headers => true).each do |row|
@csv[row["stop_code"].to_i] = row.to_hash
end
@csv
Expand Down

0 comments on commit 04f0bad

Please sign in to comment.