dotsync 0.4.1 → 0.4.3

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: f1914fdcd07e4e248821a67f44903e98dd2445bb33c8fc5932af156d6da2c759
4
- data.tar.gz: e6cf1fa237ebf65356524856ef1f57243dc0c8a22ce113836c0ff32622d94ec6
3
+ metadata.gz: 3c3cafce147e8573ff819e662666f78cd1d2cb7a2735c112cddcfccad00238a0
4
+ data.tar.gz: aa9e6385afc45546411af829bd269808ca4f6539bdb50153147ba86498c22e12
5
5
  SHA512:
6
- metadata.gz: 55195d77f422a37d3746180f4ce42b9cc6b5b5a80ee02b4a735973d3403adfebe305653e7595345b75961be0d2d2c2179ee71c33513c94a952b20265435985e7
7
- data.tar.gz: 10516395feb7ea6aaacab2ee7636eefda0a555c53d7d8f6b462532fb3e31e7c86bfd9dab4320d78322f8e6df6d940f3e116b597cf318fe0ef60e97627bb2d2da
6
+ metadata.gz: 4bd02887f8602282d62f40cedd9e969122861275428751d4056a6bc83beda5ef4ce1ee9574dd1ee71744148378c7b294281b6029c11440104fd990ba150e612a
7
+ data.tar.gz: 3278ed54194865ed62296a0976e2e468f0248716342b27c53971207fe2ebcb2a6634af225dabd68943e7300dd9aed3dc075ceaed78000580dfa3142d28ed30ae
data/AGENTS.md CHANGED
@@ -1,93 +1,27 @@
1
- # Agents
2
-
3
- This document describes AI agents and automation helpers that can assist with developing and maintaining the Dotsync project.
4
-
5
- ## Development Agents
6
-
7
- ### Code Review Agent
8
-
9
- **Purpose**: Review code changes for quality, consistency, and adherence to Ruby best practices.
10
-
11
- **When to use**:
12
- - Before submitting pull requests
13
- - After implementing new features
14
- - When refactoring existing code
15
-
16
- **What it checks**:
17
- - Ruby style guide compliance (follows .rubocop.yml)
18
- - Test coverage for new functionality
19
- - Proper error handling
20
- - Documentation completeness
21
- - Performance considerations
22
-
23
- ### Test Generation Agent
24
-
25
- **Purpose**: Generate and enhance RSpec tests for Dotsync functionality.
26
-
27
- **When to use**:
28
- - When adding new actions or utilities
29
- - When test coverage is insufficient
30
- - When refactoring existing code
31
-
32
- **Focus areas**:
33
- - Unit tests for models (Mapping, Diff)
34
- - Integration tests for actions (PullAction, PushAction, WatchAction)
35
- - Edge cases and error scenarios
36
- - File system operations
37
-
38
- ### Documentation Agent
39
-
40
- **Purpose**: Maintain and improve project documentation.
41
-
42
- **When to use**:
43
- - After adding new features
44
- - When configuration options change
45
- - When updating usage examples
46
-
47
- **Responsibilities**:
48
- - Keep README.md synchronized with code
49
- - Update inline code documentation
50
- - Maintain CHANGELOG.md
51
- - Generate usage examples
52
-
53
- ## Maintenance Agents
54
-
55
- ### Dependency Update Agent
56
-
57
- **Purpose**: Monitor and suggest updates for gem dependencies.
58
-
59
- **What it monitors**:
60
- - Security vulnerabilities in dependencies
61
- - New versions of runtime and development dependencies
62
- - Ruby version compatibility
63
-
64
- ### Release Agent
65
-
66
- **Purpose**: Assist with the release process following RELEASING.md guidelines.
67
-
68
- **Checklist**:
69
- - Version number updated in version.rb
70
- - CHANGELOG.md updated with changes
71
- - Tests passing
72
- - RuboCop compliance
73
- - Tag creation and push
74
- - Gem publication to rubygems.org
75
-
76
- ## Usage
77
-
78
- To work with these agents effectively:
79
-
80
- 1. **Be specific**: Provide clear context about what you're working on
81
- 2. **Reference files**: Point to specific files or line numbers when discussing issues
82
- 3. **Run tests**: Always run `rake spec` after changes
83
- 4. **Follow conventions**: Adhere to existing code patterns and Ruby style guide
84
-
85
- ## Contributing
86
-
87
- When working with agents on this project:
88
-
89
- - Review generated code carefully before committing
90
- - Ensure all tests pass (`rake spec`)
91
- - Run RuboCop (`bundle exec rubocop`)
92
- - Update documentation as needed
93
- - Follow the project's [Code of Conduct](CODE_OF_CONDUCT.md)
1
+ # Coding Agent Guidelines
2
+
3
+ ## Commands
4
+ - Run all tests: `rake spec` or `bundle exec rspec`
5
+ - Run single test: `bundle exec rspec spec/path/to/file_spec.rb` or `bundle exec rspec spec/path/to/file_spec.rb:42`
6
+ - Lint: `bundle exec rubocop` (auto-fix: `bundle exec rubocop -a`)
7
+ - Build gem: `rake build`
8
+
9
+ ## Code Style
10
+ - **Ruby version**: >= 3.2.0
11
+ - **Frozen string literal**: Always include `# frozen_string_literal: true` at top of files
12
+ - **Indentation**: 2 spaces, no tabs
13
+ - **Strings**: Double quotes (`"string"`)
14
+ - **Hash syntax**: Modern style (`{ a: 1 }`)
15
+ - **Method definitions**: Always use parentheses for methods with parameters
16
+ - **Spacing**: Space after colons, commas, around operators; `foo { bar }` not `foo {bar}`
17
+
18
+ ## Project Structure
19
+ - Actions: `lib/dotsync/actions/` - Core operations (PullAction, PushAction, WatchAction)
20
+ - Config: `lib/dotsync/config/` - Configuration management with XDG support
21
+ - Models: `lib/dotsync/models/` - Domain models (Mapping, Diff)
22
+ - Utils: `lib/dotsync/utils/` - Helpers (FileTransfer, DirectoryDiffer, Logger, PathUtils)
23
+ - Tests: `spec/` - RSpec tests mirroring lib structure
24
+
25
+ ## Error Handling
26
+ - Use custom errors from `lib/dotsync/errors.rb`: `ConfigError`, `FileTransferError`, `PermissionError`, `DiskFullError`, `SymlinkError`, `TypeConflictError`
27
+ - Always use `raise ErrorClass, "message"` for explicit error handling
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [0.4.3] - 2026-03-22
2
+
3
+ ### Fixed
4
+
5
+ - Fix backup to respect `only`/`ignore` filters via FileTransfer reuse (#37)
6
+ - Backup no longer copies entire destination directories — only files matching sync filters are backed up
7
+ - Fixes `Permission denied` crash when destination contains restricted files (e.g. `.git/objects`) outside the filter
8
+ - Removes `cp_r_regular_files` in favor of reusing `FileTransfer` with a backup mapping
9
+
10
+ ## [0.4.2] - 2026-03-22
11
+
12
+ ### Fixed
13
+
14
+ - Fix `cp_r_regular_files` crash on pre-existing symlinks during backup (#35)
15
+ - Add `FileUtils.rm_f` before `FileUtils.ln_s` to handle leftover symlinks from partial backup runs
16
+
1
17
  ## [0.4.1] - 2026-03-17
2
18
 
3
19
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dotsync (0.4.1)
4
+ dotsync (0.4.2)
5
5
  fileutils (~> 1.7.3)
6
6
  find (~> 0.2.0)
7
7
  listen (~> 3.9.0)
@@ -62,29 +62,19 @@ module Dotsync
62
62
  if File.file?(mapping.src)
63
63
  FileUtils.cp(mapping.dest, backup_path)
64
64
  else
65
- cp_r_regular_files(mapping.dest, backup_path)
65
+ backup_mapping = Dotsync::Mapping.new(
66
+ "src" => mapping.dest,
67
+ "dest" => backup_path,
68
+ "only" => mapping.original_only,
69
+ "ignore" => mapping.original_ignores,
70
+ "force" => false
71
+ )
72
+ Dotsync::FileTransfer.new(backup_mapping).transfer
66
73
  end
67
74
  end
68
75
  true
69
76
  end
70
77
 
71
- # Recursively copy a directory, skipping sockets, FIFOs, and device files.
72
- # FileUtils.cp_r fails on macOS when socket paths exceed the 104-byte limit.
73
- def cp_r_regular_files(src, dest)
74
- FileUtils.mkdir_p(dest)
75
- Dir.each_child(src) do |entry|
76
- src_entry = File.join(src, entry)
77
- dest_entry = File.join(dest, entry)
78
- if File.symlink?(src_entry)
79
- FileUtils.ln_s(File.readlink(src_entry), dest_entry)
80
- elsif File.directory?(src_entry)
81
- cp_r_regular_files(src_entry, dest_entry)
82
- elsif File.file?(src_entry)
83
- FileUtils.cp(src_entry, dest_entry, preserve: true)
84
- end
85
- end
86
- end
87
-
88
78
  def purge_old_backups
89
79
  backups = Dir[File.join(backups_root, "*")].sort.reverse
90
80
  if backups.size > 10
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dotsync
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Sáenz