active_model_exporters 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 6.0"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,169 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ active_model_exporters (0.5.2)
5
+ rails (>= 4.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (6.0.0)
11
+ actionpack (= 6.0.0)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailbox (6.0.0)
15
+ actionpack (= 6.0.0)
16
+ activejob (= 6.0.0)
17
+ activerecord (= 6.0.0)
18
+ activestorage (= 6.0.0)
19
+ activesupport (= 6.0.0)
20
+ mail (>= 2.7.1)
21
+ actionmailer (6.0.0)
22
+ actionpack (= 6.0.0)
23
+ actionview (= 6.0.0)
24
+ activejob (= 6.0.0)
25
+ mail (~> 2.5, >= 2.5.4)
26
+ rails-dom-testing (~> 2.0)
27
+ actionpack (6.0.0)
28
+ actionview (= 6.0.0)
29
+ activesupport (= 6.0.0)
30
+ rack (~> 2.0)
31
+ rack-test (>= 0.6.3)
32
+ rails-dom-testing (~> 2.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
+ actiontext (6.0.0)
35
+ actionpack (= 6.0.0)
36
+ activerecord (= 6.0.0)
37
+ activestorage (= 6.0.0)
38
+ activesupport (= 6.0.0)
39
+ nokogiri (>= 1.8.5)
40
+ actionview (6.0.0)
41
+ activesupport (= 6.0.0)
42
+ builder (~> 3.1)
43
+ erubi (~> 1.4)
44
+ rails-dom-testing (~> 2.0)
45
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
+ activejob (6.0.0)
47
+ activesupport (= 6.0.0)
48
+ globalid (>= 0.3.6)
49
+ activemodel (6.0.0)
50
+ activesupport (= 6.0.0)
51
+ activerecord (6.0.0)
52
+ activemodel (= 6.0.0)
53
+ activesupport (= 6.0.0)
54
+ activestorage (6.0.0)
55
+ actionpack (= 6.0.0)
56
+ activejob (= 6.0.0)
57
+ activerecord (= 6.0.0)
58
+ marcel (~> 0.3.1)
59
+ activesupport (6.0.0)
60
+ concurrent-ruby (~> 1.0, >= 1.0.2)
61
+ i18n (>= 0.7, < 2)
62
+ minitest (~> 5.1)
63
+ tzinfo (~> 1.1)
64
+ zeitwerk (~> 2.1, >= 2.1.8)
65
+ appraisal (2.2.0)
66
+ bundler
67
+ rake
68
+ thor (>= 0.14.0)
69
+ builder (3.2.3)
70
+ concurrent-ruby (1.1.5)
71
+ coveralls (0.8.23)
72
+ json (>= 1.8, < 3)
73
+ simplecov (~> 0.16.1)
74
+ term-ansicolor (~> 1.3)
75
+ thor (>= 0.19.4, < 2.0)
76
+ tins (~> 1.6)
77
+ crass (1.0.4)
78
+ docile (1.3.2)
79
+ erubi (1.8.0)
80
+ globalid (0.4.2)
81
+ activesupport (>= 4.2.0)
82
+ i18n (1.6.0)
83
+ concurrent-ruby (~> 1.0)
84
+ json (2.2.0)
85
+ loofah (2.2.3)
86
+ crass (~> 1.0.2)
87
+ nokogiri (>= 1.5.9)
88
+ mail (2.7.1)
89
+ mini_mime (>= 0.1.1)
90
+ marcel (0.3.3)
91
+ mimemagic (~> 0.3.2)
92
+ method_source (0.9.2)
93
+ mimemagic (0.3.3)
94
+ mini_mime (1.0.2)
95
+ mini_portile2 (2.4.0)
96
+ minitest (5.11.3)
97
+ nio4r (2.4.0)
98
+ nokogiri (1.10.4)
99
+ mini_portile2 (~> 2.4.0)
100
+ rack (2.0.7)
101
+ rack-test (1.1.0)
102
+ rack (>= 1.0, < 3)
103
+ rails (6.0.0)
104
+ actioncable (= 6.0.0)
105
+ actionmailbox (= 6.0.0)
106
+ actionmailer (= 6.0.0)
107
+ actionpack (= 6.0.0)
108
+ actiontext (= 6.0.0)
109
+ actionview (= 6.0.0)
110
+ activejob (= 6.0.0)
111
+ activemodel (= 6.0.0)
112
+ activerecord (= 6.0.0)
113
+ activestorage (= 6.0.0)
114
+ activesupport (= 6.0.0)
115
+ bundler (>= 1.3.0)
116
+ railties (= 6.0.0)
117
+ sprockets-rails (>= 2.0.0)
118
+ rails-dom-testing (2.0.3)
119
+ activesupport (>= 4.2.0)
120
+ nokogiri (>= 1.6)
121
+ rails-html-sanitizer (1.2.0)
122
+ loofah (~> 2.2, >= 2.2.2)
123
+ railties (6.0.0)
124
+ actionpack (= 6.0.0)
125
+ activesupport (= 6.0.0)
126
+ method_source
127
+ rake (>= 0.8.7)
128
+ thor (>= 0.20.3, < 2.0)
129
+ rake (12.3.3)
130
+ simplecov (0.16.1)
131
+ docile (~> 1.1)
132
+ json (>= 1.8, < 3)
133
+ simplecov-html (~> 0.10.0)
134
+ simplecov-html (0.10.2)
135
+ sprockets (3.7.2)
136
+ concurrent-ruby (~> 1.0)
137
+ rack (> 1, < 3)
138
+ sprockets-rails (3.2.1)
139
+ actionpack (>= 4.0)
140
+ activesupport (>= 4.0)
141
+ sprockets (>= 3.0.0)
142
+ sqlite3 (1.4.1)
143
+ term-ansicolor (1.7.1)
144
+ tins (~> 1.0)
145
+ thor (0.20.3)
146
+ thread_safe (0.3.6)
147
+ tins (1.21.1)
148
+ tzinfo (1.2.5)
149
+ thread_safe (~> 0.1)
150
+ websocket-driver (0.7.1)
151
+ websocket-extensions (>= 0.1.0)
152
+ websocket-extensions (0.1.4)
153
+ zeitwerk (2.1.9)
154
+
155
+ PLATFORMS
156
+ ruby
157
+
158
+ DEPENDENCIES
159
+ active_model_exporters!
160
+ appraisal (~> 2.2)
161
+ bundler (~> 2.0)
162
+ coveralls (~> 0.8)
163
+ minitest (~> 5.0)
164
+ rails (~> 6.0)
165
+ rake (~> 12.0)
166
+ sqlite3 (~> 1.4)
167
+
168
+ BUNDLED WITH
169
+ 2.0.2
@@ -9,12 +9,6 @@ module ActiveModel
9
9
 
10
10
  def attributes(*attrs)
11
11
  @_attributes.concat(attrs)
12
-
13
- attrs.each do |attr|
14
- define_method(attr) do
15
- object.send(attr)
16
- end unless method_defined?(attr)
17
- end
18
12
  end
19
13
 
20
14
  def exporter_for(resource)
@@ -32,7 +26,12 @@ module ActiveModel
32
26
 
33
27
  def values
34
28
  attrs = filter(attributes)
35
- attributes.map { |attr| send(attr) if attrs.include?(attr) }
29
+ attributes.map do |attr|
30
+ if attrs.include?(attr)
31
+ next send(attr) if respond_to?(attr)
32
+ object.send(attr)
33
+ end
34
+ end
36
35
  end
37
36
 
38
37
  def filter(attrs)
@@ -1,5 +1,5 @@
1
1
  module ActiveModel
2
2
  class Exporter
3
- VERSION = '0.5.1'
3
+ VERSION = '0.5.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,29 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_model_exporters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Gutiérrez
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-22 00:00:00.000000000 Z
11
+ date: 2019-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: activemodel
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '12.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '12.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sqlite3
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.4'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '5.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '5.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: appraisal
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.2'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: coveralls
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.8'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.8'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rails
15
99
  requirement: !ruby/object:Gem::Requirement
16
100
  requirements:
17
101
  - - ">="
18
102
  - !ruby/object:Gem::Version
19
- version: '4.0'
103
+ version: '4.2'
20
104
  type: :runtime
21
105
  prerelease: false
22
106
  version_requirements: !ruby/object:Gem::Requirement
23
107
  requirements:
24
108
  - - ">="
25
109
  - !ruby/object:Gem::Version
26
- version: '4.0'
110
+ version: '4.2'
27
111
  description: A simple way to export data in Rails.
28
112
  email:
29
113
  - alejandrodevs@gmail.com
@@ -40,12 +124,10 @@ files:
40
124
  - README.md
41
125
  - Rakefile
42
126
  - active_model_exporters.gemspec
43
- - gemfiles/rails_4.gemfile
44
- - gemfiles/rails_4.gemfile.lock
45
127
  - gemfiles/rails_5.2.gemfile
46
128
  - gemfiles/rails_5.2.gemfile.lock
47
- - gemfiles/rails_5.gemfile
48
- - gemfiles/rails_5.gemfile.lock
129
+ - gemfiles/rails_6.0.gemfile
130
+ - gemfiles/rails_6.0.gemfile.lock
49
131
  - lib/action_controller/exportation.rb
50
132
  - lib/action_controller/exportation/mime_types.rb
51
133
  - lib/action_controller/exportation/renderers.rb
@@ -54,19 +136,13 @@ files:
54
136
  - lib/active_model/exporter/types.rb
55
137
  - lib/active_model/exporter/version.rb
56
138
  - lib/active_model_exporters.rb
57
- - test/fixtures/active_record/exporters.rb
58
- - test/fixtures/active_record/models.rb
59
- - test/fixtures/exporters.rb
60
- - test/fixtures/locale.rb
61
- - test/fixtures/models.rb
62
- - test/integration/action_controller/exportation/csv_test.rb
63
- - test/integration/action_controller/exportation/xls_test.rb
64
- - test/integration/active_record/exportation/csv_test.rb
65
- - test/test_helper.rb
66
139
  homepage: https://github.com/alejandrodevs/active_model_exporters
67
140
  licenses:
68
141
  - MIT
69
- metadata: {}
142
+ metadata:
143
+ homepage_uri: https://github.com/alejandrodevs/active_model_exporters
144
+ source_code_uri: https://github.com/alejandrodevs/active_model_exporters
145
+ changelog_uri: https://github.com/alejandrodevs/active_model_exporters/blob/master/LICENSE.txt
70
146
  post_install_message:
71
147
  rdoc_options: []
72
148
  require_paths:
@@ -75,25 +151,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
151
  requirements:
76
152
  - - ">="
77
153
  - !ruby/object:Gem::Version
78
- version: 2.0.0
154
+ version: '0'
79
155
  required_rubygems_version: !ruby/object:Gem::Requirement
80
156
  requirements:
81
157
  - - ">="
82
158
  - !ruby/object:Gem::Version
83
159
  version: '0'
84
160
  requirements: []
85
- rubyforge_project:
86
- rubygems_version: 2.7.3
161
+ rubygems_version: 3.0.3
87
162
  signing_key:
88
163
  specification_version: 4
89
164
  summary: A simple way to export data in Rails.
90
- test_files:
91
- - test/fixtures/active_record/exporters.rb
92
- - test/fixtures/active_record/models.rb
93
- - test/fixtures/exporters.rb
94
- - test/fixtures/locale.rb
95
- - test/fixtures/models.rb
96
- - test/integration/action_controller/exportation/csv_test.rb
97
- - test/integration/action_controller/exportation/xls_test.rb
98
- - test/integration/active_record/exportation/csv_test.rb
99
- - test/test_helper.rb
165
+ test_files: []
@@ -1,11 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sqlite3"
6
- gem "simplecov"
7
- gem "appraisal"
8
- gem "coveralls", require: false
9
- gem "rails", "~> 4.2"
10
-
11
- gemspec path: "../"
@@ -1,142 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- active_model_exporters (0.5.1)
5
- activemodel (>= 4.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- actionmailer (4.2.10)
11
- actionpack (= 4.2.10)
12
- actionview (= 4.2.10)
13
- activejob (= 4.2.10)
14
- mail (~> 2.5, >= 2.5.4)
15
- rails-dom-testing (~> 1.0, >= 1.0.5)
16
- actionpack (4.2.10)
17
- actionview (= 4.2.10)
18
- activesupport (= 4.2.10)
19
- rack (~> 1.6)
20
- rack-test (~> 0.6.2)
21
- rails-dom-testing (~> 1.0, >= 1.0.5)
22
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
- actionview (4.2.10)
24
- activesupport (= 4.2.10)
25
- builder (~> 3.1)
26
- erubis (~> 2.7.0)
27
- rails-dom-testing (~> 1.0, >= 1.0.5)
28
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
29
- activejob (4.2.10)
30
- activesupport (= 4.2.10)
31
- globalid (>= 0.3.0)
32
- activemodel (4.2.10)
33
- activesupport (= 4.2.10)
34
- builder (~> 3.1)
35
- activerecord (4.2.10)
36
- activemodel (= 4.2.10)
37
- activesupport (= 4.2.10)
38
- arel (~> 6.0)
39
- activesupport (4.2.10)
40
- i18n (~> 0.7)
41
- minitest (~> 5.1)
42
- thread_safe (~> 0.3, >= 0.3.4)
43
- tzinfo (~> 1.1)
44
- appraisal (2.2.0)
45
- bundler
46
- rake
47
- thor (>= 0.14.0)
48
- arel (6.0.4)
49
- builder (3.2.3)
50
- concurrent-ruby (1.0.5)
51
- coveralls (0.7.2)
52
- multi_json (~> 1.3)
53
- rest-client (= 1.6.7)
54
- simplecov (>= 0.7)
55
- term-ansicolor (= 1.2.2)
56
- thor (= 0.18.1)
57
- crass (1.0.4)
58
- docile (1.3.0)
59
- erubis (2.7.0)
60
- globalid (0.4.1)
61
- activesupport (>= 4.2.0)
62
- i18n (0.9.5)
63
- concurrent-ruby (~> 1.0)
64
- json (2.1.0)
65
- loofah (2.2.2)
66
- crass (~> 1.0.2)
67
- nokogiri (>= 1.5.9)
68
- mail (2.7.0)
69
- mini_mime (>= 0.1.1)
70
- mime-types (3.1)
71
- mime-types-data (~> 3.2015)
72
- mime-types-data (3.2016.0521)
73
- mini_mime (1.0.0)
74
- mini_portile2 (2.3.0)
75
- minitest (5.11.3)
76
- multi_json (1.13.1)
77
- nokogiri (1.8.2)
78
- mini_portile2 (~> 2.3.0)
79
- rack (1.6.10)
80
- rack-test (0.6.3)
81
- rack (>= 1.0)
82
- rails (4.2.10)
83
- actionmailer (= 4.2.10)
84
- actionpack (= 4.2.10)
85
- actionview (= 4.2.10)
86
- activejob (= 4.2.10)
87
- activemodel (= 4.2.10)
88
- activerecord (= 4.2.10)
89
- activesupport (= 4.2.10)
90
- bundler (>= 1.3.0, < 2.0)
91
- railties (= 4.2.10)
92
- sprockets-rails
93
- rails-deprecated_sanitizer (1.0.3)
94
- activesupport (>= 4.2.0.alpha)
95
- rails-dom-testing (1.0.9)
96
- activesupport (>= 4.2.0, < 5.0)
97
- nokogiri (~> 1.6)
98
- rails-deprecated_sanitizer (>= 1.0.1)
99
- rails-html-sanitizer (1.0.4)
100
- loofah (~> 2.2, >= 2.2.2)
101
- railties (4.2.10)
102
- actionpack (= 4.2.10)
103
- activesupport (= 4.2.10)
104
- rake (>= 0.8.7)
105
- thor (>= 0.18.1, < 2.0)
106
- rake (12.3.1)
107
- rest-client (1.6.7)
108
- mime-types (>= 1.16)
109
- simplecov (0.16.1)
110
- docile (~> 1.1)
111
- json (>= 1.8, < 3)
112
- simplecov-html (~> 0.10.0)
113
- simplecov-html (0.10.2)
114
- sprockets (3.7.1)
115
- concurrent-ruby (~> 1.0)
116
- rack (> 1, < 3)
117
- sprockets-rails (3.2.1)
118
- actionpack (>= 4.0)
119
- activesupport (>= 4.0)
120
- sprockets (>= 3.0.0)
121
- sqlite3 (1.3.13)
122
- term-ansicolor (1.2.2)
123
- tins (~> 0.8)
124
- thor (0.18.1)
125
- thread_safe (0.3.6)
126
- tins (0.13.2)
127
- tzinfo (1.2.5)
128
- thread_safe (~> 0.1)
129
-
130
- PLATFORMS
131
- ruby
132
-
133
- DEPENDENCIES
134
- active_model_exporters!
135
- appraisal
136
- coveralls
137
- rails (~> 4.2)
138
- simplecov
139
- sqlite3
140
-
141
- BUNDLED WITH
142
- 1.16.2