dotsync 0.1.22 → 0.1.23

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: f1bb84e77b3093d786b7f502618d7b7ab060deb8b2ea8b0df2a7c3362690f017
4
- data.tar.gz: 21a4b2e7b192d0348c900fd5481939b16cdf7e48ecb27780bbd1b20695133ef5
3
+ metadata.gz: 63f80ee3b4145da856a0750344202adb55eb1d2b8bf2e1da5b8885176aba7eef
4
+ data.tar.gz: ee4e30168d290f6f75d682fee94755b9f34d8e17975f1bd2f6d15936f3f9bd4b
5
5
  SHA512:
6
- metadata.gz: 2bb46cecd31107adca67df98262c21a646c28089f3f3ab63be668119cbc4231d8af5341433fca6b0a848235940aa0a4c223e004db0054ae7b7770f1ebaa17c7b
7
- data.tar.gz: 4e6de7cc7c19cbe5408d689f49e4bd565f4970cbc673c1692313114021046ffaf9fd57efb8fd7446001b9e32a4999eb23a1a6410414fa52a0429b91d43b89b11
6
+ metadata.gz: 30d151ca07b1be8b116ebcb7d27f440f9822cfe127b07cf0c13e8c034b23c0a8526d34f87587d208e83082dccf8bc463df3c2a3eaf0965ae949e3d90a974e086
7
+ data.tar.gz: 8be2548a3144cc24765ee59666370d1267d2c96fd0ddb21187da03cf678846085e19d5ef7f1252c2b979e44d9bade730b4fc7d92bfbc04d4e7052df592cd4ca2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # 0.1.23
2
+
3
+ **Critical Bug Fix:**
4
+ - Fix cleanup_folder to respect 'only' filter and prevent unintended deletions
5
+ - When force=true was used with an 'only' filter, cleanup_folder was deleting all files in the destination that weren't explicitly ignored, including unrelated folders not being managed by the mapping
6
+ - This caused data loss for folders like cabal/ and ghc/ that weren't in the only list
7
+ - The fix ensures only paths matching the inclusion filter are cleaned up, leaving unmanaged content intact
8
+
9
+ **Test Coverage:**
10
+ - Add comprehensive test coverage for the cleanup_folder bug fix
11
+ - Test preserving unrelated folders when using force + only
12
+ - Test only cleaning managed paths specified in only list
13
+ - Test edge case with empty source and unmanaged dest content
14
+ - Update existing test to reflect correct behavior
15
+ - Total: 326 examples, 0 failures, 2 pending with 96.41% line coverage
16
+
1
17
  # 0.1.22
2
18
 
3
19
  **Testing & Quality:**
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dotsync (0.1.22)
4
+ dotsync (0.1.23)
5
5
  fileutils (~> 1.7.3)
6
6
  find (~> 0.2.0)
7
7
  listen (~> 3.9.0)
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Dotsync
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/dotsync.svg)](https://rubygems.org/gems/dotsync)
4
- [![Ruby Gem Test Status](https://github.com/dsaenztagarro/dotsync/actions/workflows/gem-push.yml/badge.svg)](https://github.com/dsaenztagarro/dotsync/actions)
4
+ [![CI](https://github.com/dsaenztagarro/dotsync/actions/workflows/gem-push.yml/badge.svg)](https://github.com/dsaenztagarro/dotsync/actions)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
6
  [![Ruby Version](https://img.shields.io/badge/ruby-%3E%3D%203.2-blue)](https://www.ruby-lang.org/)
7
7
 
@@ -144,10 +144,20 @@ module Dotsync
144
144
  Find.find(target_dir) do |path|
145
145
  next if path == target_dir
146
146
  abs_path = File.expand_path(path)
147
+
148
+ # Skip if ignored
147
149
  if @mapping.ignore?(abs_path)
148
150
  Find.prune if File.directory?(path)
149
151
  next
150
152
  end
153
+
154
+ # When inclusions (only) are specified, only clean up paths that match the inclusion filter
155
+ # This ensures we don't delete unrelated files/folders that aren't being managed
156
+ unless @mapping.include?(abs_path)
157
+ Find.prune if File.directory?(path)
158
+ next
159
+ end
160
+
151
161
  if File.file?(path)
152
162
  FileUtils.rm(path)
153
163
  elsif File.directory?(path) && Dir.empty?(path)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dotsync
4
- VERSION = "0.1.22"
4
+ VERSION = "0.1.23"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Sáenz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-11-10 00:00:00.000000000 Z
11
+ date: 2025-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb