webpacker_uploader 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e574118301b21c8bcf8dae3686a791d0d335554c09b16776de598418989463e
4
- data.tar.gz: 65423231b058c0808aacd401720ce7345e194488a2c8add95fee100278d0c197
3
+ metadata.gz: 9d407175001e05a3c3522b8c9bba99cafc72cb32a9df652365ce1439c52d767c
4
+ data.tar.gz: df8db318be96fab4093276b64eab2af88a8a958b0770acd5c239435f76c84005
5
5
  SHA512:
6
- metadata.gz: dd586f4296617a0898c73f58c5c88bd68a29f58f3ffd2982472325e52c47b684bbb764afb705fb3648815b97d9a34f892d624a907447d4f94241a457944a9c63
7
- data.tar.gz: c68ea8fdac8579bfb52caa4928cd0474331653cefc6c418ca242cbda2ebd70a8432603ea9cd84d432eb3443ae3759d3f6bcdb3f84cb6506f528e275df8c64ff9
6
+ metadata.gz: 8a633e9148248ad9b0e4650ebf45d6cfcb8a57cc1033ad4c070439e1a1b2883f45deec3b55e78b49f0f74b9f1c0047f6a0b5293ed4cdf593009aeff4c9a56342
7
+ data.tar.gz: f69e05fbc4fff7ba958dd5d0075d0a85cea9edf4508917e5f3be78fb37442a980c1c85d0363151d37f1f2afef7a8248d080a7de49c141a7256c9c3b20ff53cff
data/.rubocop.yml CHANGED
@@ -1,20 +1,18 @@
1
- require: rubocop-performance
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-minitest
2
4
 
3
5
  AllCops:
4
6
  TargetRubyVersion: 2.5
5
7
  # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
6
8
  # to ignore them, so only the ones explicitly set in this file are enabled.
7
9
  DisabledByDefault: true
10
+ SuggestExtensions: false
8
11
 
9
12
  # Prefer &&/|| over and/or.
10
13
  Style/AndOr:
11
14
  Enabled: true
12
15
 
13
- # Do not use braces for hash literals when they are the last argument of a
14
- # method call.
15
- Style/BracesAroundHashParameters:
16
- Enabled: true
17
-
18
16
  # Align `when` with `case`.
19
17
  Layout/CaseIndentation:
20
18
  Enabled: true
@@ -47,7 +45,7 @@ Style/HashSyntax:
47
45
  # extra level of indentation.
48
46
  Layout/IndentationConsistency:
49
47
  Enabled: true
50
- EnforcedStyle: rails
48
+ EnforcedStyle: indented_internal_methods
51
49
 
52
50
  # Two spaces, no tabs (for indentation).
53
51
  Layout/IndentationWidth:
@@ -96,11 +94,11 @@ Style/StringLiterals:
96
94
  EnforcedStyle: double_quotes
97
95
 
98
96
  # Detect hard tabs, no hard tabs.
99
- Layout/Tab:
97
+ Layout/IndentationStyle:
100
98
  Enabled: true
101
99
 
102
100
  # Blank lines should not have any spaces.
103
- Layout/TrailingBlankLines:
101
+ Layout/TrailingEmptyLines:
104
102
  Enabled: true
105
103
 
106
104
  # No trailing whitespace.
@@ -108,7 +106,7 @@ Layout/TrailingWhitespace:
108
106
  Enabled: true
109
107
 
110
108
  # Use quotes for string literals when they are enough.
111
- Style/UnneededPercentQ:
109
+ Style/RedundantPercentQ:
112
110
  Enabled: true
113
111
 
114
112
  # Align `end` with the matching keyword or starting expression except for
@@ -120,3 +118,192 @@ Layout/EndAlignment:
120
118
  # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
121
119
  Lint/RequireParentheses:
122
120
  Enabled: true
121
+
122
+ Minitest/AssertEmpty:
123
+ Enabled: true
124
+
125
+ Minitest/AssertEmptyLiteral:
126
+ Enabled: true
127
+
128
+ Minitest/AssertEqual:
129
+ Enabled: true
130
+
131
+ Minitest/AssertionInLifecycleHook:
132
+ Enabled: true
133
+
134
+ Minitest/AssertMatch:
135
+ Enabled: true
136
+
137
+ Minitest/AssertIncludes:
138
+ Enabled: true
139
+
140
+ Minitest/AssertInstanceOf:
141
+ Enabled: true
142
+
143
+ Minitest/AssertKindOf:
144
+ Enabled: true
145
+
146
+ Minitest/AssertNil:
147
+ Enabled: true
148
+
149
+ Minitest/AssertOutput:
150
+ Enabled: true
151
+
152
+ Minitest/AssertPathExists:
153
+ Enabled: true
154
+
155
+ Minitest/AssertRespondTo:
156
+ Enabled: true
157
+
158
+ Minitest/AssertSilent:
159
+ Enabled: true
160
+
161
+ Minitest/AssertTruthy:
162
+ Enabled: true
163
+
164
+ Minitest/GlobalExpectations:
165
+ Enabled: true
166
+
167
+ Minitest/LiteralAsActualArgument:
168
+ Enabled: true
169
+
170
+ Minitest/RefuteEmpty:
171
+ Enabled: true
172
+
173
+ Minitest/RefuteEqual:
174
+ Enabled: true
175
+
176
+ Minitest/RefuteFalse:
177
+ Enabled: true
178
+
179
+ Minitest/RefuteIncludes:
180
+ Enabled: true
181
+
182
+ Minitest/RefuteMatch:
183
+ Enabled: true
184
+
185
+ Minitest/RefuteInstanceOf:
186
+ Enabled: true
187
+
188
+ Minitest/RefuteKindOf:
189
+ Enabled: true
190
+
191
+ Minitest/RefuteNil:
192
+ Enabled: true
193
+
194
+ Minitest/RefutePathExists:
195
+ Enabled: true
196
+
197
+ Minitest/RefuteRespondTo:
198
+ Enabled: true
199
+
200
+ Minitest/TestMethodName:
201
+ Enabled: true
202
+
203
+ Minitest/UnspecifiedException:
204
+ Enabled: true
205
+
206
+ # Use `bind_call(obj, args, ...)` instead of `bind(obj).call(args, ...)`.
207
+ Performance/BindCall:
208
+ Enabled: true
209
+
210
+ # Use `caller(n..n)` instead of `caller`.
211
+ Performance/Caller:
212
+ Enabled: true
213
+
214
+ # Use `casecmp` for case comparison.
215
+ Performance/Casecmp:
216
+ Enabled: true
217
+
218
+ # Extract Array and Hash literals outside of loops into local variables or constants.
219
+ Performance/CollectionLiteralInLoop:
220
+ Enabled: true
221
+
222
+ # Prefer `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.
223
+ Performance/CompareWithBlock:
224
+ Enabled: true
225
+
226
+ # Use `count` instead of `{select,find_all,filter,reject}...{size,count,length}`.
227
+ Performance/Count:
228
+ Enabled: true
229
+
230
+ # Use `delete_prefix` instead of `gsub`.
231
+ Performance/DeletePrefix:
232
+ Enabled: true
233
+
234
+ # Use `delete_suffix` instead of `gsub`.
235
+ Performance/DeleteSuffix:
236
+ Enabled: true
237
+
238
+ # Use `detect` instead of `select.first`, `find_all.first`, `filter.first`, `select.last`, `find_all.last`, and `filter.last`.
239
+ Performance/Detect:
240
+ Enabled: true
241
+
242
+ # Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
243
+ Performance/DoubleStartEndWith:
244
+ Enabled: true
245
+
246
+ # Use `end_with?` instead of a regex match anchored to the end of a string.
247
+ Performance/EndWith:
248
+ Enabled: true
249
+
250
+ # Do not compute the size of statically sized objects except in constants.
251
+ Performance/FixedSize:
252
+ Enabled: true
253
+
254
+ # Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1).
255
+ Performance/FlatMap:
256
+ Enabled: true
257
+
258
+ # Use `key?` or `value?` instead of `keys.include?` or `values.include?`.
259
+ Performance/InefficientHashSearch:
260
+ Enabled: true
261
+
262
+ # Use `Range#cover?` instead of `Range#include?` (or `Range#member?`).
263
+ Performance/RangeInclude:
264
+ Enabled: true
265
+
266
+ # Use `yield` instead of `block.call`.
267
+ Performance/RedundantBlockCall:
268
+ Enabled: true
269
+
270
+ # Use `=~` instead of `String#match` or `Regexp#match` in a context where the returned `MatchData` is not needed.
271
+ Performance/RedundantMatch:
272
+ Enabled: true
273
+
274
+ # Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
275
+ Performance/RedundantMerge:
276
+ Enabled: true
277
+
278
+ # Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`, `Regexp#===`, or `=~` when `MatchData` is not used.
279
+ Performance/RegexpMatch:
280
+ Enabled: true
281
+
282
+ # Use `reverse_each` instead of `reverse.each`.
283
+ Performance/ReverseEach:
284
+ Enabled: true
285
+
286
+ # Use `size` instead of `count` for counting the number of elements in `Array` and `Hash`.
287
+ Performance/Size:
288
+ Enabled: true
289
+
290
+ # Use `start_with?` instead of a regex match anchored to the beginning of a string.
291
+ Performance/StartWith:
292
+ Enabled: true
293
+
294
+ # Use `tr` instead of `gsub` when you are replacing the same number of characters.
295
+ # Use `delete` instead of `gsub` when you are deleting characters.
296
+ Performance/StringReplacement:
297
+ Enabled: true
298
+
299
+ # Checks for .times.map calls.
300
+ Performance/TimesMap:
301
+ Enabled: true
302
+
303
+ # Use unary plus to get an unfrozen string literal.
304
+ Performance/UnfreezeString:
305
+ Enabled: true
306
+
307
+ # Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.
308
+ Performance/UriDefaultParser:
309
+ Enabled: true
data/.yardopts ADDED
@@ -0,0 +1,8 @@
1
+ --title "WebpackerUploader Documentation"
2
+ --readme README.md
3
+ --markup markdown
4
+ --hide-void-return
5
+ --no-private
6
+ -
7
+ CHANGELOG.md
8
+ MIT-LICENSE
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [[0.4.0]](https://github.com/tlatsas/webpacker_uploader/releases/tag/v0.4.0) - 2021-05-25
8
+
9
+ ### Changed
10
+
11
+ - Logger is now part of the configuration object instead of a class attribute. ([#9](https://github.com/tlatsas/webpacker_uploader/pull/9), [@tlatsas](https://github.com/tlatsas))
12
+
7
13
  ## [[0.3.0]](https://github.com/tlatsas/webpacker_uploader/releases/tag/v0.3.0) - 2021-03-06
8
14
 
9
15
  ### Added
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ gemspec
4
4
 
5
5
  gem "rake", ">= 11.1"
6
6
  gem "aws-sdk-s3"
7
+ gem "yard", "~> 0.9"
7
8
 
8
9
  group :test do
9
10
  gem "minitest", "~> 5.0"
data/Gemfile.lock CHANGED
@@ -1,33 +1,34 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webpacker_uploader (0.3.0)
4
+ webpacker_uploader (0.4.0)
5
5
  mime-types
6
+ rack (~> 2.0)
6
7
  webpacker (>= 5.1)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- actionpack (6.1.3)
12
- actionview (= 6.1.3)
13
- activesupport (= 6.1.3)
12
+ actionpack (6.1.3.2)
13
+ actionview (= 6.1.3.2)
14
+ activesupport (= 6.1.3.2)
14
15
  rack (~> 2.0, >= 2.0.9)
15
16
  rack-test (>= 0.6.3)
16
17
  rails-dom-testing (~> 2.0)
17
18
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.1.3)
19
- activesupport (= 6.1.3)
19
+ actionview (6.1.3.2)
20
+ activesupport (= 6.1.3.2)
20
21
  builder (~> 3.1)
21
22
  erubi (~> 1.4)
22
23
  rails-dom-testing (~> 2.0)
23
24
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activesupport (6.1.3)
25
+ activesupport (6.1.3.2)
25
26
  concurrent-ruby (~> 1.0, >= 1.0.2)
26
27
  i18n (>= 1.6, < 2)
27
28
  minitest (>= 5.1)
28
29
  tzinfo (~> 2.0)
29
30
  zeitwerk (~> 2.3)
30
- ast (2.4.1)
31
+ ast (2.4.2)
31
32
  aws-eventstream (1.1.0)
32
33
  aws-partitions (1.376.0)
33
34
  aws-sdk-core (3.108.0)
@@ -48,22 +49,23 @@ GEM
48
49
  concurrent-ruby (1.1.8)
49
50
  crass (1.0.6)
50
51
  erubi (1.10.0)
51
- i18n (1.8.9)
52
+ i18n (1.8.10)
52
53
  concurrent-ruby (~> 1.0)
53
- jaro_winkler (1.5.4)
54
54
  jmespath (1.4.0)
55
- loofah (2.9.0)
55
+ loofah (2.9.1)
56
56
  crass (~> 1.0.2)
57
57
  nokogiri (>= 1.5.9)
58
58
  method_source (1.0.0)
59
59
  mime-types (3.3.1)
60
60
  mime-types-data (~> 3.2015)
61
- mime-types-data (3.2020.0512)
61
+ mime-types-data (3.2021.0225)
62
+ mini_portile2 (2.5.1)
62
63
  minitest (5.14.2)
63
- nokogiri (1.11.1)
64
+ nokogiri (1.11.5)
65
+ mini_portile2 (~> 2.5.0)
64
66
  racc (~> 1.4)
65
- parallel (1.19.2)
66
- parser (2.7.1.4)
67
+ parallel (1.20.1)
68
+ parser (3.0.0.0)
67
69
  ast (~> 2.4.1)
68
70
  racc (1.5.2)
69
71
  rack (2.2.3)
@@ -76,34 +78,44 @@ GEM
76
78
  nokogiri (>= 1.6)
77
79
  rails-html-sanitizer (1.3.0)
78
80
  loofah (~> 2.3)
79
- railties (6.1.3)
80
- actionpack (= 6.1.3)
81
- activesupport (= 6.1.3)
81
+ railties (6.1.3.2)
82
+ actionpack (= 6.1.3.2)
83
+ activesupport (= 6.1.3.2)
82
84
  method_source
83
85
  rake (>= 0.8.7)
84
86
  thor (~> 1.0)
85
87
  rainbow (3.0.0)
86
88
  rake (12.3.3)
87
- rubocop (0.68.1)
88
- jaro_winkler (~> 1.5.1)
89
+ regexp_parser (2.1.1)
90
+ rexml (3.2.5)
91
+ rubocop (1.11.0)
89
92
  parallel (~> 1.10)
90
- parser (>= 2.5, != 2.5.1.1)
93
+ parser (>= 3.0.0.0)
91
94
  rainbow (>= 2.2.2, < 4.0)
95
+ regexp_parser (>= 1.8, < 3.0)
96
+ rexml
97
+ rubocop-ast (>= 1.2.0, < 2.0)
92
98
  ruby-progressbar (~> 1.7)
93
- unicode-display_width (>= 1.4.0, < 1.6)
94
- rubocop-performance (1.3.0)
95
- rubocop (>= 0.68.0)
96
- ruby-progressbar (1.10.1)
97
- semantic_range (2.3.1)
99
+ unicode-display_width (>= 1.4.0, < 3.0)
100
+ rubocop-ast (1.4.1)
101
+ parser (>= 2.7.1.5)
102
+ rubocop-minitest (0.10.3)
103
+ rubocop (>= 0.87, < 2.0)
104
+ rubocop-performance (1.10.1)
105
+ rubocop (>= 0.90.0, < 2.0)
106
+ rubocop-ast (>= 0.4.0)
107
+ ruby-progressbar (1.11.0)
108
+ semantic_range (3.0.0)
98
109
  thor (1.1.0)
99
110
  tzinfo (2.0.4)
100
111
  concurrent-ruby (~> 1.0)
101
- unicode-display_width (1.5.0)
102
- webpacker (5.2.1)
112
+ unicode-display_width (2.0.0)
113
+ webpacker (5.4.0)
103
114
  activesupport (>= 5.2)
104
115
  rack-proxy (>= 0.6.1)
105
116
  railties (>= 5.2)
106
117
  semantic_range (>= 2.3.0)
118
+ yard (0.9.26)
107
119
  zeitwerk (2.4.2)
108
120
 
109
121
  PLATFORMS
@@ -114,9 +126,11 @@ DEPENDENCIES
114
126
  bundler (>= 1.3.0)
115
127
  minitest (~> 5.0)
116
128
  rake (>= 11.1)
117
- rubocop (< 0.69)
129
+ rubocop (= 1.11.0)
130
+ rubocop-minitest
118
131
  rubocop-performance
119
132
  webpacker_uploader!
133
+ yard (~> 0.9)
120
134
 
121
135
  BUNDLED WITH
122
136
  2.1.4
data/README.md CHANGED
@@ -15,14 +15,14 @@ S3 + CDN, outside of your Rails application.
15
15
  Add this line to your application's Gemfile:
16
16
 
17
17
  ```ruby
18
- gem "webpacker_uploader"
18
+ gem "webpacker_uploader", require: false
19
19
  ```
20
20
 
21
- And then execute:
21
+ and run:
22
22
 
23
23
  $ bundle install
24
24
 
25
- Or install it yourself as:
25
+ or:
26
26
 
27
27
  $ gem install webpacker_uploader
28
28
 
@@ -34,6 +34,8 @@ gem "aws-sdk-s3", require: false
34
34
 
35
35
  ## Usage
36
36
 
37
+ Usually, in a Rake task you would add the following to upload the assets to AWS S3:
38
+
37
39
  ```ruby
38
40
  require "webpacker_uploader"
39
41
  require "webpacker_uploader/providers/aws"
@@ -107,6 +109,7 @@ WebpackerUploader currently supports the following configuration options:
107
109
  | option | description | default value |
108
110
  |----------------------|--------------------------------------------------------------|---------------------------------------|
109
111
  | ignored_extensions | Which files uploader should skip based on the file extension | [] |
112
+ | logger | The logger to use for logging | ActiveSupport::Logger.new(STDOUT) |
110
113
  | log_output | Log output as we upload files | true |
111
114
  | public_manifest_path | The webpack manifest path | Webpacker.config.public_manifest_path |
112
115
  | public_path | The webpack public output path | Webpacker.config.public_path |