In Files

Files

Gnuplot

Public Class Methods

terminals() click to toggle source

(Not documented)

# File gnuplot.rb, line 359
  def Gnuplot.terminals
    terms = nil
    Gnuplot::Instance.open( nil, "r+" ) do |instance|
      begin
        instance.puts "set terminal"
        instance.close_write
        terms = instance.read.split($/).map do |line|
          m = /^(?!Available terminal types:)\s*(\S+)\s+(.*)\s*$/.match(line)
          m[1..-1] if m
        end - [nil]
      rescue IOError
        STDERR.puts "Could not get Gnuplot terminal types"
      end
    end
    terms
  end
which( bin ) click to toggle source

(Not documented)

# File gnuplot.rb, line 376
  def Gnuplot.which ( bin )
    return Gnuplot::GNUPLOT_EXE if const_defined? "GNUPLOT_EXE"
    return bin if File::executable? bin

    if RUBY_PLATFORM =~ /linux/i
      candidate = `which #{bin}`.chomp
    else
      path = ENV['PATH'] # || ENV['WHAT_EVER_WINDOWS_PATH_VAR_IS']
      path.split(File::PATH_SEPARATOR).each do |dir|
        candidate = File::join dir, bin.strip
      end
    end

    if File::executable? candidate
      const_set "GNUPLOT_EXE", candidate
      candidate
    else
      nil
    end
  end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.