lib/bunch.rb in bunch-0.0.2 vs lib/bunch.rb in bunch-0.0.3
- old
+ new
@@ -22,10 +22,12 @@
end
class << Bunch
def Tree(fn)
case
+ when !File.exist?(fn)
+ raise Errno::ENOENT, fn
when File.directory?(fn)
Bunch::DirectoryNode.new(fn)
when fn =~ /\.coffee$/
Bunch::CoffeeNode.new(fn)
when fn =~ /\.s(a|c)ss$/
@@ -33,5 +35,16 @@
else
Bunch::FileNode.new(fn)
end
end
end
+
+#class Module
+# def benchmark(meth)
+# alias_method "#{meth}_old", meth
+# define_method meth do |*args, &blk|
+# t = Time.now
+# send "#{meth}_old", *args, &blk
+# STDERR.puts "Called #{meth} in #{Time.now - t}."
+# end
+# end
+#end