render_csv 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +14 -0
- data/CONTRIBUTING.md +8 -0
- data/Gemfile +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +22 -18
- data/gemfiles/Gemfile.rails-3.0.x +6 -0
- data/gemfiles/Gemfile.rails-3.1.x +6 -0
- data/gemfiles/Gemfile.rails-3.2.x +6 -0
- data/gemfiles/Gemfile.rails-4.0.x +6 -0
- data/lib/render_csv/version.rb +1 -1
- data/render_csv.gemspec +6 -5
- data/spec/spec_helper.rb +2 -2
- metadata +31 -41
- data/Gemfile.lock +0 -109
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c5ad9d5c8bda0efcb8407450d74c467aa0912882
|
4
|
+
data.tar.gz: 49d9fa1e8d4464c0c432e71f279dfcc72d084c9c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e8e20a0d0e3b957f199f943a7f6bc69d2b9e0a6a2ad19edc4657708dbcb0dbd944ad6812a388777aaabd9b5c3c21f1c144d349a63cb20067054264c6e07f8a6e
|
7
|
+
data.tar.gz: d7fab3e3c13ac5dd0706a07597ff52af665547e663d5da19fbb7750bbb455e646d7ebf6bac836b551d57fb4c646c4f5a41d4ef309ab5e3e70162af04fa9be44f
|
data/.travis.yml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 1.8.7
|
4
|
+
- 1.9.3
|
5
|
+
- 2.0.0
|
6
|
+
gemfile:
|
7
|
+
- gemfiles/Gemfile.rails-3.0.x
|
8
|
+
- gemfiles/Gemfile.rails-3.1.x
|
9
|
+
- gemfiles/Gemfile.rails-3.2.x
|
10
|
+
- gemfiles/Gemfile.rails-4.0.x
|
11
|
+
matrix:
|
12
|
+
exclude:
|
13
|
+
- rvm: 1.8.7
|
14
|
+
gemfile: gemfiles/Gemfile.rails-4.0.x
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
2
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
3
|
+
* Fork the project
|
4
|
+
* Start a feature/bugfix branch
|
5
|
+
* Commit and push until you are happy with your contribution
|
6
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
7
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
8
|
+
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
# render_csv
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/beerlington/render_csv.png?branch=master)](https://travis-ci.org/beerlington/render_csv)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/render_csv.png)](http://badge.fury.io/rb/render_csv)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/beerlington/render_csv.png)](https://codeclimate.com/github/beerlington/render_csv)
|
6
|
+
[![Dependency Status](https://gemnasium.com/beerlington/render_csv.png)](https://gemnasium.com/beerlington/render_csv)
|
7
|
+
|
8
|
+
Rails CSV renderer for ActiveRecord collections
|
9
|
+
|
10
|
+
## Rails & Ruby Versions Supported
|
11
|
+
|
12
|
+
*Rails:* 3.0.x - 4.0.x
|
13
|
+
|
14
|
+
*Ruby:* 1.8.7, 1.9.2, 1.9.3 and 2.0.0
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
The gem is hosted at [rubygems.org](https://rubygems.org/gems/render_csv)
|
4
19
|
|
5
20
|
## What is it?
|
6
21
|
|
@@ -12,7 +27,7 @@ class LocationsController < ApplicationController
|
|
12
27
|
@locations = Location.all
|
13
28
|
|
14
29
|
respond_to do |format|
|
15
|
-
format.csv { render :
|
30
|
+
format.csv { render csv: @locations }
|
16
31
|
end
|
17
32
|
end
|
18
33
|
end
|
@@ -43,7 +58,7 @@ There are a few options you can use to customize which columns are included in t
|
|
43
58
|
|
44
59
|
```ruby
|
45
60
|
respond_to do |format|
|
46
|
-
format.csv { render :
|
61
|
+
format.csv { render csv: @locations, except: [:id] }
|
47
62
|
end
|
48
63
|
```
|
49
64
|
|
@@ -51,7 +66,7 @@ end
|
|
51
66
|
|
52
67
|
```ruby
|
53
68
|
respond_to do |format|
|
54
|
-
format.csv { render :
|
69
|
+
format.csv { render csv: @locations, only: [:address, :zip] }
|
55
70
|
end
|
56
71
|
```
|
57
72
|
|
@@ -59,7 +74,7 @@ end
|
|
59
74
|
|
60
75
|
```ruby
|
61
76
|
respond_to do |format|
|
62
|
-
format.csv { render :
|
77
|
+
format.csv { render csv: @locations, add_methods: [:method1, :method2] }
|
63
78
|
end
|
64
79
|
```
|
65
80
|
|
@@ -67,22 +82,11 @@ end
|
|
67
82
|
|
68
83
|
```ruby
|
69
84
|
respond_to do |format|
|
70
|
-
format.csv { render :
|
85
|
+
format.csv { render csv: @locations, except: [:id], add_methods: [:method1, :method2] }
|
71
86
|
end
|
72
87
|
```
|
73
88
|
|
74
|
-
## Contributing to render_csv
|
75
|
-
|
76
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
77
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
78
|
-
* Fork the project
|
79
|
-
* Start a feature/bugfix branch
|
80
|
-
* Commit and push until you are happy with your contribution
|
81
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
82
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
83
|
-
|
84
89
|
## Copyright
|
85
90
|
|
86
|
-
Copyright (c) 2011-
|
91
|
+
Copyright (c) 2011-2013 Peter Brown. See LICENSE.txt for
|
87
92
|
further details.
|
88
|
-
|
data/lib/render_csv/version.rb
CHANGED
data/render_csv.gemspec
CHANGED
@@ -4,9 +4,10 @@ require File.expand_path('../lib/render_csv/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Peter Brown"]
|
6
6
|
gem.email = ["github@lette.us"]
|
7
|
-
gem.description = "Adds a custom CSV renderer to Rails
|
8
|
-
gem.summary = "Adds a custom CSV renderer to Rails
|
7
|
+
gem.description = "Adds a custom CSV renderer to Rails applications"
|
8
|
+
gem.summary = "Adds a custom CSV renderer to Rails applications"
|
9
9
|
gem.homepage = "http://github.com/beerlington/render_csv"
|
10
|
+
gem.license = "MIT"
|
10
11
|
|
11
12
|
gem.files = `git ls-files`.split($\)
|
12
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
@@ -16,8 +17,8 @@ Gem::Specification.new do |gem|
|
|
16
17
|
|
17
18
|
gem.add_dependency('rails', '>= 3.0')
|
18
19
|
|
19
|
-
gem.add_development_dependency('rspec-rails', '
|
20
|
-
gem.add_development_dependency('sqlite3', '
|
21
|
-
gem.add_development_dependency('json', '
|
20
|
+
gem.add_development_dependency('rspec-rails', '>= 2.12')
|
21
|
+
gem.add_development_dependency('sqlite3', '>= 1.3')
|
22
|
+
gem.add_development_dependency('json', '>= 1.6')
|
22
23
|
|
23
24
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
3
|
|
4
|
-
require '
|
5
|
-
require '
|
4
|
+
require 'rails/all'
|
5
|
+
require 'rspec/rails'
|
6
6
|
require 'render_csv'
|
7
7
|
|
8
8
|
# Requires supporting files with custom matchers and macros, etc,
|
metadata
CHANGED
@@ -1,81 +1,72 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: render_csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Peter Brown
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-10-20 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '3.0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '3.0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec-rails
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 2.
|
33
|
+
version: '2.12'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: 2.
|
40
|
+
version: '2.12'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: sqlite3
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.3
|
47
|
+
version: '1.3'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.3
|
54
|
+
version: '1.3'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: json
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
|
-
version: 1.6
|
61
|
+
version: '1.6'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
|
-
version: 1.6
|
78
|
-
description: Adds a custom CSV renderer to Rails
|
68
|
+
version: '1.6'
|
69
|
+
description: Adds a custom CSV renderer to Rails applications
|
79
70
|
email:
|
80
71
|
- github@lette.us
|
81
72
|
executables: []
|
@@ -84,11 +75,16 @@ extra_rdoc_files: []
|
|
84
75
|
files:
|
85
76
|
- .gitignore
|
86
77
|
- .rspec
|
78
|
+
- .travis.yml
|
79
|
+
- CONTRIBUTING.md
|
87
80
|
- Gemfile
|
88
|
-
- Gemfile.lock
|
89
81
|
- LICENSE.txt
|
90
82
|
- README.md
|
91
83
|
- Rakefile
|
84
|
+
- gemfiles/Gemfile.rails-3.0.x
|
85
|
+
- gemfiles/Gemfile.rails-3.1.x
|
86
|
+
- gemfiles/Gemfile.rails-3.2.x
|
87
|
+
- gemfiles/Gemfile.rails-4.0.x
|
92
88
|
- lib/render_csv.rb
|
93
89
|
- lib/render_csv/extension.rb
|
94
90
|
- lib/render_csv/version.rb
|
@@ -96,35 +92,29 @@ files:
|
|
96
92
|
- spec/lib/array_spec.rb
|
97
93
|
- spec/spec_helper.rb
|
98
94
|
homepage: http://github.com/beerlington/render_csv
|
99
|
-
licenses:
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
metadata: {}
|
100
98
|
post_install_message:
|
101
99
|
rdoc_options: []
|
102
100
|
require_paths:
|
103
101
|
- lib
|
104
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
103
|
requirements:
|
107
|
-
- -
|
104
|
+
- - '>='
|
108
105
|
- !ruby/object:Gem::Version
|
109
106
|
version: '0'
|
110
|
-
segments:
|
111
|
-
- 0
|
112
|
-
hash: 3585876132328497061
|
113
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
108
|
requirements:
|
116
|
-
- -
|
109
|
+
- - '>='
|
117
110
|
- !ruby/object:Gem::Version
|
118
111
|
version: '0'
|
119
|
-
segments:
|
120
|
-
- 0
|
121
|
-
hash: 3585876132328497061
|
122
112
|
requirements: []
|
123
113
|
rubyforge_project:
|
124
|
-
rubygems_version: 1.
|
114
|
+
rubygems_version: 2.1.9
|
125
115
|
signing_key:
|
126
|
-
specification_version:
|
127
|
-
summary: Adds a custom CSV renderer to Rails
|
116
|
+
specification_version: 4
|
117
|
+
summary: Adds a custom CSV renderer to Rails applications
|
128
118
|
test_files:
|
129
119
|
- spec/lib/array_spec.rb
|
130
120
|
- spec/spec_helper.rb
|
data/Gemfile.lock
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
render_csv (0.0.1)
|
5
|
-
rails (>= 3.0)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: http://rubygems.org/
|
9
|
-
specs:
|
10
|
-
actionmailer (3.2.6)
|
11
|
-
actionpack (= 3.2.6)
|
12
|
-
mail (~> 2.4.4)
|
13
|
-
actionpack (3.2.6)
|
14
|
-
activemodel (= 3.2.6)
|
15
|
-
activesupport (= 3.2.6)
|
16
|
-
builder (~> 3.0.0)
|
17
|
-
erubis (~> 2.7.0)
|
18
|
-
journey (~> 1.0.1)
|
19
|
-
rack (~> 1.4.0)
|
20
|
-
rack-cache (~> 1.2)
|
21
|
-
rack-test (~> 0.6.1)
|
22
|
-
sprockets (~> 2.1.3)
|
23
|
-
activemodel (3.2.6)
|
24
|
-
activesupport (= 3.2.6)
|
25
|
-
builder (~> 3.0.0)
|
26
|
-
activerecord (3.2.6)
|
27
|
-
activemodel (= 3.2.6)
|
28
|
-
activesupport (= 3.2.6)
|
29
|
-
arel (~> 3.0.2)
|
30
|
-
tzinfo (~> 0.3.29)
|
31
|
-
activeresource (3.2.6)
|
32
|
-
activemodel (= 3.2.6)
|
33
|
-
activesupport (= 3.2.6)
|
34
|
-
activesupport (3.2.6)
|
35
|
-
i18n (~> 0.6)
|
36
|
-
multi_json (~> 1.0)
|
37
|
-
arel (3.0.2)
|
38
|
-
builder (3.0.0)
|
39
|
-
diff-lcs (1.1.3)
|
40
|
-
erubis (2.7.0)
|
41
|
-
hike (1.2.1)
|
42
|
-
i18n (0.6.0)
|
43
|
-
journey (1.0.4)
|
44
|
-
json (1.6.7)
|
45
|
-
mail (2.4.4)
|
46
|
-
i18n (>= 0.4.0)
|
47
|
-
mime-types (~> 1.16)
|
48
|
-
treetop (~> 1.4.8)
|
49
|
-
mime-types (1.19)
|
50
|
-
multi_json (1.3.6)
|
51
|
-
polyglot (0.3.3)
|
52
|
-
rack (1.4.1)
|
53
|
-
rack-cache (1.2)
|
54
|
-
rack (>= 0.4)
|
55
|
-
rack-ssl (1.3.2)
|
56
|
-
rack
|
57
|
-
rack-test (0.6.1)
|
58
|
-
rack (>= 1.0)
|
59
|
-
rails (3.2.6)
|
60
|
-
actionmailer (= 3.2.6)
|
61
|
-
actionpack (= 3.2.6)
|
62
|
-
activerecord (= 3.2.6)
|
63
|
-
activeresource (= 3.2.6)
|
64
|
-
activesupport (= 3.2.6)
|
65
|
-
bundler (~> 1.0)
|
66
|
-
railties (= 3.2.6)
|
67
|
-
railties (3.2.6)
|
68
|
-
actionpack (= 3.2.6)
|
69
|
-
activesupport (= 3.2.6)
|
70
|
-
rack-ssl (~> 1.3.2)
|
71
|
-
rake (>= 0.8.7)
|
72
|
-
rdoc (~> 3.4)
|
73
|
-
thor (>= 0.14.6, < 2.0)
|
74
|
-
rake (0.9.2.2)
|
75
|
-
rdoc (3.12)
|
76
|
-
json (~> 1.4)
|
77
|
-
rspec (2.10.0)
|
78
|
-
rspec-core (~> 2.10.0)
|
79
|
-
rspec-expectations (~> 2.10.0)
|
80
|
-
rspec-mocks (~> 2.10.0)
|
81
|
-
rspec-core (2.10.1)
|
82
|
-
rspec-expectations (2.10.0)
|
83
|
-
diff-lcs (~> 1.1.3)
|
84
|
-
rspec-mocks (2.10.1)
|
85
|
-
rspec-rails (2.10.1)
|
86
|
-
actionpack (>= 3.0)
|
87
|
-
activesupport (>= 3.0)
|
88
|
-
railties (>= 3.0)
|
89
|
-
rspec (~> 2.10.0)
|
90
|
-
sprockets (2.1.3)
|
91
|
-
hike (~> 1.2)
|
92
|
-
rack (~> 1.0)
|
93
|
-
tilt (~> 1.1, != 1.3.0)
|
94
|
-
sqlite3 (1.3.6)
|
95
|
-
thor (0.15.4)
|
96
|
-
tilt (1.3.3)
|
97
|
-
treetop (1.4.10)
|
98
|
-
polyglot
|
99
|
-
polyglot (>= 0.3.1)
|
100
|
-
tzinfo (0.3.33)
|
101
|
-
|
102
|
-
PLATFORMS
|
103
|
-
ruby
|
104
|
-
|
105
|
-
DEPENDENCIES
|
106
|
-
json (~> 1.6.5)
|
107
|
-
render_csv!
|
108
|
-
rspec-rails (~> 2.10.0)
|
109
|
-
sqlite3 (~> 1.3.6)
|