dotsync 0.1.6 → 0.1.8
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 +4 -4
 - data/CHANGELOG.md +9 -0
 - data/Gemfile.lock +3 -3
 - data/lib/dotsync/actions/concerns/mappings_transfer.rb +12 -9
 - data/lib/dotsync/colors.rb +3 -3
 - data/lib/dotsync/config/base_config.rb +4 -0
 - data/lib/dotsync/icons.rb +2 -0
 - data/lib/dotsync/runner.rb +2 -2
 - data/lib/dotsync/utils/directory_differ.rb +10 -0
 - data/lib/dotsync/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3d19236d9990f40338b046f38198ddee169c172ec1d57f8914661af46c758c4d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1999643c1f8ce059eb4e51fc6699005630d6c7a575fbd58a60f018a88b80174e
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: '03262956f985e6aa2b2e82de93546f75aa6ea45964f976561a2d53464b6c3a27a28a0a3b06135a3305b0f932b8316b2ec58b414234fc016fd3412542ef8e3182'
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 46e24ab637d1ea4c7217ce4e5c318b268b5aebeac36f166c4944bbc3434d4dcfdf2021af54e57e6840d1d889f94f997c6b5208e67d8cee444618384c3dcea65a
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            PATH
         
     | 
| 
       2 
2 
     | 
    
         
             
              remote: .
         
     | 
| 
       3 
3 
     | 
    
         
             
              specs:
         
     | 
| 
       4 
     | 
    
         
            -
                dotsync (0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
                dotsync (0.1.8)
         
     | 
| 
       5 
5 
     | 
    
         
             
                  fileutils (~> 1.7.3)
         
     | 
| 
       6 
6 
     | 
    
         
             
                  find (~> 0.2.0)
         
     | 
| 
       7 
7 
     | 
    
         
             
                  listen (~> 3.9.0)
         
     | 
| 
         @@ -37,7 +37,7 @@ GEM 
     | 
|
| 
       37 
37 
     | 
    
         
             
                logger (1.7.0)
         
     | 
| 
       38 
38 
     | 
    
         
             
                ostruct (0.6.3)
         
     | 
| 
       39 
39 
     | 
    
         
             
                parallel (1.27.0)
         
     | 
| 
       40 
     | 
    
         
            -
                parser (3.3. 
     | 
| 
      
 40 
     | 
    
         
            +
                parser (3.3.10.0)
         
     | 
| 
       41 
41 
     | 
    
         
             
                  ast (~> 2.4.1)
         
     | 
| 
       42 
42 
     | 
    
         
             
                  racc
         
     | 
| 
       43 
43 
     | 
    
         
             
                prism (1.6.0)
         
     | 
| 
         @@ -90,7 +90,7 @@ GEM 
     | 
|
| 
       90 
90 
     | 
    
         
             
                rubocop-rspec (3.7.0)
         
     | 
| 
       91 
91 
     | 
    
         
             
                  lint_roller (~> 1.1)
         
     | 
| 
       92 
92 
     | 
    
         
             
                  rubocop (~> 1.72, >= 1.72.1)
         
     | 
| 
       93 
     | 
    
         
            -
                ruby-lsp (0.26. 
     | 
| 
      
 93 
     | 
    
         
            +
                ruby-lsp (0.26.2)
         
     | 
| 
       94 
94 
     | 
    
         
             
                  language_server-protocol (~> 3.17.0)
         
     | 
| 
       95 
95 
     | 
    
         
             
                  prism (>= 1.2, < 2.0)
         
     | 
| 
       96 
96 
     | 
    
         
             
                  rbs (>= 3, < 5)
         
     | 
| 
         @@ -7,7 +7,7 @@ module Dotsync 
     | 
|
| 
       7 
7 
     | 
    
         
             
                def_delegator :@config, :mappings
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
                def show_mappings
         
     | 
| 
       10 
     | 
    
         
            -
                  info("Mappings:", icon: :config 
     | 
| 
      
 10 
     | 
    
         
            +
                  info("Mappings:", icon: :config)
         
     | 
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
                  mappings.each do |mapping|
         
     | 
| 
       13 
13 
     | 
    
         
             
                    logger.log("  #{mapping}")
         
     | 
| 
         @@ -18,14 +18,17 @@ module Dotsync 
     | 
|
| 
       18 
18 
     | 
    
         
             
                  diffs = valid_mappings.map do |mapping|
         
     | 
| 
       19 
19 
     | 
    
         
             
                    Dotsync::DirectoryDiffer.new(mapping).diff
         
     | 
| 
       20 
20 
     | 
    
         
             
                  end
         
     | 
| 
       21 
     | 
    
         
            -
                  diffs. 
     | 
| 
       22 
     | 
    
         
            -
                     
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
                     
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
                     
     | 
| 
      
 21 
     | 
    
         
            +
                  if diffs.any?
         
     | 
| 
      
 22 
     | 
    
         
            +
                    info("Diff:", icon: :diff)
         
     | 
| 
      
 23 
     | 
    
         
            +
                    diffs.flat_map(&:additions).sort.each do |path|
         
     | 
| 
      
 24 
     | 
    
         
            +
                      logger.log("  #{path}", color: Dotsync::Colors.diff_additions)
         
     | 
| 
      
 25 
     | 
    
         
            +
                    end
         
     | 
| 
      
 26 
     | 
    
         
            +
                    diffs.flat_map(&:modifications).sort.each do |path|
         
     | 
| 
      
 27 
     | 
    
         
            +
                      logger.log("  #{path}", color: Dotsync::Colors.diff_modifications)
         
     | 
| 
      
 28 
     | 
    
         
            +
                    end
         
     | 
| 
      
 29 
     | 
    
         
            +
                    diffs.flat_map(&:removals).sort.each do |path|
         
     | 
| 
      
 30 
     | 
    
         
            +
                      logger.log("  #{path}", color: Dotsync::Colors.diff_removals)
         
     | 
| 
      
 31 
     | 
    
         
            +
                    end
         
     | 
| 
       29 
32 
     | 
    
         
             
                  end
         
     | 
| 
       30 
33 
     | 
    
         
             
                end
         
     | 
| 
       31 
34 
     | 
    
         | 
    
        data/lib/dotsync/colors.rb
    CHANGED
    
    | 
         @@ -10,9 +10,9 @@ module Dotsync 
     | 
|
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
                def self.load_custom_colors(config)
         
     | 
| 
       12 
12 
     | 
    
         
             
                  @custom_colors = {
         
     | 
| 
       13 
     | 
    
         
            -
                    diff_additions: config.dig("colors", "diff_additions") ||  
     | 
| 
       14 
     | 
    
         
            -
                    diff_modifications: config.dig("colors", "diff_modifications") ||  
     | 
| 
       15 
     | 
    
         
            -
                    diff_removals: config.dig("colors", "diff_removals") ||  
     | 
| 
      
 13 
     | 
    
         
            +
                    diff_additions: config.dig("colors", "diff_additions") || DEFAULT_DIFF_ADDITIONS,
         
     | 
| 
      
 14 
     | 
    
         
            +
                    diff_modifications: config.dig("colors", "diff_modifications") || DEFAULT_DIFF_MODIFICATIONS,
         
     | 
| 
      
 15 
     | 
    
         
            +
                    diff_removals: config.dig("colors", "diff_removals") || DEFAULT_DIFF_REMOVALS
         
     | 
| 
       16 
16 
     | 
    
         
             
                  }
         
     | 
| 
       17 
17 
     | 
    
         
             
                end
         
     | 
| 
       18 
18 
     | 
    
         | 
    
        data/lib/dotsync/icons.rb
    CHANGED
    
    | 
         @@ -8,6 +8,7 @@ module Dotsync 
     | 
|
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
                # Configuration icon
         
     | 
| 
       10 
10 
     | 
    
         
             
                CONFIG = " "
         
     | 
| 
      
 11 
     | 
    
         
            +
                DIFF = " "
         
     | 
| 
       11 
12 
     | 
    
         | 
| 
       12 
13 
     | 
    
         
             
                # Default Mapping icons
         
     | 
| 
       13 
14 
     | 
    
         
             
                DEFAULT_FORCE = " "
         
     | 
| 
         @@ -57,6 +58,7 @@ module Dotsync 
     | 
|
| 
       57 
58 
     | 
    
         
             
                  info: INFO,
         
     | 
| 
       58 
59 
     | 
    
         
             
                  error: ERROR,
         
     | 
| 
       59 
60 
     | 
    
         
             
                  config: CONFIG,
         
     | 
| 
      
 61 
     | 
    
         
            +
                  diff: DIFF,
         
     | 
| 
       60 
62 
     | 
    
         
             
                  force: -> { force },
         
     | 
| 
       61 
63 
     | 
    
         
             
                  ignore: -> { ignore },
         
     | 
| 
       62 
64 
     | 
    
         
             
                  pull: PULL,
         
     | 
    
        data/lib/dotsync/runner.rb
    CHANGED
    
    | 
         @@ -17,8 +17,8 @@ module Dotsync 
     | 
|
| 
       17 
17 
     | 
    
         
             
                      config_class = Dotsync.const_get("#{camelize(action_name.to_s)}ActionConfig")
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
                      config = config_class.new(Dotsync.config_path)
         
     | 
| 
       20 
     | 
    
         
            -
                      Dotsync::Icons.load_custom_icons(config)
         
     | 
| 
       21 
     | 
    
         
            -
                      Dotsync::Colors.load_custom_colors(config)
         
     | 
| 
      
 20 
     | 
    
         
            +
                      Dotsync::Icons.load_custom_icons(config.to_h)
         
     | 
| 
      
 21 
     | 
    
         
            +
                      Dotsync::Colors.load_custom_colors(config.to_h)
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
23 
     | 
    
         
             
                      action = action_class.new(config, @logger)
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
         @@ -5,8 +5,13 @@ module Dotsync 
     | 
|
| 
       5 
5 
     | 
    
         
             
              # differ = DirectoryDiffer.new("/path/to/src", "/path/to/dest")
         
     | 
| 
       6 
6 
     | 
    
         
             
              # differences = differ.diff
         
     | 
| 
       7 
7 
     | 
    
         
             
              class DirectoryDiffer
         
     | 
| 
      
 8 
     | 
    
         
            +
                extend Forwardable
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
       8 
10 
     | 
    
         
             
                attr_reader :src, :dest
         
     | 
| 
       9 
11 
     | 
    
         | 
| 
      
 12 
     | 
    
         
            +
                def_delegator @mapping, :original_src
         
     | 
| 
      
 13 
     | 
    
         
            +
                def_delegator @mapping, :original_dest
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
       10 
15 
     | 
    
         
             
                # Initializes a new DirectoryDiffer.
         
     | 
| 
       11 
16 
     | 
    
         
             
                #
         
     | 
| 
       12 
17 
     | 
    
         
             
                # @param mapping [Dotsync::Mapping] the mapping object containing source, destination, force, and ignore details
         
     | 
| 
         @@ -15,6 +20,7 @@ module Dotsync 
     | 
|
| 
       15 
20 
     | 
    
         
             
                # @option mapping [Boolean] :force? optional flag to force actions
         
     | 
| 
       16 
21 
     | 
    
         
             
                # @option mapping [Array<String>] :ignores optional list of files/directories to ignore
         
     | 
| 
       17 
22 
     | 
    
         
             
                def initialize(mapping)
         
     | 
| 
      
 23 
     | 
    
         
            +
                  @mapping = mapping
         
     | 
| 
       18 
24 
     | 
    
         
             
                  @src = mapping.src
         
     | 
| 
       19 
25 
     | 
    
         
             
                  @dest = mapping.dest
         
     | 
| 
       20 
26 
     | 
    
         
             
                  @force = mapping.force?
         
     | 
| 
         @@ -60,6 +66,10 @@ module Dotsync 
     | 
|
| 
       60 
66 
     | 
    
         
             
                    removals = filter_paths(removals, @ignores)
         
     | 
| 
       61 
67 
     | 
    
         
             
                  end
         
     | 
| 
       62 
68 
     | 
    
         | 
| 
      
 69 
     | 
    
         
            +
                  additions.map! { |rel_path| File.join(@mapping.original_dest, rel_path) }
         
     | 
| 
      
 70 
     | 
    
         
            +
                  modifications.map! { |rel_path| File.join(@mapping.original_dest, rel_path) }
         
     | 
| 
      
 71 
     | 
    
         
            +
                  removals.map! { |rel_path| File.join(@mapping.original_dest, rel_path) }
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
       63 
73 
     | 
    
         
             
                  Dotsync::Diff.new(additions: additions, modifications: modifications, removals: removals)
         
     | 
| 
       64 
74 
     | 
    
         
             
                end
         
     | 
| 
       65 
75 
     | 
    
         | 
    
        data/lib/dotsync/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.8
         
     | 
| 
       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-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2025-10-29 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: toml-rb
         
     |