dotsync 0.1.25 → 0.1.27

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.
@@ -31,6 +31,7 @@ module Dotsync
31
31
  def diff_mapping_directories
32
32
  additions = []
33
33
  modifications = []
34
+ modification_pairs = []
34
35
  removals = []
35
36
 
36
37
  Find.find(mapping_src) do |src_path|
@@ -48,6 +49,7 @@ module Dotsync
48
49
  elsif File.file?(src_path) && File.file?(dest_path)
49
50
  if files_differ?(src_path, dest_path)
50
51
  modifications << rel_path
52
+ modification_pairs << { rel_path: rel_path, src: src_path, dest: dest_path }
51
53
  end
52
54
  end
53
55
  end
@@ -67,21 +69,29 @@ module Dotsync
67
69
  end
68
70
  end
69
71
 
72
+ filtered_modifications = filter_ignores(modifications)
73
+ modification_pairs = modification_pairs.select { |pair| filtered_modifications.include?(pair[:rel_path]) }
74
+
70
75
  additions = relative_to_absolute(filter_ignores(additions), mapping_original_dest)
71
- modifications = relative_to_absolute(filter_ignores(modifications), mapping_original_dest)
76
+ modifications = relative_to_absolute(filtered_modifications, mapping_original_dest)
72
77
  removals = relative_to_absolute(filter_ignores(removals), mapping_original_dest)
73
78
 
74
- Dotsync::Diff.new(additions: additions, modifications: modifications, removals: removals)
79
+ Dotsync::Diff.new(additions: additions, modifications: modifications, removals: removals, modification_pairs: modification_pairs)
75
80
  end
76
81
 
77
82
  def diff_mapping_files
78
- Dotsync::Diff.new.tap do |diff|
79
- if @mapping.file_present_in_src_only?
80
- diff.additions << @mapping.original_dest
81
- elsif @mapping.file_changed?
82
- diff.modifications << @mapping.original_dest
83
- end
83
+ additions = []
84
+ modifications = []
85
+ modification_pairs = []
86
+
87
+ if @mapping.file_present_in_src_only?
88
+ additions << @mapping.original_dest
89
+ elsif @mapping.file_changed?
90
+ modifications << @mapping.original_dest
91
+ modification_pairs << { rel_path: File.basename(@mapping.original_dest), src: @mapping.src, dest: @mapping.dest }
84
92
  end
93
+
94
+ Dotsync::Diff.new(additions: additions, modifications: modifications, modification_pairs: modification_pairs)
85
95
  end
86
96
 
87
97
  def filter_ignores(all_paths)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dotsync
4
- VERSION = "0.1.25"
4
+ VERSION = "0.1.27"
5
5
  end
data/lib/dotsync.rb CHANGED
@@ -22,6 +22,7 @@ require_relative "dotsync/version"
22
22
 
23
23
  # Config Concerns (loaded early as they're used by other modules)
24
24
  require_relative "dotsync/config/concerns/xdg_base_directory"
25
+ require_relative "dotsync/config/concerns/sync_mappings"
25
26
 
26
27
  # Utils
27
28
  require_relative "dotsync/utils/path_utils"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.25
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Sáenz
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-11-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: toml-rb
@@ -285,9 +284,10 @@ extensions: []
285
284
  extra_rdoc_files: []
286
285
  files:
287
286
  - ".editorconfig"
288
- - ".github/workflows/gem-push.yml"
289
- - ".github/workflows/gem-push.yml.bak"
287
+ - ".github/workflows/ci.yml"
288
+ - ".github/workflows/release.yml"
290
289
  - ".gitignore"
290
+ - ".pre-commit-config.yaml"
291
291
  - ".rspec"
292
292
  - ".rubocop.yml"
293
293
  - ".ruby-version"
@@ -317,6 +317,7 @@ files:
317
317
  - lib/dotsync/actions/watch_action.rb
318
318
  - lib/dotsync/colors.rb
319
319
  - lib/dotsync/config/base_config.rb
320
+ - lib/dotsync/config/concerns/sync_mappings.rb
320
321
  - lib/dotsync/config/concerns/xdg_base_directory.rb
321
322
  - lib/dotsync/config/pull_action_config.rb
322
323
  - lib/dotsync/config/push_action_config.rb
@@ -333,6 +334,7 @@ files:
333
334
  - lib/dotsync/runner.rb
334
335
  - lib/dotsync/tasks/actions.rake
335
336
  - lib/dotsync/utils/config_cache.rb
337
+ - lib/dotsync/utils/content_diff.rb
336
338
  - lib/dotsync/utils/directory_differ.rb
337
339
  - lib/dotsync/utils/file_transfer.rb
338
340
  - lib/dotsync/utils/logger.rb
@@ -346,7 +348,6 @@ metadata:
346
348
  homepage_uri: https://github.com/dsaenztagarro/dotsync
347
349
  source_code_uri: https://github.com/dsaenztagarro/dotsync
348
350
  changelog_uri: https://github.com/dsaenztagarro/dotsync/blob/master/CHANGELOG.md
349
- post_install_message:
350
351
  rdoc_options: []
351
352
  require_paths:
352
353
  - lib
@@ -361,8 +362,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
361
362
  - !ruby/object:Gem::Version
362
363
  version: '0'
363
364
  requirements: []
364
- rubygems_version: 3.4.19
365
- signing_key:
365
+ rubygems_version: 3.7.2
366
366
  specification_version: 4
367
367
  summary: Manage dotfiles like a boss
368
368
  test_files: []
@@ -1,45 +0,0 @@
1
- jobs:
2
- build:
3
- name: Build + Publish
4
- runs-on: ubuntu-latest
5
- permissions:
6
- contents: read
7
- packages: write
8
-
9
- steps:
10
- - uses: actions/checkout@v4
11
-
12
- - name: Publish to GPR
13
- run: |
14
- mkdir -p $HOME/.gem
15
- touch $HOME/.gem/credentials
16
- chmod 0600 $HOME/.gem/credentials
17
- printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
18
- gem build *.gemspec
19
- gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
20
- env:
21
- GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
22
- OWNER: ${{ github.repository_owner }}
23
-
24
- publish:
25
- needs: test
26
- runs-on: ubuntu-latest
27
- if: github.ref == 'refs/heads/master' && matrix.ruby == '3.2'
28
-
29
- steps:
30
- - uses: actions/checkout@v4
31
-
32
- - name: Set up Ruby
33
- uses: ruby/setup-ruby@v1
34
- with:
35
- ruby-version: 3.2
36
- bundler-cache: true
37
-
38
- - name: Check if gem version has changed
39
- id: gem_version_check
40
- run: |
41
- gem build *.gemspec
42
- gem_name=$(ls *.gem | head -n 1)
43
- gem info $gem_name --remote || echo "new_version" > version_changed
44
- env:
45
- GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"