bin/coypond in coypond-0.2.4 vs bin/coypond in coypond-0.2.5
- old
+ new
@@ -48,19 +48,22 @@
options[:all] ||= (options.keys & [:class, :method, :module]).empty?
def expand(file, pattern=["**"])
if File.directory?(file)
return Dir.glob(File.join([file, pattern, "*.rb"].flatten) )
- else
+ elsif File.exist?(file)
return file
+ else
+ return []
end
end
files = []
if options[:gem]
- $:.each do |path|
- files += expand(path, ["#{options[:gem]}*", "**"])
+ pattern = ["#{options[:gem]}*", "**"]
+ $:.each_with_index do |path, i|
+ files += expand(path, pattern)
end
else
files = $*.map {|file| expand(file)}.flatten
end
@@ -71,6 +74,6 @@
res.each do |dec, location, context|
puts " #{location.join(",")}: #{context.strip}"
end
puts ""
end
-end
\ No newline at end of file
+end