lite-report 1.0.0 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +12 -3
- data/.travis.yml +1 -0
- data/CHANGELOG.md +21 -0
- data/Gemfile.lock +92 -82
- data/README.md +1 -1
- data/lib/generators/lite/report/install_generator.rb +1 -1
- data/lib/lite/report/array.rb +1 -1
- data/lib/lite/report/configuration.rb +15 -9
- data/lib/lite/report/hash.rb +1 -1
- data/lib/lite/report/helpers/encoders.rb +8 -1
- data/lib/lite/report/helpers/records.rb +1 -1
- data/lib/lite/report/helpers/transporters.rb +2 -2
- data/lib/lite/report/record.rb +1 -0
- data/lib/lite/report/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e19a104989a720b33c1d0be498695c26352a0a607d8a2c89af66705958398ed1
|
4
|
+
data.tar.gz: 2df858892aff83bad0042f486e4d9501b7a7ef5886c9139b5496c0c9ac37af73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 153acef279ba609c0b02f30b0651fb5c085231dbc22d713499ffd38b254d0881821060bbe02947eadf2f1f2b853ca002e998460bb918a4fccd9bc60484261a97
|
7
|
+
data.tar.gz: 6001668ff0e2751a674abaec2331ba43f9aec2eda280ac66b5c40c7f234fcb2f505c0ec1b4d7f9e72f2add92c1469aa6622bf959aee89f558e9596c1310ec227
|
data/.rubocop.yml
CHANGED
@@ -2,11 +2,12 @@ require:
|
|
2
2
|
- rubocop-performance
|
3
3
|
- rubocop-rspec
|
4
4
|
AllCops:
|
5
|
-
TargetRubyVersion: 2.
|
5
|
+
TargetRubyVersion: 2.7
|
6
|
+
NewCops: enable
|
6
7
|
DisplayCopNames: true
|
7
8
|
DisplayStyleGuide: true
|
8
|
-
|
9
|
-
|
9
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
10
|
+
Enabled: true
|
10
11
|
Layout/EmptyLinesAroundBlockBody:
|
11
12
|
Exclude:
|
12
13
|
- 'spec/**/**/*'
|
@@ -14,6 +15,14 @@ Layout/EmptyLinesAroundClassBody:
|
|
14
15
|
EnforcedStyle: empty_lines_except_namespace
|
15
16
|
Layout/EmptyLinesAroundModuleBody:
|
16
17
|
EnforcedStyle: empty_lines_except_namespace
|
18
|
+
Layout/LineLength:
|
19
|
+
Max: 100
|
20
|
+
Layout/SpaceAroundMethodCallOperator:
|
21
|
+
Enabled: true
|
22
|
+
Lint/RaiseException:
|
23
|
+
Enabled: true
|
24
|
+
Lint/StructNewOverride:
|
25
|
+
Enabled: true
|
17
26
|
Metrics/BlockLength:
|
18
27
|
Exclude:
|
19
28
|
- 'spec/**/**/*'
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
|
+
|
9
|
+
## [1.0.5] - 2020-07-03
|
10
|
+
### Added
|
11
|
+
- Added Ruby 2.7 support
|
12
|
+
|
13
|
+
## [1.0.4] - 2020-02-11
|
14
|
+
### Changed
|
15
|
+
- Fix record instance not generating
|
16
|
+
|
17
|
+
## [1.0.3] - 2019-08-24
|
18
|
+
### Changed
|
19
|
+
- Fix broken configuration option
|
20
|
+
|
21
|
+
## [1.0.2] - 2019-08-24
|
22
|
+
### Changed
|
23
|
+
- Improved how configuration works
|
24
|
+
|
25
|
+
## [1.0.1] - 2019-08-15
|
26
|
+
### Changed
|
27
|
+
- Underscore initializer file name
|
28
|
+
|
8
29
|
## [1.0.0] - 2019-07-08
|
9
30
|
### Added
|
10
31
|
- Initial project version
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lite-report (1.0.
|
4
|
+
lite-report (1.0.5)
|
5
5
|
activerecord
|
6
6
|
activerecord-import
|
7
7
|
deep_pluck
|
@@ -9,129 +9,139 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionpack (
|
13
|
-
actionview (=
|
14
|
-
activesupport (=
|
15
|
-
rack (~> 2.0)
|
12
|
+
actionpack (6.0.3.2)
|
13
|
+
actionview (= 6.0.3.2)
|
14
|
+
activesupport (= 6.0.3.2)
|
15
|
+
rack (~> 2.0, >= 2.0.8)
|
16
16
|
rack-test (>= 0.6.3)
|
17
17
|
rails-dom-testing (~> 2.0)
|
18
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
19
|
-
actionview (
|
20
|
-
activesupport (=
|
18
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
19
|
+
actionview (6.0.3.2)
|
20
|
+
activesupport (= 6.0.3.2)
|
21
21
|
builder (~> 3.1)
|
22
22
|
erubi (~> 1.4)
|
23
23
|
rails-dom-testing (~> 2.0)
|
24
|
-
rails-html-sanitizer (~> 1.
|
25
|
-
activemodel (
|
26
|
-
activesupport (=
|
27
|
-
activerecord (
|
28
|
-
activemodel (=
|
29
|
-
activesupport (=
|
30
|
-
|
31
|
-
activerecord-import (1.0.2)
|
24
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
25
|
+
activemodel (6.0.3.2)
|
26
|
+
activesupport (= 6.0.3.2)
|
27
|
+
activerecord (6.0.3.2)
|
28
|
+
activemodel (= 6.0.3.2)
|
29
|
+
activesupport (= 6.0.3.2)
|
30
|
+
activerecord-import (1.0.5)
|
32
31
|
activerecord (>= 3.2)
|
33
|
-
activesupport (
|
32
|
+
activesupport (6.0.3.2)
|
34
33
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
35
34
|
i18n (>= 0.7, < 2)
|
36
35
|
minitest (~> 5.1)
|
37
36
|
tzinfo (~> 1.1)
|
38
|
-
|
39
|
-
ast (2.4.
|
40
|
-
builder (3.2.
|
37
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
38
|
+
ast (2.4.1)
|
39
|
+
builder (3.2.4)
|
41
40
|
colorize (0.8.1)
|
42
|
-
concurrent-ruby (1.1.
|
43
|
-
crass (1.0.
|
44
|
-
database_cleaner (1.
|
45
|
-
deep_pluck (1.1.
|
41
|
+
concurrent-ruby (1.1.6)
|
42
|
+
crass (1.0.6)
|
43
|
+
database_cleaner (1.8.5)
|
44
|
+
deep_pluck (1.1.4)
|
46
45
|
activerecord (>= 3)
|
47
46
|
pluck_all (>= 1.2.3)
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
rails_compatibility (>= 0.0.1)
|
48
|
+
diff-lcs (1.4.4)
|
49
|
+
erubi (1.9.0)
|
50
|
+
fasterer (0.8.3)
|
51
51
|
colorize (~> 0.7)
|
52
|
-
ruby_parser (>= 3.
|
52
|
+
ruby_parser (>= 3.14.1)
|
53
53
|
generator_spec (0.9.4)
|
54
54
|
activesupport (>= 3.0.0)
|
55
55
|
railties (>= 3.0.0)
|
56
|
-
i18n (1.
|
56
|
+
i18n (1.8.3)
|
57
57
|
concurrent-ruby (~> 1.0)
|
58
|
-
|
59
|
-
loofah (2.2.3)
|
58
|
+
loofah (2.6.0)
|
60
59
|
crass (~> 1.0.2)
|
61
60
|
nokogiri (>= 1.5.9)
|
62
|
-
method_source (0.
|
61
|
+
method_source (1.0.0)
|
63
62
|
mini_portile2 (2.4.0)
|
64
|
-
minitest (5.
|
65
|
-
nokogiri (1.10.
|
63
|
+
minitest (5.14.1)
|
64
|
+
nokogiri (1.10.9)
|
66
65
|
mini_portile2 (~> 2.4.0)
|
67
|
-
parallel (1.
|
68
|
-
parser (2.
|
69
|
-
ast (~> 2.4.
|
66
|
+
parallel (1.19.2)
|
67
|
+
parser (2.7.1.4)
|
68
|
+
ast (~> 2.4.1)
|
70
69
|
pluck_all (2.0.4)
|
71
70
|
activesupport (>= 3.0.0)
|
72
|
-
|
71
|
+
polyamorous (2.3.2)
|
72
|
+
activerecord (>= 5.2.1)
|
73
|
+
rack (2.2.3)
|
73
74
|
rack-test (1.1.0)
|
74
75
|
rack (>= 1.0, < 3)
|
75
76
|
rails-dom-testing (2.0.3)
|
76
77
|
activesupport (>= 4.2.0)
|
77
78
|
nokogiri (>= 1.6)
|
78
|
-
rails-html-sanitizer (1.0
|
79
|
-
loofah (~> 2.
|
80
|
-
|
81
|
-
|
82
|
-
|
79
|
+
rails-html-sanitizer (1.3.0)
|
80
|
+
loofah (~> 2.3)
|
81
|
+
rails_compatibility (0.0.2)
|
82
|
+
activerecord (>= 3)
|
83
|
+
railties (6.0.3.2)
|
84
|
+
actionpack (= 6.0.3.2)
|
85
|
+
activesupport (= 6.0.3.2)
|
83
86
|
method_source
|
84
87
|
rake (>= 0.8.7)
|
85
|
-
thor (>= 0.
|
88
|
+
thor (>= 0.20.3, < 2.0)
|
86
89
|
rainbow (3.0.0)
|
87
|
-
rake (
|
88
|
-
ransack (2.
|
89
|
-
|
90
|
-
|
91
|
-
activesupport (>= 5.0)
|
90
|
+
rake (13.0.1)
|
91
|
+
ransack (2.3.2)
|
92
|
+
activerecord (>= 5.2.1)
|
93
|
+
activesupport (>= 5.2.1)
|
92
94
|
i18n
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
rspec-
|
99
|
-
|
95
|
+
polyamorous (= 2.3.2)
|
96
|
+
regexp_parser (1.7.1)
|
97
|
+
rexml (3.2.4)
|
98
|
+
rspec (3.9.0)
|
99
|
+
rspec-core (~> 3.9.0)
|
100
|
+
rspec-expectations (~> 3.9.0)
|
101
|
+
rspec-mocks (~> 3.9.0)
|
102
|
+
rspec-core (3.9.2)
|
103
|
+
rspec-support (~> 3.9.3)
|
104
|
+
rspec-expectations (3.9.2)
|
100
105
|
diff-lcs (>= 1.2.0, < 2.0)
|
101
|
-
rspec-support (~> 3.
|
102
|
-
rspec-mocks (3.
|
106
|
+
rspec-support (~> 3.9.0)
|
107
|
+
rspec-mocks (3.9.1)
|
103
108
|
diff-lcs (>= 1.2.0, < 2.0)
|
104
|
-
rspec-support (~> 3.
|
105
|
-
rspec-rails (
|
106
|
-
actionpack (>=
|
107
|
-
activesupport (>=
|
108
|
-
railties (>=
|
109
|
-
rspec-core (~> 3.
|
110
|
-
rspec-expectations (~> 3.
|
111
|
-
rspec-mocks (~> 3.
|
112
|
-
rspec-support (~> 3.
|
113
|
-
rspec-support (3.
|
114
|
-
rubocop (0.
|
115
|
-
jaro_winkler (~> 1.5.1)
|
109
|
+
rspec-support (~> 3.9.0)
|
110
|
+
rspec-rails (4.0.1)
|
111
|
+
actionpack (>= 4.2)
|
112
|
+
activesupport (>= 4.2)
|
113
|
+
railties (>= 4.2)
|
114
|
+
rspec-core (~> 3.9)
|
115
|
+
rspec-expectations (~> 3.9)
|
116
|
+
rspec-mocks (~> 3.9)
|
117
|
+
rspec-support (~> 3.9)
|
118
|
+
rspec-support (3.9.3)
|
119
|
+
rubocop (0.86.0)
|
116
120
|
parallel (~> 1.10)
|
117
|
-
parser (>= 2.
|
121
|
+
parser (>= 2.7.0.1)
|
118
122
|
rainbow (>= 2.2.2, < 4.0)
|
123
|
+
regexp_parser (>= 1.7)
|
124
|
+
rexml
|
125
|
+
rubocop-ast (>= 0.0.3, < 1.0)
|
119
126
|
ruby-progressbar (~> 1.7)
|
120
|
-
unicode-display_width (>= 1.4.0, <
|
121
|
-
rubocop-
|
127
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
128
|
+
rubocop-ast (0.1.0)
|
129
|
+
parser (>= 2.7.0.1)
|
130
|
+
rubocop-performance (1.6.1)
|
122
131
|
rubocop (>= 0.71.0)
|
123
|
-
rubocop-rspec (1.
|
124
|
-
rubocop (>= 0.
|
132
|
+
rubocop-rspec (1.41.0)
|
133
|
+
rubocop (>= 0.68.1)
|
125
134
|
ruby-progressbar (1.10.1)
|
126
|
-
ruby_parser (3.
|
135
|
+
ruby_parser (3.14.2)
|
127
136
|
sexp_processor (~> 4.9)
|
128
|
-
sexp_processor (4.
|
129
|
-
sqlite3 (1.4.
|
130
|
-
thor (0.
|
137
|
+
sexp_processor (4.15.0)
|
138
|
+
sqlite3 (1.4.2)
|
139
|
+
thor (1.0.1)
|
131
140
|
thread_safe (0.3.6)
|
132
|
-
tzinfo (1.2.
|
141
|
+
tzinfo (1.2.7)
|
133
142
|
thread_safe (~> 0.1)
|
134
|
-
unicode-display_width (1.
|
143
|
+
unicode-display_width (1.7.0)
|
144
|
+
zeitwerk (2.3.1)
|
135
145
|
|
136
146
|
PLATFORMS
|
137
147
|
ruby
|
@@ -152,4 +162,4 @@ DEPENDENCIES
|
|
152
162
|
sqlite3
|
153
163
|
|
154
164
|
BUNDLED WITH
|
155
|
-
2.
|
165
|
+
2.1.4
|
data/README.md
CHANGED
data/lib/lite/report/array.rb
CHANGED
@@ -10,21 +10,27 @@ module Lite
|
|
10
10
|
def initialize
|
11
11
|
@csv_options = {}
|
12
12
|
@data_options = {}
|
13
|
-
@
|
13
|
+
@import_options = {}
|
14
14
|
end
|
15
15
|
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
@configuration ||= Configuration.new
|
20
|
-
end
|
18
|
+
class << self
|
21
19
|
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
attr_writer :configuration
|
21
|
+
|
22
|
+
def configuration
|
23
|
+
@configuration ||= Configuration.new
|
24
|
+
end
|
25
|
+
|
26
|
+
def configure
|
27
|
+
yield(configuration)
|
28
|
+
end
|
29
|
+
|
30
|
+
def reset_configuration!
|
31
|
+
@configuration = Configuration.new
|
32
|
+
end
|
25
33
|
|
26
|
-
def self.configure
|
27
|
-
yield(configuration)
|
28
34
|
end
|
29
35
|
|
30
36
|
end
|
data/lib/lite/report/hash.rb
CHANGED
@@ -10,7 +10,14 @@ module Lite
|
|
10
10
|
def encode(cell)
|
11
11
|
return cell unless cell.is_a?(String)
|
12
12
|
|
13
|
-
cell.tr('"', '')
|
13
|
+
cell = cell.tr('"', '')
|
14
|
+
return cell if @data_options[:encode].empty?
|
15
|
+
|
16
|
+
cell.encode!(
|
17
|
+
@data_options[:encode][0],
|
18
|
+
@data_options[:encode][1],
|
19
|
+
**@data_options[:encode][2]
|
20
|
+
)
|
14
21
|
end
|
15
22
|
|
16
23
|
def encode?(delete: false)
|
@@ -8,7 +8,7 @@ module Lite
|
|
8
8
|
private
|
9
9
|
|
10
10
|
def generate_export!
|
11
|
-
CSV.generate(
|
11
|
+
CSV.generate(**@csv_options) do |csv|
|
12
12
|
@data.each do |row|
|
13
13
|
csv << process_export_row!(row)
|
14
14
|
end
|
@@ -33,7 +33,7 @@ module Lite
|
|
33
33
|
|
34
34
|
@data.each do |row|
|
35
35
|
row = process_export_row!(row)
|
36
|
-
csv << CSV.generate_line(row,
|
36
|
+
csv << CSV.generate_line(row, **@csv_options)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
data/lib/lite/report/record.rb
CHANGED
data/lib/lite/report/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lite-report
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -220,7 +220,7 @@ dependencies:
|
|
220
220
|
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
|
-
description:
|
223
|
+
description:
|
224
224
|
email:
|
225
225
|
- j.gomez@drexed.com
|
226
226
|
executables: []
|
@@ -264,7 +264,7 @@ homepage: http://drexed.github.io/lite-report
|
|
264
264
|
licenses:
|
265
265
|
- MIT
|
266
266
|
metadata: {}
|
267
|
-
post_install_message:
|
267
|
+
post_install_message:
|
268
268
|
rdoc_options: []
|
269
269
|
require_paths:
|
270
270
|
- lib
|
@@ -279,8 +279,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
279
|
- !ruby/object:Gem::Version
|
280
280
|
version: '0'
|
281
281
|
requirements: []
|
282
|
-
rubygems_version: 3.
|
283
|
-
signing_key:
|
282
|
+
rubygems_version: 3.1.4
|
283
|
+
signing_key:
|
284
284
|
specification_version: 4
|
285
285
|
summary: Import and export Ruby and Rails objects to flat files and vice versa
|
286
286
|
test_files: []
|