comma 4.0.1 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +10 -0
- data/.rubocop_todo.yml +422 -0
- data/.travis.yml +32 -19
- data/Appraisals +7 -7
- data/Gemfile +3 -2
- data/Gemfile.lock +18 -3
- data/Rakefile +5 -5
- data/comma.gemspec +2 -1
- data/gemfiles/active4.0.13.gemfile +1 -0
- data/gemfiles/active4.0.13.gemfile.lock +15 -1
- data/gemfiles/active4.1.16.gemfile +1 -0
- data/gemfiles/active4.1.16.gemfile.lock +19 -4
- data/gemfiles/{active5.0.0.1.gemfile → active4.2.8.gemfile} +3 -2
- data/gemfiles/{active4.2.7.1.gemfile.lock → active4.2.8.gemfile.lock} +45 -31
- data/gemfiles/active5.0.1.gemfile +10 -0
- data/gemfiles/{active5.0.0.1.gemfile.lock → active5.0.1.gemfile.lock} +45 -30
- data/gemfiles/active5.1.0.gemfile +10 -0
- data/gemfiles/active5.1.0.gemfile.lock +104 -0
- data/gemfiles/rails4.0.13.gemfile +1 -0
- data/gemfiles/rails4.0.13.gemfile.lock +15 -1
- data/gemfiles/rails4.1.16.gemfile +1 -0
- data/gemfiles/rails4.1.16.gemfile.lock +19 -4
- data/gemfiles/{rails4.2.7.1.gemfile → rails4.2.8.gemfile} +2 -1
- data/gemfiles/{rails4.2.7.1.gemfile.lock → rails4.2.8.gemfile.lock} +81 -69
- data/gemfiles/{rails5.0.0.1.gemfile → rails5.0.1.gemfile} +2 -1
- data/gemfiles/{rails5.0.0.1.gemfile.lock → rails5.0.1.gemfile.lock} +83 -70
- data/gemfiles/{active4.2.7.1.gemfile → rails5.1.0.gemfile} +4 -2
- data/gemfiles/rails5.1.0.gemfile.lock +194 -0
- data/lib/comma/version.rb +1 -1
- data/spec/comma/comma_spec.rb +42 -40
- data/spec/comma/data_extractor_spec.rb +1 -1
- data/spec/comma/header_extractor_spec.rb +1 -1
- data/spec/comma/rails/active_record_spec.rb +5 -5
- data/spec/comma/rails/data_mapper_collection_spec.rb +1 -1
- data/spec/controllers/users_controller_spec.rb +41 -30
- data/spec/rails_app/active_record/models.rb +8 -1
- data/spec/rails_app/rails_app.rb +27 -3
- metadata +19 -13
data/spec/rails_app/rails_app.rb
CHANGED
@@ -24,18 +24,42 @@ end
|
|
24
24
|
# models
|
25
25
|
require 'rails_app/active_record/models' if defined?(ActiveRecord)
|
26
26
|
|
27
|
+
def is_rails_4?
|
28
|
+
Rails::VERSION::STRING =~ /^4.*/
|
29
|
+
end
|
30
|
+
|
31
|
+
if is_rails_4?
|
32
|
+
def symbolize_param_keys(params)
|
33
|
+
params.symbolize_keys
|
34
|
+
end
|
35
|
+
else
|
36
|
+
def symbolize_param_keys(params)
|
37
|
+
if params
|
38
|
+
params.to_unsafe_h.symbolize_keys
|
39
|
+
else
|
40
|
+
{}
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
27
45
|
# controllers
|
28
46
|
class ApplicationController < ActionController::Base; end
|
29
47
|
class UsersController < ApplicationController
|
30
48
|
def index
|
31
49
|
respond_to do |format|
|
32
|
-
format.html
|
33
|
-
|
50
|
+
format.html do
|
51
|
+
if is_rails_4?
|
52
|
+
render :text => 'Users!'
|
53
|
+
else
|
54
|
+
render :plain => 'Users!'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
format.csv { render :csv => User.all }
|
34
58
|
end
|
35
59
|
end
|
36
60
|
|
37
61
|
def with_custom_options
|
38
|
-
render_options = {:csv => User.all}.update(params[:custom_options]
|
62
|
+
render_options = {:csv => User.all}.update(symbolize_param_keys(params[:custom_options]))
|
39
63
|
|
40
64
|
respond_to do |format|
|
41
65
|
format.csv { render render_options }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcus Crafter
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-05-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: 4.0.0
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '5.
|
23
|
+
version: '5.2'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
version: 4.0.0
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '5.
|
33
|
+
version: '5.2'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: appraisal
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,6 +126,8 @@ files:
|
|
126
126
|
- ".coveralls.yml"
|
127
127
|
- ".gitignore"
|
128
128
|
- ".rspec"
|
129
|
+
- ".rubocop.yml"
|
130
|
+
- ".rubocop_todo.yml"
|
129
131
|
- ".travis.yml"
|
130
132
|
- Appraisals
|
131
133
|
- Gemfile
|
@@ -138,18 +140,22 @@ files:
|
|
138
140
|
- gemfiles/active4.0.13.gemfile.lock
|
139
141
|
- gemfiles/active4.1.16.gemfile
|
140
142
|
- gemfiles/active4.1.16.gemfile.lock
|
141
|
-
- gemfiles/active4.2.
|
142
|
-
- gemfiles/active4.2.
|
143
|
-
- gemfiles/active5.0.
|
144
|
-
- gemfiles/active5.0.
|
143
|
+
- gemfiles/active4.2.8.gemfile
|
144
|
+
- gemfiles/active4.2.8.gemfile.lock
|
145
|
+
- gemfiles/active5.0.1.gemfile
|
146
|
+
- gemfiles/active5.0.1.gemfile.lock
|
147
|
+
- gemfiles/active5.1.0.gemfile
|
148
|
+
- gemfiles/active5.1.0.gemfile.lock
|
145
149
|
- gemfiles/rails4.0.13.gemfile
|
146
150
|
- gemfiles/rails4.0.13.gemfile.lock
|
147
151
|
- gemfiles/rails4.1.16.gemfile
|
148
152
|
- gemfiles/rails4.1.16.gemfile.lock
|
149
|
-
- gemfiles/rails4.2.
|
150
|
-
- gemfiles/rails4.2.
|
151
|
-
- gemfiles/rails5.0.
|
152
|
-
- gemfiles/rails5.0.
|
153
|
+
- gemfiles/rails4.2.8.gemfile
|
154
|
+
- gemfiles/rails4.2.8.gemfile.lock
|
155
|
+
- gemfiles/rails5.0.1.gemfile
|
156
|
+
- gemfiles/rails5.0.1.gemfile.lock
|
157
|
+
- gemfiles/rails5.1.0.gemfile
|
158
|
+
- gemfiles/rails5.1.0.gemfile.lock
|
153
159
|
- init.rb
|
154
160
|
- lib/comma.rb
|
155
161
|
- lib/comma/array.rb
|
@@ -196,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
202
|
version: '0'
|
197
203
|
requirements: []
|
198
204
|
rubyforge_project: comma
|
199
|
-
rubygems_version: 2.5.
|
205
|
+
rubygems_version: 2.5.2
|
200
206
|
signing_key:
|
201
207
|
specification_version: 4
|
202
208
|
summary: Ruby Comma Seperated Values generation library
|