dotsync 0.1.8 → 0.1.10

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: 3d19236d9990f40338b046f38198ddee169c172ec1d57f8914661af46c758c4d
4
- data.tar.gz: 1999643c1f8ce059eb4e51fc6699005630d6c7a575fbd58a60f018a88b80174e
3
+ metadata.gz: b33c80703154eb2790585883479456053089abb500f1891c528a3627a12a2dc2
4
+ data.tar.gz: 64517cdc665c5ec5fa7657b4e1d197914bf7ad0a6b36dfb690f5cbc2451b0f43
5
5
  SHA512:
6
- metadata.gz: '03262956f985e6aa2b2e82de93546f75aa6ea45964f976561a2d53464b6c3a27a28a0a3b06135a3305b0f932b8316b2ec58b414234fc016fd3412542ef8e3182'
7
- data.tar.gz: 46e24ab637d1ea4c7217ce4e5c318b268b5aebeac36f166c4944bbc3434d4dcfdf2021af54e57e6840d1d889f94f997c6b5208e67d8cee444618384c3dcea65a
6
+ metadata.gz: '08422291669fb72a90a91826c09411dc4d0ab0174e6b219bc7b8358f95a94db0b9f39d63c2c2e2182e2aea2b7acd19f53c1ca606bb34ab6900298d74402f361b'
7
+ data.tar.gz: 26bff9d8f479ccf0168d7c93f2cc053b517c978a9566a1f5f02718a4ae4bfc1e1b9dac17e02933dfcb27726798c3fc91acde7df87b96b70cb405a438eec6d42c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # 0.1.10
2
+
3
+ - Readme: add screenshot for PushAction
4
+ - Readme: fixes character on sample config file
5
+
6
+ # 0.1.9
7
+
8
+ - Exe: improved banner with options
9
+ - Options: added "--apply"
10
+ - Options: added "--environment-variables"
11
+ - Differ: show full path using original mapping paths
12
+ - Readme: add gem version badge
13
+ - Readme: add requirements section
14
+
1
15
  # 0.1.8
2
16
 
3
17
  - Show full relative path on diff
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dotsync (0.1.8)
4
+ dotsync (0.1.10)
5
5
  fileutils (~> 1.7.3)
6
6
  find (~> 0.2.0)
7
7
  listen (~> 3.9.0)
data/README.md CHANGED
@@ -1,11 +1,16 @@
1
1
  # Dotsync
2
2
 
3
- **⚠️ Warning: This gem is under active development. You can expect new changes that may not be backward-compatible.**
4
-
3
+ [![Gem Version](https://badge.fury.io/rb/sidekiq.svg)](https://rubygems.org/gems/sidekiq)
5
4
  [![Ruby Gem Test Status](https://github.com/dsaenztagarro/dotsync/actions/workflows/gem-push.yml/badge.svg)](https://github.com/dsaenztagarro/dotsync/actions)
6
5
 
6
+ > [!WARNING]
7
+ > This gem is under active development. You can expect new changes that may not be backward-compatible.
8
+
7
9
  Welcome to Dotsync! This gem helps you manage and synchronize your dotfiles effortlessly. Below you'll find information on installation, usage, and some tips for getting started.
8
10
 
11
+ ## Requirements
12
+ - Ruby: MRI 3.2+
13
+
9
14
  ## Installation
10
15
 
11
16
  Add this line to your application's Gemfile:
@@ -33,6 +38,8 @@ Dotsync provides the following commands to manage your dotfiles:
33
38
  dotsync push
34
39
  ```
35
40
 
41
+ ![dotsync push](docs/images/dotsync_push_apply.png)
42
+
36
43
  - **Pull**: Synchronize dotfiles from the repository to your local machine.
37
44
  ```shell
38
45
  dotsync pull
@@ -55,25 +62,42 @@ Dotsync provides the following commands to manage your dotfiles:
55
62
  The configuration file uses a `mappings` structure to define the source and destination of your dotfiles. Here is an example:
56
63
 
57
64
  ```toml
58
- [pull]
59
- mappings = [
60
- { src = "$DOTFILES_DIR/config/", dest = "$XDG_CONFIG_HOME", force = false },
61
- { src = "$DOTFILES_DIR/home/.zshenv", dest = "$HOME" }
62
- ]
63
-
64
- [push]
65
- mappings = [
66
- { src = "$HOME/.zshenv", dest = "$DOTFILES_DIR/home/.zshenv" },
67
- { src = "$XDG_CONFIG_HOME/alacritty", dest = "$DOTFILES_DIR/config/alacritty" }
68
- ]
69
-
70
- [watch]
71
- mappings = [
72
- { src = "$HOME/.zshenv", dest = "$DOTFILES_DIR/home/.zshenv" },
73
- { src = "$XDG_CONFIG_HOME/alacritty", dest = "$DOTFILES_DIR/config/alacritty" }
74
- ]
65
+ [[pull.mappings]]
66
+ src = "$XDG_CONFIG_HOME_MIRROR"
67
+ dest = "$XDG_CONFIG_HOME"
68
+
69
+ [[pull.mappings]]
70
+ src = "$HOME_MIRROR/.zshenv"
71
+ dest = "$HOME"
72
+
73
+
74
+ [[push.mappings]]
75
+ src = "$HOME/.zshenv"
76
+ src = "$HOME_MIRROR/.zshenv"
77
+
78
+ [[push.mappings]]
79
+ src = "$XDG_CONFIG_HOME/alacritty"
80
+ dest = "$DOTFILES_DIR/config/alacritty"
81
+ force = true # it forces the deletion of destination folder
82
+ ignore = ["themes/rose-pine.toml"] # use relative paths to "dest" to ignore files and folders
83
+
84
+
85
+ [[watch.mappings]]
86
+ src = "$HOME/.zshenv"
87
+ src = "$HOME_MIRROR/.zshenv"
88
+
89
+ [[watch.mappings]]
90
+ src = "$XDG_CONFIG_HOME/alacritty"
91
+ dest = "$DOTFILES_DIR/config/alacritty"
75
92
  ```
76
93
 
94
+ > [!TIP]
95
+ > I use mirror environment variables to cleaner configuration
96
+ >
97
+ > ```bash
98
+ > export XDG_CONFIG_HOME_MIRROR="$HOME/Code/dotfiles/xdg_config_home"
99
+ > ```
100
+
77
101
  #### `force` and `ignore` Options in Mappings
78
102
 
79
103
  Each mapping entry supports the following options:
Binary file
data/exe/dotsync CHANGED
@@ -4,7 +4,7 @@
4
4
  require_relative "../lib/dotsync"
5
5
  require "optparse"
6
6
 
7
- {}
7
+ options = { apply: false }
8
8
 
9
9
  opt_parser = OptionParser.new do |opts|
10
10
  opts.banner = <<~BANNER
@@ -16,10 +16,18 @@ opt_parser = OptionParser.new do |opts|
16
16
  pull Download remote changes to the local
17
17
  watch Continuously monitor and sync changes
18
18
  setup Initialize a default configuration file
19
+
20
+ Options:
21
+ -a, --apply Apply changes (push or pull)
22
+ -h, --help Show this help message
19
23
  BANNER
20
24
 
25
+ opts.on("-a", "--apply", "Apply changes (push or pull)") do
26
+ options[:apply] = true
27
+ end
28
+
21
29
  opts.on("-h", "--help", "Show this help message") do
22
- puts opts
30
+ puts opt_parser.banner
23
31
  exit
24
32
  end
25
33
  end
@@ -30,9 +38,9 @@ command = ARGV.shift
30
38
 
31
39
  case command
32
40
  when "push"
33
- Dotsync::Runner.new.run(:push)
41
+ Dotsync::Runner.new.run(:push, options)
34
42
  when "pull"
35
- Dotsync::Runner.new.run(:pull)
43
+ Dotsync::Runner.new.run(:pull, options)
36
44
  when "watch"
37
45
  Dotsync::Runner.new.run(:watch)
38
46
  when "setup"
@@ -18,5 +18,14 @@ module Dotsync
18
18
  def execute
19
19
  raise NotImplementedError
20
20
  end
21
+
22
+ private
23
+ def show_options(options)
24
+ info("Options:", icon: :options)
25
+ logger.log(" Apply: #{options[:apply] ? "TRUE" : "FALSE"}")
26
+ end
27
+
28
+ def show_env_vars
29
+ end
21
30
  end
22
31
  end
@@ -6,6 +6,16 @@ module Dotsync
6
6
 
7
7
  def_delegator :@config, :mappings
8
8
 
9
+ def show_env_vars
10
+ env_vars = mappings_env_vars
11
+ return unless env_vars.any?
12
+
13
+ info("Environment variables:", icon: :env_vars)
14
+ env_vars.each do |env_var|
15
+ logger.log(" #{env_var}: #{ENV[env_var]}")
16
+ end
17
+ end
18
+
9
19
  def show_mappings
10
20
  info("Mappings:", icon: :config)
11
21
 
@@ -38,8 +48,17 @@ module Dotsync
38
48
  end
39
49
  end
40
50
 
41
- def valid_mappings
42
- mappings.select(&:valid?)
43
- end
51
+ private
52
+ def mappings_env_vars
53
+ paths = mappings.flat_map do |mapping|
54
+ [mapping.original_src, mapping.original_dest]
55
+ end
56
+
57
+ paths.flat_map { |path| extract_env_vars(path) }.uniq
58
+ end
59
+
60
+ def valid_mappings
61
+ mappings.select(&:valid?)
62
+ end
44
63
  end
45
64
  end
@@ -6,27 +6,23 @@ module Dotsync
6
6
 
7
7
  def_delegator :@config, :backups_root
8
8
 
9
- def execute
10
- show_config
9
+ def execute(options = {})
10
+ show_options(options)
11
+ show_env_vars
12
+ show_mappings
11
13
  show_changes
14
+ return unless options[:apply]
15
+
12
16
  if create_backup
13
17
  show_backup
14
18
  purge_old_backups
15
19
  end
16
- pull_dotfiles
20
+
21
+ transfer_mappings
22
+ action("Dotfiles pulled")
17
23
  end
18
24
 
19
25
  private
20
- def show_config
21
- show_mappings
22
- end
23
-
24
- def pull_dotfiles
25
- transfer_mappings
26
-
27
- action("Dotfiles pulled")
28
- end
29
-
30
26
  def show_backup
31
27
  action("Backup created:")
32
28
  logger.log(" #{backup_root_path}")
@@ -4,21 +4,15 @@ module Dotsync
4
4
  class PushAction < BaseAction
5
5
  include MappingsTransfer
6
6
 
7
- def execute
8
- show_config
7
+ def execute(options = {})
8
+ show_options(options)
9
+ show_env_vars
10
+ show_mappings
9
11
  show_changes
10
- push_dotfiles
11
- end
12
-
13
- private
14
- def show_config
15
- show_mappings
16
- end
12
+ return unless options[:apply]
17
13
 
18
- def push_dotfiles
19
- transfer_mappings
20
-
21
- action("Dotfiles pushed", icon: :copy)
22
- end
14
+ transfer_mappings
15
+ action("Dotfiles pushed", icon: :copy)
16
+ end
23
17
  end
24
18
  end
@@ -2,20 +2,20 @@
2
2
 
3
3
  module Dotsync
4
4
  # https://specifications.freedesktop.org/basedir-spec/latest/
5
- module XDGBaseDirectorySpec
5
+ module XDGBaseDirectory
6
6
  def xdg_data_home
7
7
  File.expand_path(ENV["XDG_DATA_HOME"] || "$HOME/.local/share")
8
8
  end
9
9
 
10
- def xdf_config_home
10
+ def xdg_config_home
11
11
  File.expand_path(ENV["XDG_CONFIG_HOME"] || "$HOME/.config")
12
12
  end
13
13
 
14
- def xdf_cache_home
14
+ def xdg_cache_home
15
15
  File.expand_path(ENV["XDG_CACHE_HOME"] || "$HOME/.cache")
16
16
  end
17
17
 
18
- def xdf_bin_home
18
+ def xdg_bin_home
19
19
  File.expand_path(ENV["XDG_BIN_HOME"] || "$HOME/.local/bin")
20
20
  end
21
21
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Dotsync
4
4
  class PullActionConfig < BaseConfig
5
- include XDGBaseDirectorySpec
5
+ include XDGBaseDirectory
6
6
 
7
7
  def mappings
8
8
  mappings_list = section["mappings"]
data/lib/dotsync/icons.rb CHANGED
@@ -7,6 +7,8 @@ module Dotsync
7
7
  ERROR = " "
8
8
 
9
9
  # Configuration icon
10
+ OPTIONS = " "
11
+ ENV_VARS = " "
10
12
  CONFIG = " "
11
13
  DIFF = " "
12
14
 
@@ -20,8 +22,8 @@ module Dotsync
20
22
  PUSH = " "
21
23
  WATCH = "󰛐 "
22
24
 
23
- # TODO: review icons needed
24
25
  CONSOLE = "󰆍 "
26
+ # TODO: review icons needed
25
27
  LISTEN = " "
26
28
  SOURCE = " " #  "
27
29
  DEST = " " # " "
@@ -57,6 +59,8 @@ module Dotsync
57
59
  MAPPINGS = {
58
60
  info: INFO,
59
61
  error: ERROR,
62
+ env_vars: ENV_VARS,
63
+ options: OPTIONS,
60
64
  config: CONFIG,
61
65
  diff: DIFF,
62
66
  force: -> { force },
@@ -12,9 +12,11 @@ module Dotsync
12
12
  @original_ignores = Array(attributes["ignore"])
13
13
  @force = attributes["force"] || false
14
14
 
15
- @sanitized_src = sanitize_path(@original_src)
16
- @sanitized_dest = sanitize_path(@original_dest)
17
- @sanitized_ignore = @original_ignores.map { |path| File.join(@sanitized_src, path) }
15
+ @sanitized_src, @sanitized_dest, @sanitized_ignore = process_paths(
16
+ @original_src,
17
+ @original_dest,
18
+ @original_ignores
19
+ )
18
20
  end
19
21
 
20
22
  def src
@@ -33,10 +35,17 @@ module Dotsync
33
35
  @force
34
36
  end
35
37
 
38
+ def directories?
39
+ File.directory?(src) && File.directory?(dest)
40
+ end
41
+
42
+ def files?
43
+ return true if File.file?(src) && File.file?(dest)
44
+ File.file?(src) && !File.exist?(dest) && File.directory?(File.dirname(dest))
45
+ end
46
+
36
47
  def valid?
37
- (File.file?(src) && File.file?(dest)) ||
38
- (File.directory?(src) && File.directory?(dest)) ||
39
- (File.file?(src) && !File.exist?(dest) && File.directory?(File.dirname(dest)))
48
+ directories? || files?
40
49
  end
41
50
 
42
51
  def backup_possible?
@@ -78,5 +87,12 @@ module Dotsync
78
87
  def ignores?
79
88
  @original_ignores.any?
80
89
  end
90
+
91
+ def process_paths(src, dest, ignores)
92
+ sanitized_src = sanitize_path(src)
93
+ sanitized_dest = sanitize_path(dest)
94
+ sanitized_ignore = ignores.map { |path| File.join(sanitized_src, path) }
95
+ [sanitized_src, sanitized_dest, sanitized_ignore]
96
+ end
81
97
  end
82
98
  end
@@ -7,7 +7,7 @@ module Dotsync
7
7
  end
8
8
 
9
9
  # action_name should be a symbol, e.g., :pull, :watch, :sync
10
- def run(action_name)
10
+ def run(action_name, options = {})
11
11
  case action_name
12
12
  when :setup
13
13
  setup_config
@@ -22,7 +22,7 @@ module Dotsync
22
22
 
23
23
  action = action_class.new(config, @logger)
24
24
 
25
- action.execute
25
+ action.execute(options)
26
26
  rescue ConfigError => e
27
27
  @logger.error("[#{action_name}] config error:")
28
28
  @logger.info(e.message)
@@ -46,21 +46,28 @@ module Dotsync
46
46
  FileUtils.mkdir_p(File.dirname(config_path))
47
47
 
48
48
  example_mappings = {
49
+ "icons" => {
50
+ "options" => "⚙️",
51
+ "config" => "📄",
52
+ "force" => "🔥",
53
+ "ignore" => "🚫",
54
+ "invalid" => "❌"
55
+ },
49
56
  "pull" => {
50
57
  "mappings" => [
51
- { "src" => "$DOTFILES_DIR/config/", "dest" => "$XDG_CONFIG_HOME", "force" => false },
52
- { "src" => "$DOTFILES_DIR/home/.zshenv", "dest" => "$HOME" }
58
+ { "src" => "$XDG_CONFIG_HOME_MIRROR", "dest" => "$XDG_CONFIG_HOME" },
59
+ { "src" => "$HOME_MIRROR/.zshenv", "dest" => "$HOME" }
53
60
  ],
54
61
  },
55
62
  "push" => {
56
63
  "mappings" => [
57
64
  { "src" => "$HOME/.zshenv", "dest" => "$DOTFILES_DIR/home/.zshenv" },
58
- { "src" => "$XDG_CONFIG_HOME/alacritty", "dest" => "$DOTFILES_DIR/config/alacritty" }
65
+ { "src" => "$XDG_CONFIG_HOME/alacritty", "dest" => "$XDG_CONFIG_HOME_MIRROR/alacritty" }
59
66
  ]
60
67
  },
61
68
  "watch" => {
62
69
  "mappings" => [
63
- { "src" => "$HOME/.zshenv", "dest" => "$DOTFILES_DIR/home/.zshenv" },
70
+ { "src" => "$HOME/.zshenv", "dest" => "$HOME_MIRROR/.zshenv" },
64
71
  { "src" => "$XDG_CONFIG_HOME/alacritty", "dest" => "$DOTFILES_DIR/config/alacritty" }
65
72
  ]
66
73
  }
@@ -1,113 +1,84 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dotsync
4
- # Usage:
5
- # differ = DirectoryDiffer.new("/path/to/src", "/path/to/dest")
6
- # differences = differ.diff
7
4
  class DirectoryDiffer
8
5
  extend Forwardable
9
6
 
10
- attr_reader :src, :dest
7
+ # attr_reader :src, :dest
11
8
 
12
- def_delegator @mapping, :original_src
13
- def_delegator @mapping, :original_dest
9
+ def_delegator :@mapping, :src, :mapping_src
10
+ def_delegator :@mapping, :dest, :mapping_dest
11
+ def_delegator :@mapping, :original_src, :mapping_original_src
12
+ def_delegator :@mapping, :original_dest, :mapping_original_dest
13
+ def_delegator :@mapping, :force?, :force?
14
+ def_delegator :@mapping, :original_ignores, :ignores
14
15
 
15
- # Initializes a new DirectoryDiffer.
16
- #
17
- # @param mapping [Dotsync::Mapping] the mapping object containing source, destination, force, and ignore details
18
- # @option mapping [String] :src the source directory path
19
- # @option mapping [String] :dest the destination directory path
20
- # @option mapping [Boolean] :force? optional flag to force actions
21
- # @option mapping [Array<String>] :ignores optional list of files/directories to ignore
22
16
  def initialize(mapping)
23
17
  @mapping = mapping
24
- @src = mapping.src
25
- @dest = mapping.dest
26
- @force = mapping.force?
27
- @ignores = mapping.original_ignores || []
28
18
  end
29
19
 
30
20
  def diff
31
- additions = []
32
- modifications = []
33
- removals = []
21
+ if @mapping.directories?
22
+ diff_mapping_directories
23
+ elsif @mapping.files?
24
+ diff_mapping_files
25
+ end
26
+ end
27
+
28
+ private
29
+ def diff_mapping_directories
30
+ additions = []
31
+ modifications = []
32
+ removals = []
34
33
 
35
- Find.find(src) do |src_path|
36
- rel_path = src_path.sub(/^#{Regexp.escape(src)}\/?/, "")
37
- next if rel_path.empty?
34
+ Find.find(mapping_src) do |src_path|
35
+ rel_path = src_path.sub(/^#{Regexp.escape(mapping_src)}\/?/, "")
38
36
 
39
- dest_path = File.join(dest, rel_path)
37
+ dest_path = File.join(mapping_dest, rel_path)
40
38
 
41
- if !File.exist?(dest_path)
42
- additions << rel_path
43
- elsif File.file?(src_path) && File.file?(dest_path)
44
- if File.size(src_path) != File.size(dest_path)
45
- modifications << rel_path
39
+ if !File.exist?(dest_path)
40
+ additions << rel_path
41
+ elsif File.file?(src_path) && File.file?(dest_path)
42
+ if File.size(src_path) != File.size(dest_path)
43
+ modifications << rel_path
44
+ end
46
45
  end
47
46
  end
48
- end
49
47
 
50
- if @force
51
- Find.find(dest) do |dest_path|
52
- rel_path = dest_path.sub(/^#{Regexp.escape(dest)}\/?/, "")
53
- next if rel_path.empty?
48
+ if force?
49
+ Find.find(mapping_dest) do |dest_path|
50
+ rel_path = dest_path.sub(/^#{Regexp.escape(mapping_dest)}\/?/, "")
51
+ next if rel_path.empty?
54
52
 
55
- src_path = File.join(src, rel_path)
53
+ src_path = File.join(mapping_src, rel_path)
56
54
 
57
- if !File.exist?(src_path)
58
- removals << rel_path
55
+ if !File.exist?(src_path)
56
+ removals << rel_path
57
+ end
59
58
  end
60
59
  end
61
- end
62
-
63
- if @ignores.any?
64
- additions = filter_paths(additions, @ignores)
65
- modifications = filter_paths(modifications, @ignores)
66
- removals = filter_paths(removals, @ignores)
67
- end
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
-
73
- Dotsync::Diff.new(additions: additions, modifications: modifications, removals: removals)
74
- end
75
60
 
76
- private
77
- def collect_src_diffs
78
- diffs = []
79
- Find.find(src) do |src_path|
80
- rel_path = src_path.sub(/^#{Regexp.escape(src)}\/?/, "")
81
- next if rel_path.empty?
61
+ if ignores.any?
62
+ additions = filter_paths(additions, ignores)
63
+ modifications = filter_paths(modifications, ignores)
64
+ removals = filter_paths(removals, ignores)
65
+ end
82
66
 
83
- dest_path = File.join(dest, rel_path)
67
+ additions.map! { |rel_path| File.join(mapping_original_dest, rel_path) }
68
+ modifications.map! { |rel_path| File.join(mapping_original_dest, rel_path) }
69
+ removals.map! { |rel_path| File.join(mapping_original_src, rel_path) }
84
70
 
85
- if !File.exist?(dest_path)
86
- diffs << rel_path
87
- elsif File.directory?(src_path) && !File.directory?(dest_path)
88
- diffs << rel_path
89
- elsif File.file?(src_path) && !File.file?(dest_path)
90
- diffs << rel_path
91
- elsif File.file?(src_path) && File.file?(dest_path)
92
- if File.size(src_path) != File.size(dest_path)
93
- diffs << rel_path
94
- end
95
- end
96
- end
97
- diffs
71
+ Dotsync::Diff.new(additions: additions, modifications: modifications, removals: removals)
98
72
  end
99
73
 
100
- def collect_dest_diffs
101
- diffs = []
102
- Find.find(dest) do |dest_path|
103
- rel_path = dest_path.sub(/^#{Regexp.escape(dest)}\/?/, "")
104
- next if rel_path.empty?
105
- src_path = File.join(src, rel_path)
106
- if !File.exist?(src_path)
107
- diffs << rel_path
74
+ def diff_mapping_files
75
+ Dotsync::Diff.new.tap do |diff|
76
+ if !File.exist?(@mapping.dest)
77
+ diff.additions << @mapping.original_dest
78
+ else
79
+ diff.modifications << @mapping.original_dest
108
80
  end
109
81
  end
110
- diffs
111
82
  end
112
83
 
113
84
  def filter_paths(all_paths, ignore_paths)
@@ -8,6 +8,10 @@ module Dotsync
8
8
  path.gsub(/\$(\w+)/) { ENV[$1] }
9
9
  end
10
10
 
11
+ def extract_env_vars(path)
12
+ path.scan(/\$(\w+)/).flatten
13
+ end
14
+
11
15
  def colorize_env_vars(path)
12
16
  path.gsub(/\$(\w+)/) { "\e[38;5;#{ENV_VARS_COLOR}m$#{$1}\e[0m" }
13
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dotsync
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.10"
5
5
  end
data/lib/dotsync.rb CHANGED
@@ -19,8 +19,10 @@ require_relative "dotsync/utils/path_utils"
19
19
  require_relative "dotsync/models/mapping"
20
20
  require_relative "dotsync/models/diff"
21
21
 
22
+ # Config Concerns
23
+ require_relative "dotsync/config/concerns/xdg_base_directory"
24
+
22
25
  # Config
23
- require_relative "dotsync/config/xdg_base_directory_spec"
24
26
  require_relative "dotsync/config/base_config"
25
27
  require_relative "dotsync/config/pull_action_config"
26
28
  require_relative "dotsync/config/push_action_config"
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.8
4
+ version: 0.1.10
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-29 00:00:00.000000000 Z
11
+ date: 2025-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb
@@ -244,6 +244,7 @@ files:
244
244
  - README.md
245
245
  - RELEASING.md
246
246
  - Rakefile
247
+ - docs/images/dotsync_push_apply.png
247
248
  - dotsync.gemspec
248
249
  - exe/console
249
250
  - exe/dotsync
@@ -256,10 +257,10 @@ files:
256
257
  - lib/dotsync/actions/watch_action.rb
257
258
  - lib/dotsync/colors.rb
258
259
  - lib/dotsync/config/base_config.rb
260
+ - lib/dotsync/config/concerns/xdg_base_directory.rb
259
261
  - lib/dotsync/config/pull_action_config.rb
260
262
  - lib/dotsync/config/push_action_config.rb
261
263
  - lib/dotsync/config/watch_action_config.rb
262
- - lib/dotsync/config/xdg_base_directory_spec.rb
263
264
  - lib/dotsync/errors.rb
264
265
  - lib/dotsync/icons.rb
265
266
  - lib/dotsync/models/diff.rb