0.0
No commit activity in last 3 years
No release in over 3 years
CSV Parsing Middleware for use with Faraday
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Faraday CSV

CSV Parsing Middleware for use with Faraday

Usage

conn = Faraday::Connection.new(:url => "http://example.com") do |builder|
  builder.adapter Faraday.default_adapter
  builder.use Faraday::Response::CSV
end

resp = conn.get do |req|
  req.url "/path/to/a.csv"
end

contents = resp.body
contents['header_column']
# => column_value

You can also pass options, which are passed into CSV::parse:

conn = Faraday::Connection.new(:url => "http://example.com") do |builder|
  builder.adapter Faraday.default_adapter
  builder.use Faraday::Response::CSV, :headers => true
end

Contributing

Pull requests welcome: fork, make a topic branch, commit (squash when possible) with tests and I'll happily consider.

Copyright

Copyright (c) 2013 Steve Agalloco. See LICENSE for detail