mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-09-16 16:18:11 +08:00
Rename uplot to youplot
This commit is contained in:
10
lib/uplot.rb
10
lib/uplot.rb
@@ -1,10 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'unicode_plot'
|
||||
require 'uplot/version'
|
||||
require 'uplot/preprocessing'
|
||||
require 'uplot/plot'
|
||||
require 'uplot/command'
|
||||
|
||||
module Uplot
|
||||
end
|
10
lib/youplot.rb
Normal file
10
lib/youplot.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'unicode_plot'
|
||||
require 'youplot/version'
|
||||
require 'youplot/preprocessing'
|
||||
require 'youplot/plot'
|
||||
require 'youplot/command'
|
||||
|
||||
module YouPlot
|
||||
end
|
@@ -3,7 +3,7 @@
|
||||
require_relative 'preprocessing'
|
||||
require_relative 'command/parser'
|
||||
|
||||
module Uplot
|
||||
module YouPlot
|
||||
Data = Struct.new(:headers, :series)
|
||||
|
||||
class Command
|
@@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Uplot
|
||||
module YouPlot
|
||||
class Command
|
||||
# UnicodePlot parameters.
|
||||
# * Normally in a Ruby program, you might use hash for the parameter object.
|
@@ -3,7 +3,7 @@
|
||||
require 'optparse'
|
||||
require_relative 'params'
|
||||
|
||||
module Uplot
|
||||
module YouPlot
|
||||
class Command
|
||||
class Parser
|
||||
attr_reader :command, :params,
|
||||
@@ -26,14 +26,14 @@ module Uplot
|
||||
|
||||
def create_default_parser
|
||||
OptionParser.new do |opt|
|
||||
opt.program_name = 'uplot'
|
||||
opt.version = Uplot::VERSION
|
||||
opt.program_name = 'YouPlot'
|
||||
opt.version = YouPlot::VERSION
|
||||
opt.summary_width = 24
|
||||
opt.on_tail('') # Add a blank line at the end
|
||||
opt.separator('')
|
||||
opt.on('Common options:')
|
||||
opt.on('-O', '--pass [VAL]', 'file to output standard input data to [stdout]',
|
||||
'for inserting uplot in the middle of Unix pipes') do |v|
|
||||
'for inserting YouPlot in the middle of Unix pipes') do |v|
|
||||
@pass = v || $stdout
|
||||
end
|
||||
opt.on('-o', '--output VAL', 'file to output results to [stderr]') do |v|
|
||||
@@ -102,9 +102,9 @@ module Uplot
|
||||
main_parser.banner = \
|
||||
<<~MSG
|
||||
|
||||
Program: uplot (Tools for plotting on the terminal)
|
||||
Version: #{Uplot::VERSION} (using UnicodePlot #{UnicodePlot::VERSION})
|
||||
Source: https://github.com/kojix2/uplot
|
||||
Program: YouPlot (Tools for plotting on the terminal)
|
||||
Version: #{YouPlot::VERSION} (using UnicodePlot #{UnicodePlot::VERSION})
|
||||
Source: https://github.com/kojix2/youplot
|
||||
|
||||
Usage: uplot <command> [options] <in.tsv>
|
||||
|
||||
@@ -123,7 +123,7 @@ module Uplot
|
||||
|
||||
General options:
|
||||
--help print command specific help menu
|
||||
--version print the version of uplot
|
||||
--version print the version of YouPlot
|
||||
MSG
|
||||
|
||||
# Actually, main_parser can take common optional arguments.
|
||||
@@ -141,7 +141,7 @@ module Uplot
|
||||
@sub_parser ||= create_default_parser do |parser|
|
||||
parser.banner = <<~MSG
|
||||
|
||||
Usage: uplot #{command} [options] <in.tsv>
|
||||
Usage: YouPlot #{command} [options] <in.tsv>
|
||||
|
||||
Options for #{command}:
|
||||
MSG
|
@@ -2,7 +2,7 @@
|
||||
|
||||
require 'unicode_plot'
|
||||
|
||||
module Uplot
|
||||
module YouPlot
|
||||
# plotting functions.
|
||||
module Plot
|
||||
module_function
|
||||
@@ -146,7 +146,7 @@ module Uplot
|
||||
def check_series_size(data, fmt)
|
||||
series = data.series
|
||||
if series.size == 1
|
||||
warn 'uplot: There is only one series of input data. Please check the delimiter.'
|
||||
warn 'youplot: There is only one series of input data. Please check the delimiter.'
|
||||
warn ''
|
||||
warn " Headers: \e[35m#{data.headers.inspect}\e[0m"
|
||||
warn " The first item is: \e[35m\"#{series[0][0]}\"\e[0m"
|
||||
@@ -154,7 +154,7 @@ module Uplot
|
||||
exit 1
|
||||
end
|
||||
if fmt == 'xyxy' && series.size.odd?
|
||||
warn 'uplot: In the xyxy format, the number of series must be even.'
|
||||
warn 'YouPlot: In the xyxy format, the number of series must be even.'
|
||||
warn ''
|
||||
warn " Number of series: \e[35m#{series.size}\e[0m"
|
||||
warn " Headers: \e[35m#{data.headers.inspect}\e[0m"
|
@@ -2,7 +2,7 @@
|
||||
|
||||
require 'csv'
|
||||
|
||||
module Uplot
|
||||
module YouPlot
|
||||
module Preprocessing
|
||||
module_function
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Uplot
|
||||
VERSION = '0.2.8'
|
||||
module YouPlot
|
||||
VERSION = '0.3.0'
|
||||
end
|
Reference in New Issue
Block a user