Sha256: 5521f64db16b3a779865388ed88413856cf49824b7cc10cc7720855c4e00e33e

Contents?: true

Size: 668 Bytes

Versions: 11

Compression:

Stored size: 668 Bytes

Contents

# Mutex

class Mutex
  def synchronize
    self.lock
    begin
      yield
    ensure
      self.unlock rescue nil
    end
  end
end

# Thread

class Thread
  MUTEX_FOR_THREAD_EXCLUSIVE = Mutex.new
  def self.exclusive
    MUTEX_FOR_THREAD_EXCLUSIVE.synchronize{
      yield
    }
  end
end

module Kernel
  module_function
  def require_relative(relative_feature)
    c = caller.first
    e = c.rindex(/:\d+:in /)
    file = $`
    if /\A\((.*)\)/ =~ file # eval, etc.
      raise LoadError, "require_relative is called in #{$1}"
    end
    absolute_feature = File.expand_path(File.join(File.dirname(file), relative_feature))
    require absolute_feature
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
trepanning-1.93.35 data/prelude.rb
trepanning-1.93.32 data/prelude.rb
trepanning-0.1.6 data/prelude.rb
trepanning-0.1.4 data/prelude.rb
trepanning-0.1.3 data/prelude.rb
trepanning-0.1.2 data/prelude.rb
trepanning-0.1.1 data/prelude.rb
trepanning-0.1.0 data/prelude.rb
trepanning-0.0.8 data/prelude.rb
trepanning-0.0.6 data/prelude.rb
trepanning-0.0.4 data/prelude.rb