useful_renderers 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.rspec +3 -0
- data/.travis.yml +12 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +122 -0
- data/Rakefile +6 -0
- 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/useful_renderers.rb +26 -0
- data/lib/useful_renderers/csv_renderable.rb +38 -0
- data/lib/useful_renderers/version.rb +3 -0
- data/lib/useful_renderers/zip_renderable.rb +25 -0
- data/spec/fixtures/test.txt +1 -0
- data/spec/lib/csv_renderable_spec.rb +82 -0
- data/spec/lib/zip_renderable_spec.rb +47 -0
- data/spec/spec_helper.rb +46 -0
- data/useful_renderers.gemspec +29 -0
- metadata +166 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a8eaac762861879e9ba676ef24d40e093ecea7ca
|
4
|
+
data.tar.gz: 18d301948ae29c816ef1c28a855c9ccc3b1d49e7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 62d11b80d849da88962f0dd1ab1a2ea59119af07c694dedbf0776dcf2abd108db5353e96f3751f9db7d05bae9b3dae140b6db7302545b43c9f6cd4324081c9ad
|
7
|
+
data.tar.gz: ca07ed5daf59ce57078f76d86d691f355ee20c2281f007ffa59a40ee876dd0a75026016e1cb6e54992270fc5e962057a6ec9d70e95788bcfa67c702827d0cd97
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Ondrej Bartas
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
# UsefulRenderers
|
2
|
+
|
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 renderers
|
9
|
+
|
10
|
+
- CSV renderer for ActiveRecord collections
|
11
|
+
- ZIP renderer fo collection of File objects
|
12
|
+
|
13
|
+
Big thanks to @beerlington and his [render_csv](https://github.com/beerlington/render_csv) gem.
|
14
|
+
|
15
|
+
## Rails & Ruby Versions Supported
|
16
|
+
|
17
|
+
*Rails:* 3.0.x - 4.0.x
|
18
|
+
|
19
|
+
*Ruby:* 1.9.3, 2.0.0 and 2.1.0
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
Add this line to your application's Gemfile:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
gem 'useful_renderers'
|
27
|
+
```
|
28
|
+
|
29
|
+
And then execute:
|
30
|
+
|
31
|
+
$ bundle
|
32
|
+
|
33
|
+
Or install it yourself as:
|
34
|
+
|
35
|
+
$ gem install useful_renderers
|
36
|
+
|
37
|
+
|
38
|
+
## What is it?
|
39
|
+
|
40
|
+
The CSV renderer allows you to render any collection as CSV data.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
class LocationsController < ApplicationController
|
44
|
+
def index
|
45
|
+
@locations = Location.all
|
46
|
+
|
47
|
+
respond_to do |format|
|
48
|
+
format.csv { render csv: @locations }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
Will render a CSV file similar to:
|
55
|
+
|
56
|
+
<table>
|
57
|
+
<tr>
|
58
|
+
<th>name</th><th>address</th><th>city</th><th>state</th><th>zip</th><th>created_at</th><th>updated_at</th>
|
59
|
+
</tr>
|
60
|
+
<tr>
|
61
|
+
<td>Pete's House</td><td>555 House Ln</td><td>Burlington</td><td>VT</td><td>05401</td><td>2011-07-26 03:12:44 UTC</td><td>2011-07-26 03:12:44 UTC</td>
|
62
|
+
</tr>
|
63
|
+
<tr>
|
64
|
+
<td>Sebastians's House</td><td>123 Pup St</td><td>Burlington</td><td>VT</td><td>05401</td><td>2011-07-26 03:30:44 UTC</td><td>2011-07-26 03:30:44 UTC</td>
|
65
|
+
</tr>
|
66
|
+
<tr>
|
67
|
+
<td>Someone Else</td><td>999 Herp Derp</td><td>Burlington</td><td>VT</td><td>05401</td><td>2011-07-26 03:30:44 UTC</td><td>2011-07-26 03:30:44 UTC</td>
|
68
|
+
</tr>
|
69
|
+
</table>
|
70
|
+
|
71
|
+
## Usage Options
|
72
|
+
|
73
|
+
There are a few options you can use to customize which columns are included in the CSV file
|
74
|
+
|
75
|
+
### Exclude columns
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
respond_to do |format|
|
79
|
+
format.csv { render csv: @locations, except: [:id] }
|
80
|
+
end
|
81
|
+
```
|
82
|
+
|
83
|
+
### Limit columns
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
respond_to do |format|
|
87
|
+
format.csv { render csv: @locations, only: [:address, :zip] }
|
88
|
+
end
|
89
|
+
```
|
90
|
+
|
91
|
+
### Add methods as columns
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
respond_to do |format|
|
95
|
+
format.csv { render csv: @locations, add_methods: [:method1, :method2] }
|
96
|
+
end
|
97
|
+
```
|
98
|
+
|
99
|
+
### Add methods as columns and exclude columns
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
respond_to do |format|
|
103
|
+
format.csv { render csv: @locations, except: [:id], add_methods: [:method1, :method2] }
|
104
|
+
end
|
105
|
+
```
|
106
|
+
|
107
|
+
|
108
|
+
## Contributing
|
109
|
+
|
110
|
+
1. Fork it ( https://github.com/[my-github-username]/useful_renderers/fork )
|
111
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
112
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
113
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
114
|
+
5. Create a new Pull Request
|
115
|
+
# render_csv
|
116
|
+
|
117
|
+
Rails CSV renderer for ActiveRecord collections
|
118
|
+
|
119
|
+
## Copyright
|
120
|
+
|
121
|
+
Copyright © 2011-2014 Peter Brown. See LICENSE.txt for render_csv.
|
122
|
+
Copyright © 2014 Ondrej Bartas for implementation ZIP and updates of render_csv.
|
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require "useful_renderers/version"
|
2
|
+
require 'useful_renderers/csv_renderable'
|
3
|
+
require 'useful_renderers/zip_renderable'
|
4
|
+
require 'action_controller/metal/renderers'
|
5
|
+
|
6
|
+
module UsefulRenderers
|
7
|
+
class RenderUsefulRailtie < ::Rails::Railtie
|
8
|
+
config.after_initialize do
|
9
|
+
|
10
|
+
ActionController.add_renderer :csv do |csv, options|
|
11
|
+
filename = options[:filename] || options[:template]
|
12
|
+
csv.extend UsefulRenderers::CsvRenderable
|
13
|
+
data = csv.respond_to?(:to_csv) ? csv.to_csv(options) : csv
|
14
|
+
send_data data, type: Mime::CSV, disposition: "attachment; filename=#{filename}.csv"
|
15
|
+
end
|
16
|
+
|
17
|
+
ActionController.add_renderer :csv do |csv, options|
|
18
|
+
filename = options[:filename] || options[:template]
|
19
|
+
csv.extend UsefulRenderers::ZipRenderable
|
20
|
+
data = csv.respond_to?(:to_zip) ? csv.to_csv(options) : csv
|
21
|
+
send_data data, type: Mime::Zip, disposition: "attachment; filename=#{filename}.zip"
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'csv'
|
2
|
+
|
3
|
+
module UsefulRenderers
|
4
|
+
module CsvRenderable
|
5
|
+
|
6
|
+
# Converts an array to CSV formatted string
|
7
|
+
# Options include:
|
8
|
+
# :only => [:col1, :col2] # Specify which columns to include
|
9
|
+
# :except => [:col1, :col2] # Specify which columns to exclude
|
10
|
+
# :add_methods => [:method1, :method2] # Include addtional methods that aren't columns
|
11
|
+
|
12
|
+
def to_csv(options = {})
|
13
|
+
klass = first.class
|
14
|
+
return '' if empty?
|
15
|
+
return join(',') unless klass.respond_to? :column_names
|
16
|
+
|
17
|
+
columns = klass.column_names
|
18
|
+
columns &= options[:only].map(&:to_s) if options[:only]
|
19
|
+
columns -= options[:except].map(&:to_s) if options[:except]
|
20
|
+
columns += options[:add_methods].map(&:to_s) if options[:add_methods]
|
21
|
+
|
22
|
+
headers = columns.dup
|
23
|
+
headers.map!{|col| klass.human_attribute_name col } if options[:translate]
|
24
|
+
|
25
|
+
csv_options = {
|
26
|
+
encoding: 'utf-8',
|
27
|
+
headers: headers,
|
28
|
+
write_headers: true
|
29
|
+
}
|
30
|
+
|
31
|
+
CSV.generate(csv_options) do |row|
|
32
|
+
self.each do |obj|
|
33
|
+
row << columns.map { |c| obj.send(c) }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'zip'
|
3
|
+
|
4
|
+
module UsefulRenderers
|
5
|
+
module ZipRenderable
|
6
|
+
|
7
|
+
# You need to call this on collection of File objects
|
8
|
+
# or objects which provides :read & :path method
|
9
|
+
|
10
|
+
def to_zip(*)
|
11
|
+
return '' if empty?
|
12
|
+
return '' unless first.respond_to?(:path) && first.respond_to?(:read)
|
13
|
+
|
14
|
+
stringio = Zip::OutputStream.write_buffer do |zio|
|
15
|
+
self.each do |obj|
|
16
|
+
filename = File.basename(obj.path)
|
17
|
+
zio.put_next_entry(filename)
|
18
|
+
zio.write obj.read
|
19
|
+
end
|
20
|
+
end
|
21
|
+
stringio.rewind
|
22
|
+
stringio.sysread
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
FooBar
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require './spec/spec_helper'
|
2
|
+
|
3
|
+
describe UsefulRenderers::CsvRenderable do
|
4
|
+
let(:csv_renderable_array) { array.extend UsefulRenderers::CsvRenderable }
|
5
|
+
|
6
|
+
context 'object is an array' do
|
7
|
+
|
8
|
+
context 'array is empty' do
|
9
|
+
let(:array) { Array.new }
|
10
|
+
|
11
|
+
it 'returns an empty string' do
|
12
|
+
expect(csv_renderable_array.to_csv).to eql('')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'object is not an instance of AR class' do
|
17
|
+
let(:array) { [1, 2, 3] }
|
18
|
+
|
19
|
+
it 'returns a csv of the array' do
|
20
|
+
expect(csv_renderable_array.to_csv).to eql('1,2,3')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context 'object is an ActiveRecord object' do
|
26
|
+
let(:sebastian) { Dog.create!(name: "O'Connor", age: 3, weight: 76.8) }
|
27
|
+
let(:ruby) { Dog.create!(name: 'Ruby', age: 3, weight: 68.2) }
|
28
|
+
let(:shelby) { Dog.create!(name: 'Shelby', age: 5, weight: 64.0) }
|
29
|
+
let(:array) { [sebastian, ruby, shelby] }
|
30
|
+
|
31
|
+
context 'options is blank' do
|
32
|
+
it 'returns all columns' do
|
33
|
+
expect(csv_renderable_array.to_csv)
|
34
|
+
.to eql "id,name,age,weight\n1,O'Connor,3,76.8\n2,Ruby,3,68.2\n3,Shelby,5,64.0\n"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'options with :only param' do
|
39
|
+
it 'returns only columns specified' do
|
40
|
+
options = { only: [:name, :age] }
|
41
|
+
|
42
|
+
expect(csv_renderable_array.to_csv(options))
|
43
|
+
.to eql "name,age\nO'Connor,3\nRuby,3\nShelby,5\n"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
context 'options with :exclude param' do
|
48
|
+
it 'excludes columns specified' do
|
49
|
+
options = { except: [:age] }
|
50
|
+
|
51
|
+
expect(csv_renderable_array.to_csv(options))
|
52
|
+
.to eql "id,name,weight\n7,O'Connor,76.8\n8,Ruby,68.2\n9,Shelby,64.0\n"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'options with :add_methods' do
|
57
|
+
it 'includes specified method values' do
|
58
|
+
options = { add_methods: [:human_age] }
|
59
|
+
|
60
|
+
expect(csv_renderable_array.to_csv(options))
|
61
|
+
.to eql "id,name,age,weight,human_age\n10,O'Connor,3,76.8,25\n11,Ruby,3,68.2,25\n12,Shelby,5,64.0,33\n"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context 'options with :expect and :add_methods' do
|
66
|
+
it 'includes method values with other options' do
|
67
|
+
options = { except: [:id, :name], add_methods: [:human_age] }
|
68
|
+
|
69
|
+
expect(csv_renderable_array.to_csv(options))
|
70
|
+
.to eql "age,weight,human_age\n3,76.8,25\n3,68.2,25\n5,64.0,33\n"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
context 'options with :translate' do
|
75
|
+
it 'translate header with human_attribute_name' do
|
76
|
+
options = { only: [:id, :name], translate: true }
|
77
|
+
expect(csv_renderable_array.to_csv(options))
|
78
|
+
.to eql "Id,Dog name\n16,O'Connor\n17,Ruby\n18,Shelby\n"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require './spec/spec_helper'
|
2
|
+
|
3
|
+
describe UsefulRenderers::ZipRenderable do
|
4
|
+
let(:zip_renderable_array) { array.extend UsefulRenderers::ZipRenderable }
|
5
|
+
|
6
|
+
context 'object is an array' do
|
7
|
+
context 'array is empty' do
|
8
|
+
let(:array) { Array.new }
|
9
|
+
|
10
|
+
it 'returns an empty string' do
|
11
|
+
expect(zip_renderable_array.to_zip).to eql('')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'array contains object without filename method' do
|
16
|
+
let(:file) { double(read: '') }
|
17
|
+
let(:array) { [file] }
|
18
|
+
|
19
|
+
it 'returns an empty string' do
|
20
|
+
expect(zip_renderable_array.to_zip).to eql('')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'array contains object without read method' do
|
25
|
+
let(:file) { double(filename: '') }
|
26
|
+
let(:array) { [file] }
|
27
|
+
|
28
|
+
it 'returns an empty string' do
|
29
|
+
expect(zip_renderable_array.to_zip).to eql('')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'object is an File object' do
|
35
|
+
let(:filename) { File.join(File.dirname(__FILE__),'..', 'fixtures','test.txt') }
|
36
|
+
let(:file) { File.open(filename, 'r:utf-8') }
|
37
|
+
let(:array) { [file] }
|
38
|
+
|
39
|
+
it 'returns zip with file' do
|
40
|
+
expect(zip_renderable_array.to_zip).to include('test.txt')
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'does not return zip with other file' do
|
44
|
+
expect(zip_renderable_array.to_zip).not_to include('other.txt')
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
|
4
|
+
require 'rails/all'
|
5
|
+
require 'rspec/rails'
|
6
|
+
require 'useful_renderers'
|
7
|
+
|
8
|
+
# Requires supporting files with custom matchers and macros, etc,
|
9
|
+
# in ./support/ and its subdirectories.
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
end
|
14
|
+
|
15
|
+
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
|
16
|
+
|
17
|
+
ActiveRecord::Schema.define(:version => 1) do
|
18
|
+
create_table :dogs, force: true do |t|
|
19
|
+
t.string :name
|
20
|
+
t.integer :age
|
21
|
+
t.float :weight
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class Dog < ActiveRecord::Base
|
26
|
+
validates_presence_of :name, :age, :weight
|
27
|
+
|
28
|
+
def human_age
|
29
|
+
if age <= 2
|
30
|
+
(age * 10.5).to_i
|
31
|
+
else
|
32
|
+
(2 * 10.5 + (age - 2) * 4).to_i
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
translations = {
|
38
|
+
activerecord: {
|
39
|
+
attributes: {
|
40
|
+
dog: {
|
41
|
+
name: 'Dog name'
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
I18n.backend.store_translations(:en, translations)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'useful_renderers/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "useful_renderers"
|
8
|
+
spec.version = UsefulRenderers::VERSION
|
9
|
+
spec.authors = ["Ondrej Bartas"]
|
10
|
+
spec.email = ["ondrej@bartas.cz"]
|
11
|
+
spec.summary = 'Adds a custom CSV and ZIP renderer to Rails applications'
|
12
|
+
spec.description = 'Adds a custom CSV and ZIP renderer to Rails applications'
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'rails', '>= 3.0'
|
22
|
+
spec.add_dependency 'rubyzip', '>= 1.0.0'
|
23
|
+
|
24
|
+
spec.add_development_dependency 'rspec-rails', '>= 2.12'
|
25
|
+
spec.add_development_dependency 'sqlite3', '>= 1.3'
|
26
|
+
spec.add_development_dependency 'json', '>= 1.6'
|
27
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
28
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: useful_renderers
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ondrej Bartas
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubyzip
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sqlite3
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.3'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: json
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.6'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.6'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.7'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.7'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '10.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '10.0'
|
111
|
+
description: Adds a custom CSV and ZIP renderer to Rails applications
|
112
|
+
email:
|
113
|
+
- ondrej@bartas.cz
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".rspec"
|
120
|
+
- ".travis.yml"
|
121
|
+
- Gemfile
|
122
|
+
- LICENSE.txt
|
123
|
+
- README.md
|
124
|
+
- Rakefile
|
125
|
+
- gemfiles/Gemfile.rails-3.0.x
|
126
|
+
- gemfiles/Gemfile.rails-3.1.x
|
127
|
+
- gemfiles/Gemfile.rails-3.2.x
|
128
|
+
- gemfiles/Gemfile.rails-4.0.x
|
129
|
+
- lib/useful_renderers.rb
|
130
|
+
- lib/useful_renderers/csv_renderable.rb
|
131
|
+
- lib/useful_renderers/version.rb
|
132
|
+
- lib/useful_renderers/zip_renderable.rb
|
133
|
+
- spec/fixtures/test.txt
|
134
|
+
- spec/lib/csv_renderable_spec.rb
|
135
|
+
- spec/lib/zip_renderable_spec.rb
|
136
|
+
- spec/spec_helper.rb
|
137
|
+
- useful_renderers.gemspec
|
138
|
+
homepage: ''
|
139
|
+
licenses:
|
140
|
+
- MIT
|
141
|
+
metadata: {}
|
142
|
+
post_install_message:
|
143
|
+
rdoc_options: []
|
144
|
+
require_paths:
|
145
|
+
- lib
|
146
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - ">="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
156
|
+
requirements: []
|
157
|
+
rubyforge_project:
|
158
|
+
rubygems_version: 2.2.2
|
159
|
+
signing_key:
|
160
|
+
specification_version: 4
|
161
|
+
summary: Adds a custom CSV and ZIP renderer to Rails applications
|
162
|
+
test_files:
|
163
|
+
- spec/fixtures/test.txt
|
164
|
+
- spec/lib/csv_renderable_spec.rb
|
165
|
+
- spec/lib/zip_renderable_spec.rb
|
166
|
+
- spec/spec_helper.rb
|