您最多能選擇 25 個主題 主題必須以字母或數字為開頭,可包含連接號「-」且最長為 35 個字元。
 
 
 
 
 
 

27 行
422 B

require 'ffi'
module FakeTime
extend FFI::Library
ffi_lib 'faketime'
def self._freeze(_)
#This is a stub, used for indexing
end
def self.unfreeze
#This is a stub, used for indexing
end
attach_function :_freeze, [:ulong], :void
attach_function :unfreeze, [], :void
def self.freeze(time)
self._freeze time.to_i
if block_given?
begin
return yield
ensure
self.unfreeze
end
end
end
end