Class: RubyCleanCSS::Exports::Process
- Inherits:
-
Object
- Object
- RubyCleanCSS::Exports::Process
- Defined in:
- lib/ruby-clean-css/exports.rb
Overview
:nodoc:
Instance Method Summary collapse
- #cwd ⇒ Object
- #exit(*args) ⇒ Object
- #hrtime ⇒ Object
-
#initialize ⇒ Process
constructor
A new instance of Process.
- #nextTick ⇒ Object
Constructor Details
#initialize ⇒ Process
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
#cwd ⇒ Object
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 |
#hrtime ⇒ Object
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 |
#nextTick ⇒ Object
21 22 23 |
# File 'lib/ruby-clean-css/exports.rb', line 21 def nextTick lambda { |global, fn| fn.call } end |