Indentinator 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/indentinator +7 -3
- data/lib/indentinator.rb +0 -3
- metadata +3 -3
data/bin/indentinator
CHANGED
@@ -25,13 +25,15 @@ end
|
|
25
25
|
|
26
26
|
@files.each do |path|
|
27
27
|
begin
|
28
|
+
if File.directory?(path)
|
29
|
+
puts "#{path} is a directory."
|
30
|
+
next
|
31
|
+
end
|
28
32
|
File.open(path) do |file|
|
29
33
|
lines = file.read.split("\n")
|
30
34
|
amount = indent_amount(lines)
|
31
35
|
if @to_amount.nil?
|
32
|
-
if amount
|
33
|
-
puts "Failed for #{path}. Is it binary?"
|
34
|
-
elsif amount == 0
|
36
|
+
if amount == 0
|
35
37
|
puts "#{path} has no indentation."
|
36
38
|
else
|
37
39
|
puts "#{path} uses #{amount} spaces."
|
@@ -42,5 +44,7 @@ end
|
|
42
44
|
end
|
43
45
|
rescue Errno::ENOENT
|
44
46
|
puts "Can't open #{path}"
|
47
|
+
rescue ArgumentError
|
48
|
+
puts "Failed for #{path}. Is it binary?"
|
45
49
|
end
|
46
50
|
end
|
data/lib/indentinator.rb
CHANGED
metadata
CHANGED