asset_sync 2.19.1 → 2.19.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3cff5bf62d9a38dccdb2cc331751542d095f116f65d57adb724ff73c9ee5c7a
4
- data.tar.gz: e7ae0540fae435e27746843d3f6f252df988d48dfe38f5df0ee33935b6dabc57
3
+ metadata.gz: f70e24d97f3b4f93b46abf1fc3548542c68459068488f77345c2372a2469eb69
4
+ data.tar.gz: 1b56251e0bf37a3a9ba87c2686489c0f28651a8869d0b218dcf8f523c98e9588
5
5
  SHA512:
6
- metadata.gz: bae0a6a3491aa7b5f9e5f45aba77509a0d77511fbe03fe2f293660a58ddd59dfdfbce74f9d4c253350180b40ea623a78871472d135ce8961fb893d820b6991fc
7
- data.tar.gz: 1294404e59e81c7557c312c2af66892d5c78c80ceeae4f2d38550389fccea111e5f40b711135ed896d90e83036baf709ba7cdab86ffccd867d414f2af643d741
6
+ metadata.gz: f3610b941614fbb44286c170fa4c5c6868207c67e18979ae25e520db158d66c4f343164b4c4c8f920fa1b33d5056166e53cf1e9782601aa11deb0ddf6e2a8a15
7
+ data.tar.gz: c7682095497be9206f92e4cddfcee6c1da9046a4445b99031ca1c89814c53c952d05ff73cc52a04f2c4e920d18e9f0874df7dbb5d7680d63f4898edf6e2347a7
@@ -26,7 +26,7 @@ jobs:
26
26
 
27
27
  steps:
28
28
  - name: Checkout
29
- uses: actions/checkout@v3
29
+ uses: actions/checkout@v4
30
30
 
31
31
  - name: Initialize CodeQL
32
32
  uses: github/codeql-action/init@v2
@@ -26,33 +26,27 @@ jobs:
26
26
  os:
27
27
  - ubuntu
28
28
  ruby:
29
- - 2.7
30
29
  - 3.0
31
30
  - 3.1
32
31
  - 3.2
32
+ - 3.3
33
33
  - jruby
34
34
  gemfile:
35
- - gemfiles/rails_6_0.gemfile
36
35
  - gemfiles/rails_6_1.gemfile
37
36
  - gemfiles/rails_7_0.gemfile
37
+ - gemfiles/rails_7_1.gemfile
38
+ - gemfiles/rails_7_2.gemfile
38
39
  allow_failures:
39
40
  - false
40
41
  include:
41
42
  - os: ubuntu
42
43
  ruby: ruby-head
43
- gemfile: gemfiles/rails_7_0.gemfile
44
+ gemfile: gemfiles/rails_7_2.gemfile
44
45
  allow_failures: true
45
46
  - os: ubuntu
46
47
  ruby: jruby-head
47
- gemfile: gemfiles/rails_7_0.gemfile
48
+ gemfile: gemfiles/rails_7_2.gemfile
48
49
  allow_failures: true
49
- exclude:
50
- - os: ubuntu
51
- ruby: jruby
52
- # Rails 7 requires Ruby 2.7
53
- # `jruby-9.3.7.0` only supports 2.6.x
54
- gemfile: gemfiles/rails_7_0.gemfile
55
- allow_failures: false
56
50
  env:
57
51
  BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
58
52
  ALLOW_FAILURES: "${{ matrix.allow_failures }}"
@@ -60,7 +54,7 @@ jobs:
60
54
  continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
61
55
  steps:
62
56
  - name: Checkout
63
- uses: actions/checkout@v3
57
+ uses: actions/checkout@v4
64
58
  - name: Setup Ruby
65
59
  uses: ruby/setup-ruby@v1
66
60
  with:
data/Appraisals CHANGED
@@ -1,8 +1,4 @@
1
1
 
2
- appraise "rails_6_0" do
3
- gem "rails", "~> 6.0.0"
4
- end
5
-
6
2
  appraise "rails_6_1" do
7
3
  gem "rails", "~> 6.1.0"
8
4
  end
@@ -10,3 +6,11 @@ end
10
6
  appraise "rails_7_0" do
11
7
  gem "rails", "~> 7.0.0"
12
8
  end
9
+
10
+ appraise "rails_7_1" do
11
+ gem "rails", "~> 7.1.0"
12
+ end
13
+
14
+ appraise "rails_7_2" do
15
+ gem "rails", "~> 7.2.0"
16
+ end
data/CHANGELOG.md CHANGED
@@ -18,6 +18,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
18
18
  - Nothing
19
19
 
20
20
 
21
+ ## [2.19.2] - 2024-08-29
22
+
23
+ ### Fixed
24
+
25
+ - Avoid duplicate files in remote files list cache
26
+ (https://github.com/AssetSync/asset_sync/pull/439)
27
+ - Drop trailing slash of prefix in #get_local_files
28
+ (https://github.com/AssetSync/asset_sync/pull/425)
29
+
30
+
21
31
  ## [2.19.1] - 2023-08-17
22
32
 
23
33
  ### Fixed
@@ -5,6 +5,6 @@ source "https://rubygems.org"
5
5
  gem "rcov", platforms: :mri_18, group: [:development, :test]
6
6
  gem "simplecov", platforms: [:jruby, :mri_19, :ruby_19, :mri_20, :rbx], group: [:development, :test], require: false
7
7
  gem "jruby-openssl", platform: :jruby
8
- gem "rails", "~> 6.0.0"
8
+ gem "rails", "~> 7.1.0"
9
9
 
10
10
  gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rcov", platforms: :mri_18, group: [:development, :test]
6
+ gem "simplecov", platforms: [:jruby, :mri_19, :ruby_19, :mri_20, :rbx], group: [:development, :test], require: false
7
+ gem "jruby-openssl", platform: :jruby
8
+ gem "rails", "~> 7.2.0"
9
+
10
+ gemspec path: "../"
@@ -108,7 +108,7 @@ module AssetSync
108
108
  return if ignore_existing_remote_files?
109
109
 
110
110
  File.open(self.remote_file_list_cache_file_path, 'w') do |file|
111
- uploaded = local_files_to_upload + remote_files
111
+ uploaded = (local_files_to_upload + remote_files).uniq.sort
112
112
  file.write(uploaded.to_json)
113
113
  end
114
114
  end
@@ -171,7 +171,7 @@ module AssetSync
171
171
 
172
172
  log "Using: Directory Search of #{path}/#{self.config.assets_prefix}"
173
173
  Dir.chdir(path) do
174
- to_load = self.config.assets_prefix.present? ? "#{self.config.assets_prefix}/**/**" : '**/**'
174
+ to_load = self.config.assets_prefix.present? ? File.join(self.config.assets_prefix, '/**/**') : '**/**'
175
175
  Dir[to_load]
176
176
  end
177
177
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AssetSync
4
- VERSION = "2.19.1"
4
+ VERSION = "2.19.2"
5
5
  end
@@ -1,4 +1,5 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
+ require 'fileutils'
2
3
 
3
4
  describe AssetSync::Storage do
4
5
  include_context "mock Rails without_yml"
@@ -490,4 +491,52 @@ describe AssetSync::Storage do
490
491
  end
491
492
  end
492
493
  end
494
+
495
+ describe '#get_local_files' do
496
+ around(:each) do |example|
497
+ Dir.mktmpdir do |public_path|
498
+ @public_path = public_path
499
+ example.call
500
+ end
501
+ end
502
+
503
+ before(:each) do
504
+ @config = AssetSync::Config.new
505
+ @config.public_path = @public_path
506
+ @config.prefix = 'assets'
507
+ @storage = AssetSync::Storage.new(@config)
508
+
509
+ Dir.mkdir("#{@public_path}/assets")
510
+ end
511
+
512
+ context 'with empty directory' do
513
+ it 'has no files' do
514
+ expect(@storage.get_local_files).to eq([])
515
+ end
516
+ end
517
+
518
+ context 'with non-empty directory' do
519
+ before(:each) do
520
+ FileUtils.touch("#{@public_path}/assets/application.js")
521
+ end
522
+
523
+ it 'lists available files' do
524
+ expect(@storage.get_local_files).to eq([
525
+ 'assets/application.js'
526
+ ])
527
+ end
528
+
529
+ context 'with trailing slash on asset prefix' do
530
+ before(:each) do
531
+ @config.prefix = 'assets/'
532
+ end
533
+
534
+ it 'lists available files with single slashes' do
535
+ expect(@storage.get_local_files).to eq([
536
+ 'assets/application.js'
537
+ ])
538
+ end
539
+ end
540
+ end
541
+ end
493
542
  end
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.1
4
+ version: 2.19.2
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-17 00:00:00.000000000 Z
14
+ date: 2024-08-29 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fog-core
@@ -233,9 +233,10 @@ files:
233
233
  - UPGRADING.md
234
234
  - asset_sync.gemspec
235
235
  - docs/heroku.md
236
- - gemfiles/rails_6_0.gemfile
237
236
  - gemfiles/rails_6_1.gemfile
238
237
  - gemfiles/rails_7_0.gemfile
238
+ - gemfiles/rails_7_1.gemfile
239
+ - gemfiles/rails_7_2.gemfile
239
240
  - lib/asset_sync.rb
240
241
  - lib/asset_sync/asset_sync.rb
241
242
  - lib/asset_sync/config.rb
@@ -288,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
289
  - !ruby/object:Gem::Version
289
290
  version: '0'
290
291
  requirements: []
291
- rubygems_version: 3.4.18
292
+ rubygems_version: 3.5.18
292
293
  signing_key:
293
294
  specification_version: 4
294
295
  summary: Synchronises Assets in a Rails 3 application and Amazon S3/Cloudfront and