From f67a5ce913ec54b647c1f269154ad0134cb4ce4d Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Mon, 12 Jul 2021 14:49:23 +0900 Subject: [PATCH] Add comments on the run_as_executable variable --- lib/youplot.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/youplot.rb b/lib/youplot.rb index 320a687..f20d53f 100644 --- a/lib/youplot.rb +++ b/lib/youplot.rb @@ -6,6 +6,12 @@ require_relative 'youplot/parameters' require_relative 'youplot/command' module YouPlot + # @run_as_executable = true / false + # YouPlot behaves slightly differently when run as a command line tool + # and when run as a script (e.g. for testing). In the event of an error, + # when run as a command line tool, YouPlot will display a short error message + # and exit abnormally. When run as a script, it will just raise an error. + @run_as_executable = false class << self attr_accessor :run_as_executable @@ -13,5 +19,4 @@ module YouPlot @run_as_executable end end - @run_as_executable = false end