Sha256: 1a1d25b3d1abad984ce791d1da6484278312111d6f5b18d8242be05112adac45

Contents?: true

Size: 411 Bytes

Versions: 6

Compression:

Stored size: 411 Bytes

Contents

require 'fileutils'

module RSCM

  def method_name
    /\`([^\']+)\'/.match(caller.first)[1]
  end

  def new_temp_dir(suffix="", basedir=File.dirname(__FILE__) + "/../../target")
    identifier = identifier.to_s
    identifier.gsub!(/\(|:|\)/, '_')
    dir = "#{basedir}/temp_#{identifier}_#{Time.new.to_i}#{suffix}"
    FileUtils.mkdir_p(dir)
    dir
  end
  module_function :new_temp_dir
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
rscm-0.4.5 lib/rscm/tempdir.rb
rscm-0.4.4 lib/rscm/tempdir.rb
rscm-0.5.0 lib/rscm/tempdir.rb
rscm-0.5.1 lib/rscm/tempdir.rb
whistle-0.1.1 vendor/rscm-0.5.1-patched-stripped/lib/rscm/tempdir.rb
whistle-0.1 vendor/rscm-0.5.1-patched-stripped/lib/rscm/tempdir.rb