Sha256: a74713e1f72fceb8d575bdcceea1efa8b4fbd4bdc530e9306146a88957bf5fd7

Contents?: true

Size: 237 Bytes

Versions: 3

Compression:

Stored size: 237 Bytes

Contents

require 'tempfile'
require 'tmpdir'

def run_under_tmpdir(&block)
  raise "no block given" unless block_given?
  Dir.mktmpdir do |dir|
    Dir.chdir(dir) do |dir|
      yield dir
    end
  end
end

alias :run_in_tmpdir :run_under_tmpdir

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
scrapers-3.2.0 spec/support/dir_helpers.rb
scrapers-3.1.0 spec/support/dir_helpers.rb
scrapers-3.0.0 spec/support/dir_helpers.rb