configmonkey_cli 1.0.3 → 1.0.4
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/README.md +1 -1
- data/VERSION +1 -1
- data/lib/configmonkey_cli/application/manifest_actions/sync_links.rb +22 -2
- data/lib/configmonkey_cli/application.rb +2 -2
- data/lib/configmonkey_cli/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: 99ff31b49f67bac7cc9d0e1695fbf7fa21e33d288301994b47c8e4b7ab6742ab
|
4
|
+
data.tar.gz: 12aa92f2207ed7d6c748c04dedf8ce58d979e0c635e022b0aae6686f912b140b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c500d71590fac066406dc47b6544ee0de098e881e7c6c5ac440b45d38fd48d2696ff886fa1d6da065b1e0fc6d78dd3b8ee052106149ad3e13dacb4e153a1d02e
|
7
|
+
data.tar.gz: 3200b1469a198e9dc067dd4d96d8fec97e2c0e4aa6bcf3ae9f6f4dc313bb788ae87f9d2fcbffa95106f67161a32fdc98756b7c7ff272d8ce23a8c65d0f12f5f6
|
data/README.md
CHANGED
@@ -45,7 +45,7 @@ To get a list of available options invoke Configmonkey with the `--help` or `-h`
|
|
45
45
|
# Application options
|
46
46
|
--generate-manifest Generates an example manifest in current directory
|
47
47
|
-a, --accept accept all defaults
|
48
|
-
-b, --
|
48
|
+
-b, --bell ring a bell when asked
|
49
49
|
-D, --diff change default diff tool
|
50
50
|
-f, --fake-host HOST override hostname
|
51
51
|
-i, --in DIR operate from this source directory instead of pwd
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4
|
@@ -8,6 +8,7 @@ module ConfigmonkeyCli
|
|
8
8
|
prefix: nil,
|
9
9
|
map: "d:dp",
|
10
10
|
hard: false,
|
11
|
+
exclude: [],
|
11
12
|
})
|
12
13
|
end
|
13
14
|
|
@@ -42,16 +43,35 @@ module ConfigmonkeyCli
|
|
42
43
|
def destructive
|
43
44
|
prefixed_sources = @sources.map do |src|
|
44
45
|
File.join(@destination, "#{@prefix}#{File.basename(src)}")
|
45
|
-
end
|
46
|
+
end.reject{|f| excluded?(f) }
|
46
47
|
|
47
48
|
if @purge
|
48
49
|
(Dir["#{File.join(@destination, @prefix)}*"] - prefixed_sources).each do |f|
|
49
50
|
thor.remove_file(f)
|
51
|
+
# @todo fix for https://github.com/erikhuda/thor/pull/720
|
52
|
+
::FileUtils.rm_rf(f) if File.symlink?(f)
|
50
53
|
end
|
51
54
|
end
|
52
55
|
|
53
56
|
@sources.each do |src|
|
54
|
-
|
57
|
+
if r = excluded?(src)
|
58
|
+
status :excluded, :black, rel(src) << c(" #{r.inspect}", :black)
|
59
|
+
else
|
60
|
+
thor.create_link("#{@destination}/#{@prefix}#{File.basename(src)}", src, @opts)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def excluded? src
|
66
|
+
[*@opts[:exclude]].detect do |filter|
|
67
|
+
case filter
|
68
|
+
when Proc
|
69
|
+
filter.call(src)
|
70
|
+
when Regexp
|
71
|
+
src.match(filter)
|
72
|
+
when String
|
73
|
+
src.ends_with?(filter)
|
74
|
+
end
|
55
75
|
end
|
56
76
|
end
|
57
77
|
end
|
@@ -41,7 +41,7 @@ module ConfigmonkeyCli
|
|
41
41
|
hostname: `hostname`.chomp, # -f flag
|
42
42
|
diff_tool: nil, # -D flag
|
43
43
|
merge_tool: nil, # -M flag
|
44
|
-
bell:
|
44
|
+
bell: false, # -b flag
|
45
45
|
default_accept: false, # -a flag
|
46
46
|
default_yes: false, # -y flag
|
47
47
|
dispatch: :index, # (internal) action to dispatch
|
@@ -106,7 +106,7 @@ module ConfigmonkeyCli
|
|
106
106
|
opts.separator(c "# Application options", :blue)
|
107
107
|
opts.on("--generate-manifest", "Generates an example manifest in current directory") { @opts[:dispatch] = :generate_manifest }
|
108
108
|
opts.on("-a", "--accept", "accept all defaults") { @opts[:default_accept] = true }
|
109
|
-
opts.on("-b", "--
|
109
|
+
opts.on("-b", "--bell", "dont ring a bell when asked") { @opts[:bell] = true }
|
110
110
|
opts.on("-D", "--diff", "change default diff tool") {|s| @opts[:diff_tool] = s }
|
111
111
|
opts.on("-f", "--fake-host HOST", "override hostname") {|s| @opts[:hostname] = s }
|
112
112
|
opts.on("-i", "--in DIR", "operate from this source directory instead of pwd") {|s| @opts[:working_directory] = s }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configmonkey_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Pachnit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|