lib/dvdprofiler2xbmc/extensions.rb in royw-dvdprofiler2xbmc-0.0.3 vs lib/dvdprofiler2xbmc/extensions.rb in royw-dvdprofiler2xbmc-0.0.4

- old
+ new

@@ -52,17 +52,17 @@ # return asserted if object is nil or empty # TODO: not the safest coding, probably should dup before stripping. Maybe should also compact def blank? result = nil? unless result - if respond_to? 'empty?' - if respond_to? 'strip' - result = strip.empty? - else - result = empty? - end - end + if respond_to? 'empty?' + if respond_to? 'strip' + result = strip.empty? + else + result = empty? + end + end end result end end end @@ -81,10 +81,25 @@ seconds = seconds - (minutes * 60) sprintf("%2.2d:%2.2d:%2.2d", hours, minutes, seconds) end end end - + +# # == 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) +# end +# end +# end + # == Synopsis # add a timer method to the Kernel module Kernel my_extension("timer") do