Class: RubyCleanCSS::Exports::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-clean-css/exports.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initializeProcess

Returns a new instance of Process.



16
17
18
# File 'lib/ruby-clean-css/exports.rb', line 16

def initialize
  @init_time = Time.now
end

Instance Method Details

#cwdObject



26
27
28
# File 'lib/ruby-clean-css/exports.rb', line 26

def cwd
  lambda { Dir.pwd }
end

#exit(*args) ⇒ Object



40
41
42
# File 'lib/ruby-clean-css/exports.rb', line 40

def exit(*args)
  warn("JS process.exit(#{args.first}) called from: \n#{caller.join("\n")}")
end

#hrtimeObject



31
32
33
34
35
36
37
# File 'lib/ruby-clean-css/exports.rb', line 31

def hrtime
  lambda { |this, hrt|
    hrt = hrt || [0,0]
    delta = Time.now - @init_time
    [delta.to_i - hrt[0], (delta % 1 * 1000000000).to_i - hrt[1]]
  }
end

#nextTickObject



21
22
23
# File 'lib/ruby-clean-css/exports.rb', line 21

def nextTick
  lambda { |global, fn| fn.call }
end