stowaway 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/stowaway/fshelpyhelp.rb +1 -1
- data/lib/stowaway/matcher.rb +6 -4
- data/lib/stowaway/options.rb +1 -0
- data/lib/stowaway/runner.rb +31 -11
- data/stowaway.gemspec +1 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/stowaway/fshelpyhelp.rb
CHANGED
data/lib/stowaway/matcher.rb
CHANGED
@@ -41,15 +41,17 @@ module Stowaway
|
|
41
41
|
return false if @line !~ expression
|
42
42
|
params = $3.gsub(/[\s|"|']/, "").split(",")
|
43
43
|
params.each do |f|
|
44
|
-
|
45
|
-
|
44
|
+
path = @file.root_path
|
45
|
+
return true if "/public/#{directory}/#{f}" == path ||
|
46
|
+
"/public/#{directory}/#{f}.#{extension}" == path
|
46
47
|
end
|
47
48
|
false
|
48
49
|
end
|
49
50
|
|
50
51
|
def direct_or_public_dir_match?(expression)
|
51
|
-
|
52
|
-
@line =~ Regexp.new(expression
|
52
|
+
expression = expression.to_s
|
53
|
+
@line =~ Regexp.new(expression % @file.root_path) ||
|
54
|
+
@line =~ Regexp.new(expression % trim_public)
|
53
55
|
end
|
54
56
|
|
55
57
|
def trim_public
|
data/lib/stowaway/options.rb
CHANGED
data/lib/stowaway/runner.rb
CHANGED
@@ -23,20 +23,40 @@ module Stowaway
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def respond(result)
|
26
|
-
|
27
|
-
|
28
|
-
else
|
29
|
-
print "\nYou have #{result.files.length} stowaway(s) ... shameful\n\n"
|
26
|
+
files = result.files
|
27
|
+
name_only_matches = result.name_only_matches
|
30
28
|
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
if files.empty?
|
30
|
+
print "Zero stowaways found. "
|
31
|
+
end
|
34
32
|
|
35
|
-
|
36
|
-
print "
|
37
|
-
|
38
|
-
|
33
|
+
if files.empty? and name_only_matches.empty?
|
34
|
+
print "You run a tight ship."
|
35
|
+
blank_lines
|
36
|
+
return
|
39
37
|
end
|
38
|
+
|
39
|
+
damage(result)
|
40
|
+
end
|
41
|
+
|
42
|
+
def damage(result)
|
43
|
+
files = result.files
|
44
|
+
name_only_matches = result.name_only_matches
|
45
|
+
|
46
|
+
print "\nYou have #{files.length} stowaway(s) ... scurvy dogs!\n"
|
47
|
+
warn name_only_matches
|
48
|
+
60.times { print "-" }
|
49
|
+
blank_lines
|
50
|
+
files.each_with_index { |f, i| print "#{i+1}: #{f.root_path}\n" }
|
51
|
+
end
|
52
|
+
|
53
|
+
def warn name_only_matches
|
54
|
+
return if name_only_matches.empty?
|
55
|
+
print "WARNING: #{name_only_matches.length} file(s) partially matched on name only\n"
|
56
|
+
end
|
57
|
+
|
58
|
+
def blank_lines
|
59
|
+
print "\n\n"
|
40
60
|
end
|
41
61
|
end
|
42
62
|
end
|
data/stowaway.gemspec
CHANGED