Top Level Namespace

Defined Under Namespace

Modules: Curses

Instance Method Summary collapse

Instance Method Details

#exec_command(cmd) ⇒ Object



26
27
28
29
30
31
32
# File 'ext/curses/extconf.rb', line 26

def exec_command(cmd)
  puts "> #{cmd}"
  if !system(cmd)
    STDERR.puts("External command failed")
    exit 1
  end
end

#have_all(*args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'ext/curses/extconf.rb', line 5

def have_all(*args)
  old_libs = $libs.dup
  old_defs = $defs.dup
  result = []
  begin
    args.each {|arg|
      r = arg.call(*result)
      if !r
        return nil
      end
      result << r
    }
    result
  ensure
    if result.length != args.length
      $libs = old_libs
      $defs = old_defs
    end
  end
end