dotlayer 0.2.1 → 0.2.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: 6153afd914718371693784c18c5be35b4f84d2b4ceddda8990efed35e54ad229
4
- data.tar.gz: 192e9da8c37c20627151ee35dc415e1ac59eece7e27edb63bb8aac249e0defd7
3
+ metadata.gz: b0489157f2a066cbd4729f51ad5dff3800e75c0144061ea85f49cd4005bcb297
4
+ data.tar.gz: 21e4467266812d237318d0ca70aab7491ae3e87dcf95d66dd2db1c85c74a5e65
5
5
  SHA512:
6
- metadata.gz: 401aa858f83b8f064b9c6fdf39e2621ce2c4ba53f6fa9ae2ba3e9922b7d74ea20a4bf8ab1b247f4515060d2c051ce4e89b9b7c26288e3a07e3fd581b7550f579
7
- data.tar.gz: 6a5aa5a51170cbe973c30854f45b9e1713799cfc8d4d451e058e4a66998390f86eb656c183eda3d99baf95b2334af319cb4ae850f43e593047447e090b1115f8
6
+ metadata.gz: 8062c90a687287e5f0e1e2205064f537be913f5e6a91f844d3d3cdc994d280eeb14428f808ebd2e5e268bd2f01ff603f1be431bbcac2abcff0ff77d5d20eb58b
7
+ data.tar.gz: 6bcc1d1000022e64bda327a7a60a15b65bf77b2c4e394a6077482204bdb2a7ae46911f2502d5e95f50c1c30f65cf1388dc6ee5296aa364f3bbeb4011c92fc60b
data/README.md CHANGED
@@ -266,6 +266,16 @@ dotlayer adopt --dry-run ~/.config/lazygit config
266
266
 
267
267
  The last argument is always the package name. Dotlayer finds the first repo containing that package, or falls back to the first repo for new packages.
268
268
 
269
+ ## Development
270
+
271
+ ```sh
272
+ bundle exec rake test # run tests
273
+ bundle exec standardrb # lint
274
+ bundle exec rubycritic lib/ # code quality report
275
+ ```
276
+
277
+ See [Contributing](CONTRIBUTING.md) for full setup, testing, and contribution guidelines.
278
+
269
279
  ## Documentation
270
280
 
271
281
  - [Architecture](docs/architecture.md) — system design, data flow, and class responsibilities
data/lib/dotlayer/cli.rb CHANGED
@@ -13,11 +13,11 @@ module Dotlayer
13
13
  config = Config.new(options[:config])
14
14
 
15
15
  case command
16
- when "status" then Commands::Status.new(config:).run
16
+ when "status" then Commands::Status.new(config:).run
17
17
  when "install" then Commands::Install.new(config:, dry_run: options[:dry_run], verbose: options[:verbose]).run
18
- when "update" then Commands::Update.new(config:, dry_run: options[:dry_run], verbose: options[:verbose]).run
19
- when "doctor" then Commands::Doctor.new(config:).run
20
- when "adopt" then run_adopt(config:, argv:, options:)
18
+ when "update" then Commands::Update.new(config:, dry_run: options[:dry_run], verbose: options[:verbose]).run
19
+ when "doctor" then Commands::Doctor.new(config:).run
20
+ when "adopt" then run_adopt(config:, argv:, options:)
21
21
  when "version"
22
22
  puts "dotlayer #{VERSION}"
23
23
  else
@@ -28,7 +28,7 @@ module Dotlayer
28
28
  private
29
29
 
30
30
  def parse_global_options(argv)
31
- options = { dry_run: false, verbose: false, config: nil, private: false }
31
+ options = {dry_run: false, verbose: false, config: nil, private: false}
32
32
 
33
33
  OptionParser.new do |opts|
34
34
  opts.on("-c", "--config PATH", "Config file path") { |v| options[:config] = v }
@@ -72,7 +72,11 @@ module Dotlayer
72
72
  else
73
73
  warning "#{broken.size} found"
74
74
  broken.each do |link|
75
- target = File.readlink(link) rescue "(deleted)"
75
+ target = begin
76
+ File.readlink(link)
77
+ rescue
78
+ "(deleted)"
79
+ end
76
80
  @issues << "Broken symlink: #{link} -> #{target}"
77
81
  end
78
82
  end
@@ -23,7 +23,7 @@ module Dotlayer
23
23
  end
24
24
 
25
25
  def repos
26
- @repos ||= @data.fetch("repos", [{ "path" => "~/.public_dotfiles" }]).filter_map do |entry|
26
+ @repos ||= @data.fetch("repos", [{"path" => "~/.public_dotfiles"}]).filter_map do |entry|
27
27
  path = entry["path"]&.to_s
28
28
  next if path.nil? || path.empty?
29
29
 
@@ -17,7 +17,7 @@ module Dotlayer
17
17
  def detect_os
18
18
  case RbConfig::CONFIG["host_os"]
19
19
  when /darwin/ then "macos"
20
- when /linux/ then "linux"
20
+ when /linux/ then "linux"
21
21
  else "unknown"
22
22
  end
23
23
  end
@@ -1,5 +1,3 @@
1
- require "set"
2
-
3
1
  module Dotlayer
4
2
  class Resolver
5
3
  def initialize(config:, detection:)
data/lib/dotlayer/stow.rb CHANGED
@@ -20,7 +20,7 @@ module Dotlayer
20
20
  args << package
21
21
 
22
22
  if @verbose || @dry_run
23
- $stderr.puts " #{args.join(" ")}"
23
+ warn " #{args.join(" ")}"
24
24
  end
25
25
 
26
26
  return true if @dry_run
data/lib/dotlayer.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dotlayer
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
 
4
4
  autoload :CLI, "dotlayer/cli"
5
5
  autoload :Config, "dotlayer/config"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotlayer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Douglas Andrade
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  requirements: []
56
- rubygems_version: 4.0.3
56
+ rubygems_version: 4.0.8
57
57
  specification_version: 4
58
58
  summary: Layered dotfiles management with GNU Stow
59
59
  test_files: []