Sha256: 16bbd18ddb1b33edfe97fda11acf72ee63ff888dcbc997e7b17bee409e6bb214

Contents?: true

Size: 660 Bytes

Versions: 9

Compression:

Stored size: 660 Bytes

Contents

# # == 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
    # == Synopsis
    # a simple elapse time for the give block
    # == Usage
    # elapse_seconds = timer {...}
    def timer
      start_time = Time.now
      yield
      Time.now - start_time
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
royw-dvdprofiler2xbmc-0.0.15 lib/kernel_extensions.rb
royw-dvdprofiler2xbmc-0.0.17 lib/kernel_extensions.rb
royw-dvdprofiler2xbmc-0.0.18 lib/kernel_extensions.rb
royw-dvdprofiler2xbmc-0.0.19 lib/kernel_extensions.rb
royw-dvdprofiler_collection-0.0.2 lib/kernel_extensions.rb
royw-dvdprofiler_collection-0.0.3 lib/kernel_extensions.rb
royw-dvdprofiler_collection-0.1.0 lib/kernel_extensions.rb
royw-dvdprofiler_collection-0.1.1 lib/kernel_extensions.rb
royw-dvdprofiler_collection-0.1.2 lib/kernel_extensions.rb