lib/gnuplotrb/fit.rb
##
# It takes some time to produce output so here we need
# to wait for it.
#
# Max time to wait is stored in Settings.max_fit_delay, so one
# can change it in order to wait longer.
It takes some time to produce output so here we need
to wait for it.

Max time to wait is stored in Settings.max_fit_delay, so one
can change it in order to wait longer.
It takes some time to produce output so here we need to wait for it . Max time to wait is stored in Settings . max_fit_delay so one can change it in order to wait longer .
def wait_for_output(term, variables)
      start = Time.now
      output = ''
      until output_ready?(output, variables)
        begin
          term.check_errors(raw: true)
        rescue GnuplotRB::GnuplotError => e
          output += e.message
        end
        if Time.now - start > Settings.max_fit_delay
          fail GnuplotError, "Seems like there is an error in gnuplotrb: #{output}"
        end
      end
      output
    end
def wait_for_output ( term , variables ) start = Time . now output = '' until output_ready? ( output , variables ) begin term . check_errors ( raw : true ) rescue GnuplotRB :: GnuplotError => e output += e . message end if Time . now - start > Settings . max_fit_delay fail GnuplotError , "Seems like there is an error in gnuplotrb: #{output}" end end output end
It takes some time to produce output so here we need
to wait for it.
It takes some time to produce output so here we need to wait for it .
# now we should catch 'error' from terminal: it will contain approximation data # but we can get a real error instead of output, so lets wait for limited time
term
<not_specific>
variables
<not_specific>