Class: PKGWizard::NodeRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/pkg-wizard/commands/build_bot.rb

Constant Summary collapse

@@logfile =
'/dev/null'

Class Method Summary collapse

Class Method Details

.available?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/pkg-wizard/commands/build_bot.rb', line 35

def self.available?
  not `which node`.strip.chomp.empty?
end

.killObject



39
40
41
# File 'lib/pkg-wizard/commands/build_bot.rb', line 39

def self.kill
  Process.kill 15, @@proc.pid
end

.logfile=(logfile) ⇒ Object



31
32
33
# File 'lib/pkg-wizard/commands/build_bot.rb', line 31

def self.logfile=(logfile)
  @@logfile = logfile
end

.runObject



43
44
45
46
47
48
49
# File 'lib/pkg-wizard/commands/build_bot.rb', line 43

def self.run
  public_dir = 'public'
  if not defined? @@proc
    puts '* starting NODE.JS...'
    @@proc = IO.popen("node public/server.js #{@@logfile}")
  end
end