Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stve/faraday_csv
CSV Parsing Middleware for use with Faraday
https://github.com/stve/faraday_csv
Last synced: 23 days ago
JSON representation
CSV Parsing Middleware for use with Faraday
- Host: GitHub
- URL: https://github.com/stve/faraday_csv
- Owner: stve
- License: mit
- Created: 2013-09-29T02:43:39.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-08T02:15:13.000Z (almost 11 years ago)
- Last Synced: 2024-09-17T23:23:37.869Z (about 2 months ago)
- Language: Ruby
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Faraday CSV
CSV Parsing Middleware for use with [Faraday][]
[faraday]: https://github.com/lostisland/faraday
## Usage
```ruby
conn = Faraday::Connection.new(:url => "http://example.com") do |builder|
builder.adapter Faraday.default_adapter
builder.use Faraday::Response::CSV
endresp = conn.get do |req|
req.url "/path/to/a.csv"
endcontents = resp.body
contents['header_column']
# => column_value
```You can also pass options, which are passed into `CSV::parse`:
```ruby
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](LICENSE.md) for detail