asset_sync 2.19.0 → 2.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -1
- data/lib/asset_sync/storage.rb +3 -2
- data/lib/asset_sync/version.rb +1 -1
- data/spec/unit/storage_spec.rb +40 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3cff5bf62d9a38dccdb2cc331751542d095f116f65d57adb724ff73c9ee5c7a
|
4
|
+
data.tar.gz: e7ae0540fae435e27746843d3f6f252df988d48dfe38f5df0ee33935b6dabc57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bae0a6a3491aa7b5f9e5f45aba77509a0d77511fbe03fe2f293660a58ddd59dfdfbce74f9d4c253350180b40ea623a78871472d135ce8961fb893d820b6991fc
|
7
|
+
data.tar.gz: 1294404e59e81c7557c312c2af66892d5c78c80ceeae4f2d38550389fccea111e5f40b711135ed896d90e83036baf709ba7cdab86ffccd867d414f2af643d741
|
data/CHANGELOG.md
CHANGED
@@ -18,6 +18,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
18
18
|
- Nothing
|
19
19
|
|
20
20
|
|
21
|
+
## [2.19.1] - 2023-08-17
|
22
|
+
|
23
|
+
### Fixed
|
24
|
+
|
25
|
+
- Fix issues from https://github.com/AssetSync/asset_sync/pull/435
|
26
|
+
- https://github.com/AssetSync/asset_sync/commit/35bef657e9c65268e4888d489950184b238ba13f
|
27
|
+
- https://github.com/AssetSync/asset_sync/pull/437
|
28
|
+
|
29
|
+
|
21
30
|
## [2.19.0] - 2023-08-15
|
22
31
|
|
23
32
|
### Added
|
@@ -1094,7 +1103,8 @@ Changes:
|
|
1094
1103
|
* Merge branch 'sinatra'
|
1095
1104
|
|
1096
1105
|
|
1097
|
-
[Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.19.
|
1106
|
+
[Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.19.1...HEAD
|
1107
|
+
[2.19.1]: https://github.com/AssetSync/asset_sync/compare/v2.19.0...v2.19.1
|
1098
1108
|
[2.19.0]: https://github.com/AssetSync/asset_sync/compare/v2.18.1...v2.19.0
|
1099
1109
|
[2.18.1]: https://github.com/AssetSync/asset_sync/compare/v2.18.0...v2.18.1
|
1100
1110
|
[2.18.0]: https://github.com/AssetSync/asset_sync/compare/v2.17.0...v2.18.0
|
data/lib/asset_sync/storage.rb
CHANGED
@@ -264,12 +264,13 @@ module AssetSync
|
|
264
264
|
if config.compression
|
265
265
|
compressed_name = "#{path}/#{f}.#{config.compression}"
|
266
266
|
|
267
|
-
|
267
|
+
# `File.extname` returns value with `.` prefix, `config.compression` contains value without `.`
|
268
|
+
if File.extname(f)[1..-1] == config.compression
|
268
269
|
# Don't bother uploading compressed assets if we are in compression mode
|
269
270
|
# as we will overwrite file.css with file.css.gz if it exists.
|
270
271
|
log "Ignoring: #{f}"
|
271
272
|
ignore = true
|
272
|
-
elsif File.exist?(
|
273
|
+
elsif File.exist?(compressed_name)
|
273
274
|
original_size = File.size("#{path}/#{f}")
|
274
275
|
compressed_size = File.size(compressed_name)
|
275
276
|
|
data/lib/asset_sync/version.rb
CHANGED
data/spec/unit/storage_spec.rb
CHANGED
@@ -393,6 +393,46 @@ describe AssetSync::Storage do
|
|
393
393
|
end
|
394
394
|
storage.upload_file('assets/some_longer_path/local_image2.jpg')
|
395
395
|
end
|
396
|
+
|
397
|
+
context 'config.gzip_compression is enabled' do
|
398
|
+
context 'when the file is a css file' do
|
399
|
+
it 'should upload the file' do
|
400
|
+
@config.gzip_compression = true
|
401
|
+
|
402
|
+
storage = AssetSync::Storage.new(@config)
|
403
|
+
allow(storage).to receive(:get_local_files).and_return(@local_files)
|
404
|
+
allow(storage).to receive(:get_remote_files).and_return(@remote_files)
|
405
|
+
# Pretend they all exist
|
406
|
+
allow(File).to receive(:open).and_return(file_like_object)
|
407
|
+
bucket = double
|
408
|
+
files = double
|
409
|
+
allow(storage).to receive(:bucket).and_return(bucket)
|
410
|
+
allow(bucket).to receive(:files).and_return(files)
|
411
|
+
|
412
|
+
expect(files).to receive(:create).with({ body: file_like_object, content_type: "text/css", key: "assets/local.css", public: true }).once
|
413
|
+
storage.upload_file('assets/local.css')
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
417
|
+
context 'when the file is a gz file' do
|
418
|
+
it 'should not upload the file' do
|
419
|
+
@config.gzip_compression = true
|
420
|
+
|
421
|
+
storage = AssetSync::Storage.new(@config)
|
422
|
+
allow(storage).to receive(:get_local_files).and_return(@local_files)
|
423
|
+
allow(storage).to receive(:get_remote_files).and_return(@remote_files)
|
424
|
+
# Pretend they all exist
|
425
|
+
allow(File).to receive(:open).and_return(file_like_object)
|
426
|
+
bucket = double
|
427
|
+
files = double
|
428
|
+
allow(storage).to receive(:bucket).and_return(bucket)
|
429
|
+
allow(bucket).to receive(:files).and_return(files)
|
430
|
+
|
431
|
+
expect(files).to_not receive(:create)
|
432
|
+
storage.upload_file('assets/local.css.gz')
|
433
|
+
end
|
434
|
+
end
|
435
|
+
end
|
396
436
|
end
|
397
437
|
|
398
438
|
describe '#delete_extra_remote_files' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asset_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.19.
|
4
|
+
version: 2.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Hamilton
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2023-08-
|
14
|
+
date: 2023-08-17 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: fog-core
|