dotsync 0.4.0 → 0.4.2

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: 3b49b79875a41ac8a64361efc61108dc18ee203b08804daf40e709e18972ed88
4
- data.tar.gz: f3eaf2a153a9757d98018900245ac7020596aab2844dbf1841d99e5e7ae055c3
3
+ metadata.gz: 9518c58d4295da09d14d43ec60643bf6dd93ddf447d47b5e941e1817cf3a7569
4
+ data.tar.gz: a1effa3db0429cad4816db2128c3afd045d3b2e01dd7e80a12ddfd314974f704
5
5
  SHA512:
6
- metadata.gz: 3315fa7273357e2a61c494e1fa3abdd31ba2e43089888f8dc5174e8bc70ce69fe4bbf553a3db2d647d437b9dae81811056dcc43f7d31bef56736346628ef76b1
7
- data.tar.gz: fa0bdc870da7374523db60c823d527e0ec8c1da8809548b3f4aeaaec03872cf3f96e08bff0c27d73524c80677ef6e765725416d74b57f83d66f57f86cfb31772
6
+ metadata.gz: c48aec258167adfcbb5d2d00f7e5126a264e38a7635c4055d317529ad50d35e45eb62a2b93ce0c5722f858d5ed100aa8a82733f053f6ff5e973387e3df6b7976
7
+ data.tar.gz: 80e316f48c64029624276a6bb4da2b906a76093d0b6e55531cb397bdcb2e3b4e7a0969c228992ad611505b0c125e573849f87f1728c950dab30b29d59a8467b7
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.2] - 2026-03-22
2
+
3
+ ### Fixed
4
+
5
+ - Fix `cp_r_regular_files` crash on pre-existing symlinks during backup (#35)
6
+ - Add `FileUtils.rm_f` before `FileUtils.ln_s` to handle leftover symlinks from partial backup runs
7
+
8
+ ## [0.4.1] - 2026-03-17
9
+
10
+ ### Fixed
11
+
12
+ - Fix backup crash on macOS when directories contain socket files (#33)
13
+ - Replace `FileUtils.cp_r` with custom `cp_r_regular_files` that skips sockets, FIFOs, and device files
14
+ - Socket paths exceeding macOS 104-byte limit no longer cause backup failures
15
+ - Symlinks are properly preserved during backup
16
+
1
17
  ## [0.4.0] - 2026-03-01
2
18
 
3
19
  ### Added
@@ -473,6 +489,7 @@ Add gem executables
473
489
 
474
490
  Initial version
475
491
 
492
+ [0.4.1]: https://github.com/dsaenztagarro/dotsync/compare/v0.4.0...v0.4.1
476
493
  [0.4.0]: https://github.com/dsaenztagarro/dotsync/compare/v0.3.3...v0.4.0
477
494
  [0.3.3]: https://github.com/dsaenztagarro/dotsync/compare/v0.3.2...v0.3.3
478
495
  [0.3.2]: https://github.com/dsaenztagarro/dotsync/compare/v0.3.1...v0.3.2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dotsync (0.4.0)
4
+ dotsync (0.4.1)
5
5
  fileutils (~> 1.7.3)
6
6
  find (~> 0.2.0)
7
7
  listen (~> 3.9.0)
@@ -62,12 +62,30 @@ module Dotsync
62
62
  if File.file?(mapping.src)
63
63
  FileUtils.cp(mapping.dest, backup_path)
64
64
  else
65
- FileUtils.cp_r(mapping.dest, backup_path)
65
+ cp_r_regular_files(mapping.dest, backup_path)
66
66
  end
67
67
  end
68
68
  true
69
69
  end
70
70
 
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.rm_f(dest_entry)
80
+ FileUtils.ln_s(File.readlink(src_entry), dest_entry)
81
+ elsif File.directory?(src_entry)
82
+ cp_r_regular_files(src_entry, dest_entry)
83
+ elsif File.file?(src_entry)
84
+ FileUtils.cp(src_entry, dest_entry, preserve: true)
85
+ end
86
+ end
87
+ end
88
+
71
89
  def purge_old_backups
72
90
  backups = Dir[File.join(backups_root, "*")].sort.reverse
73
91
  if backups.size > 10
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dotsync
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.2"
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.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Sáenz
@@ -367,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
367
367
  - !ruby/object:Gem::Version
368
368
  version: '0'
369
369
  requirements: []
370
- rubygems_version: 3.7.2
370
+ rubygems_version: 3.6.7
371
371
  specification_version: 4
372
372
  summary: Manage dotfiles like a boss
373
373
  test_files: []