Module: R::I::Runner

Defined in:
lib/rub/r/i/runner.rb

Overview

Functions for running build scripts.

Constant Summary collapse

@@loaded =
{}

Class Method Summary collapse

Class Method Details

.do_file(f) ⇒ void

This method returns an undefined value.

Execute a file.

Runs a script if it hasn’t been run already.

Parameters:

  • f (Pathname)

    The file to run.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rub/r/i/runner.rb', line 35

def self.do_file(f)
  if @@loaded[f]
    return
  end

  if not f.exist?
    $stderr.puts "\"#{f}\" is not readable!"
    Sysexits.exit :noinput
  end
  
  @@loaded[f] = true
  
  Dir.chdir f.dirname do
    load f.to_s
  end
end