lib/hyde/utils.rb in hydeweb-0.0.1.pre1 vs lib/hyde/utils.rb in hydeweb-0.0.1.pre2
- old
+ new
@@ -7,7 +7,13 @@
def matches_files?(needle, haystack)
haystack.inject(false) do |a, match|
a ||= same_file?(needle, match)
end
end
+
+ def force_file_open(filepath)
+ require 'fileutils'
+ FileUtils.mkdir_p File.dirname(filepath)
+ File.new filepath, 'w'
+ end
end
end