Module: Kernel

Defined in:
lib/webby/core_ext/kernel.rb

Constant Summary collapse

WINDOWS =

:stopdoc:

%r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM
DEV_NULL =
WINDOWS ? 'NUL:' : '/dev/null'

Instance Method Summary collapse

Instance Method Details

#cmd_available?(*args) ⇒ Boolean

:startdoc:

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
18
# File 'lib/webby/core_ext/kernel.rb', line 9

def cmd_available?( *args )
  io = [STDOUT.dup, STDERR.dup]
  STDOUT.reopen DEV_NULL
  STDERR.reopen DEV_NULL
  system(*(args.flatten))
ensure
  STDOUT.reopen io.first
  STDERR.reopen io.last
  $stdout, $stderr = STDOUT, STDERR
end

#journalObject



20
21
22
# File 'lib/webby/core_ext/kernel.rb', line 20

def journal
  @journal ||= ::Webby::Journal.new
end