lib/file_extensions.rb in royw-tmdb-0.0.1 vs lib/file_extensions.rb in royw-tmdb-0.0.2
- old
+ new
@@ -1,14 +1,18 @@
# == Synopsis
# add a mkdirs method to the File class
class File
- ##
- # make directories including any missing in the path
- #
- # @param [String] dirspec the path to make sure exists
- def File.mkdirs(dirspec)
- unless File.exists?(dirspec)
- mkdirs(File.dirname(dirspec))
- Dir.mkdir(dirspec)
+ class << self
+ my_extension("mkdirs") do
+ ##
+ # make directories including any missing in the path
+ #
+ # @param [String] dirspec the path to make sure exists
+ def File.mkdirs(dirspec)
+ unless File.exists?(dirspec)
+ mkdirs(File.dirname(dirspec))
+ Dir.mkdir(dirspec)
+ end
+ end
end
end
end