effuse 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +6 -0
- data/README.md +2 -0
- data/bin/effuse +34 -23
- data/effuse.gemspec +1 -1
- metadata +2 -2
data/ChangeLog.md
CHANGED
data/README.md
CHANGED
@@ -40,6 +40,8 @@ Usage: effuse [OPTION...] [DEST]
|
|
40
40
|
-e, --exclude GLOB Exclude GLOB from symlinking
|
41
41
|
-i, --include GLOB Include GLOB in symlinking
|
42
42
|
|
43
|
+
-y, --noconfirm CHOICE Assume CHOICE on file conflicts
|
44
|
+
|
43
45
|
-v, --verbose Show verbose output
|
44
46
|
-h, --help Show this message
|
45
47
|
```
|
data/bin/effuse
CHANGED
@@ -4,7 +4,7 @@ require 'optparse'
|
|
4
4
|
require 'ostruct'
|
5
5
|
require 'fileutils'
|
6
6
|
|
7
|
-
options = OpenStruct.new(:verbose => false, :exclude => ['.git', '.gitignore', '.gitmodules', '*~', '.*.swp'], :clean => false)
|
7
|
+
options = OpenStruct.new(:verbose => false, :exclude => ['.git', '.gitignore', '.gitmodules', '*~', '.*.swp'], :clean => false, :noconfirm => nil)
|
8
8
|
|
9
9
|
OptionParser.new do |o|
|
10
10
|
o.banner = 'Usage: effuse [OPTION...] [DEST]'
|
@@ -25,6 +25,12 @@ OptionParser.new do |o|
|
|
25
25
|
|
26
26
|
o.separator ''
|
27
27
|
|
28
|
+
o.on('-y', '--noconfirm CHOICE', 'Assume CHOICE on file conflicts') do |choice|
|
29
|
+
options.noconfirm = choice.downcase[0].chr # Shakes fist at Ruby 1.8 (.chr)
|
30
|
+
end
|
31
|
+
|
32
|
+
o.separator ''
|
33
|
+
|
28
34
|
o.on('-v', '--verbose', 'Show verbose output') do
|
29
35
|
options.verbose = true
|
30
36
|
end
|
@@ -80,30 +86,35 @@ else
|
|
80
86
|
puts "already symlinked #{dest}" if options.verbose
|
81
87
|
next
|
82
88
|
else
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
break
|
95
|
-
|
96
|
-
puts "renaming #{src} -> #{src + '~'}" if options.verbose
|
97
|
-
File.rename(src, src + '~')
|
98
|
-
puts "renaming #{dest} -> #{src}" if options.verbose
|
99
|
-
File.rename(dest, src)
|
100
|
-
break
|
101
|
-
when 'k'
|
102
|
-
skip = true
|
103
|
-
break
|
89
|
+
if options.noconfirm
|
90
|
+
input = options.noconfirm
|
91
|
+
puts "assuming '#{input}' for #{dest}" if options.verbose
|
92
|
+
else
|
93
|
+
puts "File already exists: #{dest}"
|
94
|
+
puts " [R] Backup and replace"
|
95
|
+
puts " [i] Import original file and symlink"
|
96
|
+
puts " [k] Keep original file"
|
97
|
+
|
98
|
+
loop do
|
99
|
+
input = gets.chomp.downcase[0].chr || 'r' # Shakes fist at Ruby 1.8 (.chr)
|
100
|
+
break if 'rik'.include?(input)
|
101
|
+
puts "Error: '#{input}' is not an option"
|
104
102
|
end
|
105
103
|
end
|
106
|
-
|
104
|
+
|
105
|
+
case input
|
106
|
+
when 'r'
|
107
|
+
puts "renaming #{dest} -> #{dest + '~'}" if options.verbose
|
108
|
+
File.rename(dest, dest + '~')
|
109
|
+
when 'i'
|
110
|
+
puts "renaming #{src} -> #{src + '~'}" if options.verbose
|
111
|
+
File.rename(src, src + '~')
|
112
|
+
puts "renaming #{dest} -> #{src}" if options.verbose
|
113
|
+
File.rename(dest, src)
|
114
|
+
when 'k'
|
115
|
+
puts "skipping #{dest}" if options.verbose
|
116
|
+
next
|
117
|
+
end
|
107
118
|
end
|
108
119
|
end
|
109
120
|
|
data/effuse.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effuse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A tool for managing symlinks
|
15
15
|
email:
|