deprec 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/bin/depify +33 -27
- metadata +1 -1
data/CHANGELOG
CHANGED
data/bin/depify
CHANGED
@@ -2,33 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'optparse'
|
4
4
|
|
5
|
-
OptionParser.new do |opts|
|
6
|
-
opts.banner = "Usage: #{File.basename($0)} [path]"
|
7
|
-
|
8
|
-
opts.on("-h", "--help", "Displays this help info") do
|
9
|
-
puts opts
|
10
|
-
exit 0
|
11
|
-
end
|
12
|
-
|
13
|
-
begin
|
14
|
-
opts.parse!(ARGV)
|
15
|
-
rescue OptionParser::ParseError => e
|
16
|
-
warn e.message
|
17
|
-
puts opts
|
18
|
-
exit 1
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
if ARGV.empty?
|
23
|
-
abort "Please specify the directory to depify, e.g. `#{File.basename($0)} .'"
|
24
|
-
elsif !File.exists?(ARGV.first)
|
25
|
-
abort "`#{ARGV.first}' does not exist."
|
26
|
-
elsif !File.directory?(ARGV.first)
|
27
|
-
abort "`#{ARGV.first}' is not a directory."
|
28
|
-
elsif ARGV.length > 1
|
29
|
-
abort "Too many arguments; please specify only the directory to capify."
|
30
|
-
end
|
31
|
-
|
32
5
|
def unindent(string)
|
33
6
|
indentation = string[/\A\s*/]
|
34
7
|
string.strip.gsub(/^#{indentation}/, "")
|
@@ -116,6 +89,39 @@ def create_file(file, content)
|
|
116
89
|
end
|
117
90
|
end
|
118
91
|
|
92
|
+
|
93
|
+
OptionParser.new do |opts|
|
94
|
+
opts.banner = "Usage: #{File.basename($0)} [path]"
|
95
|
+
|
96
|
+
opts.on("-c", "Install ~/.caprc file") do
|
97
|
+
create_file(File.join(ENV['HOME'], '.caprc'), caprc)
|
98
|
+
exit 0
|
99
|
+
end
|
100
|
+
|
101
|
+
opts.on("-h", "--help", "Displays this help info") do
|
102
|
+
puts opts
|
103
|
+
exit 0
|
104
|
+
end
|
105
|
+
|
106
|
+
begin
|
107
|
+
opts.parse!(ARGV)
|
108
|
+
rescue OptionParser::ParseError => e
|
109
|
+
warn e.message
|
110
|
+
puts opts
|
111
|
+
exit 1
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
if ARGV.empty?
|
116
|
+
abort "Please specify the directory to depify, e.g. `#{File.basename($0)} .'"
|
117
|
+
elsif !File.exists?(ARGV.first)
|
118
|
+
abort "`#{ARGV.first}' does not exist."
|
119
|
+
elsif !File.directory?(ARGV.first)
|
120
|
+
abort "`#{ARGV.first}' is not a directory."
|
121
|
+
elsif ARGV.length > 1
|
122
|
+
abort "Too many arguments; please specify only the directory to capify."
|
123
|
+
end
|
124
|
+
|
119
125
|
create_file(File.join(ENV['HOME'], '.caprc'), caprc)
|
120
126
|
|
121
127
|
base = ARGV.shift
|