From 7e97d44caf9820ce1a1caf012b09ed738a0f4cf4 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Sat, 29 May 2021 10:28:56 +0900 Subject: [PATCH] Add comments --- lib/youplot/backends/unicode_plot.rb | 3 +++ lib/youplot/options.rb | 1 + lib/youplot/parameters.rb | 3 +-- lib/youplot/parser.rb | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/youplot/backends/unicode_plot.rb b/lib/youplot/backends/unicode_plot.rb index f99b878..4a9fcf3 100644 --- a/lib/youplot/backends/unicode_plot.rb +++ b/lib/youplot/backends/unicode_plot.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# UnicodePlot - Plot your data by Unicode characters +# https://github.com/red-data-tools/unicode_plot.rb + require_relative 'processing' require 'unicode_plot' diff --git a/lib/youplot/options.rb b/lib/youplot/options.rb index a50c202..1fb2a3d 100644 --- a/lib/youplot/options.rb +++ b/lib/youplot/options.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true module YouPlot + # Command line options that are not Plot parameters Options = Struct.new( :delimiter, :transpose, diff --git a/lib/youplot/parameters.rb b/lib/youplot/parameters.rb index 4c35b4b..9a9da6f 100644 --- a/lib/youplot/parameters.rb +++ b/lib/youplot/parameters.rb @@ -2,8 +2,7 @@ module YouPlot # UnicodePlot parameters. - # * Normally in a Ruby program, you might use hash for the parameter object. - # * Here, I use Struct for 2 safety reason. + # Why Struct, not Hash? # * The keys are static in Struct. # * Struct does not conflict with keyword arguments. Hash dose. Parameters = Struct.new( diff --git a/lib/youplot/parser.rb b/lib/youplot/parser.rb index 98246b8..2c90c4c 100644 --- a/lib/youplot/parser.rb +++ b/lib/youplot/parser.rb @@ -4,6 +4,7 @@ require 'optparse' require_relative 'options' module YouPlot + # Class for parsing command line options class Parser class Error < StandardError; end