From e831fa93f4b86222ee9a8b90c142acaa8391201b Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Mon, 23 Nov 2020 13:09:16 +0900 Subject: [PATCH] Rename uplot to youplot --- Gemfile | 2 +- README.md | 20 +++++++++----------- exe/uplot | 4 ++-- lib/uplot.rb | 10 ---------- lib/youplot.rb | 10 ++++++++++ lib/{uplot => youplot}/command.rb | 2 +- lib/{uplot => youplot}/command/params.rb | 2 +- lib/{uplot => youplot}/command/parser.rb | 18 +++++++++--------- lib/{uplot => youplot}/plot.rb | 6 +++--- lib/{uplot => youplot}/preprocessing.rb | 2 +- lib/{uplot => youplot}/version.rb | 4 ++-- test/test_helper.rb | 2 +- test/uplot/command_test.rb | 2 +- test/uplot/plot_test.rb | 2 +- test/uplot/preprocessing_test.rb | 4 ++-- test/uplot_test.rb | 4 ++-- uplot.gemspec => youplot.gemspec | 8 ++++---- 17 files changed, 50 insertions(+), 52 deletions(-) delete mode 100644 lib/uplot.rb create mode 100644 lib/youplot.rb rename lib/{uplot => youplot}/command.rb (99%) rename lib/{uplot => youplot}/command/params.rb (97%) rename lib/{uplot => youplot}/command/parser.rb (95%) rename lib/{uplot => youplot}/plot.rb (96%) rename lib/{uplot => youplot}/preprocessing.rb (99%) rename lib/{uplot => youplot}/version.rb (50%) rename uplot.gemspec => youplot.gemspec (83%) diff --git a/Gemfile b/Gemfile index 97f600f..3cdc4c4 100644 --- a/Gemfile +++ b/Gemfile @@ -2,5 +2,5 @@ source 'https://rubygems.org' -# Specify your gem's dependencies in uplot.gemspec +# Specify your gem's dependencies in youplot.gemspec gemspec diff --git a/README.md b/README.md index bbb41ec..64d1a92 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# uplot +# YouPlot -![Build Status](https://github.com/kojix2/uplot/workflows/test/badge.svg) -[![Gem Version](https://badge.fury.io/rb/u-plot.svg)](https://badge.fury.io/rb/u-plot) -[![Docs Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://rubydoc.info/gems/u-plot) +![Build Status](https://github.com/kojix2/youplot/workflows/test/badge.svg) +[![Gem Version](https://badge.fury.io/rb/youplot.svg)](https://badge.fury.io/rb/youplot) +[![Docs Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://rubydoc.info/gems/youplot) [![The MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.txt) Create ASCII charts on the terminal with data from standard streams in the pipeline. @@ -12,11 +12,9 @@ Create ASCII charts on the terminal with data from standard streams in the pipel ## Installation ``` -gem install u-plot +gem install youplot ``` -Note: The name of the Gem is `u-plot` (not uplot). - ## Screenshots **histogram** @@ -81,9 +79,9 @@ uplot colors `uplot --help` ``` -Program: uplot (Tools for plotting on the terminal) +Program: YouPlot (Tools for plotting on the terminal) Version: 0.2.7 (using UnicodePlot 0.0.4) -Source: https://github.com/kojix2/uplot +Source: https://github.com/kojix2/youplot Usage: uplot [options] @@ -102,7 +100,7 @@ Commands: Options: -O, --pass [VAL] file to output standard input data to [stdout] - for inserting uplot in the middle of Unix pipes + for inserting YouPlot in the middle of Unix pipes -o, --output VAL file to output results to [stderr] -d, --delimiter VAL use DELIM instead of TAB for field delimiter -H, --headers specify that the input has header row @@ -143,7 +141,7 @@ Let's keep it simple. ## Contributing -Bug reports and pull requests are welcome on GitHub at [https://github.com/kojix2/uplot](https://github.com/kojix2/uplot). +Bug reports and pull requests are welcome on GitHub at [https://github.com/kojix2/youplot](https://github.com/kojix2/youplot). ## License diff --git a/exe/uplot b/exe/uplot index 88eb387..e35433e 100755 --- a/exe/uplot +++ b/exe/uplot @@ -1,6 +1,6 @@ #!/usr/bin/env ruby # frozen_string_literal: true -require 'uplot' +require 'youplot' -Uplot::Command.new.run +YouPlot::Command.new.run diff --git a/lib/uplot.rb b/lib/uplot.rb deleted file mode 100644 index 3992c40..0000000 --- a/lib/uplot.rb +++ /dev/null @@ -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 diff --git a/lib/youplot.rb b/lib/youplot.rb new file mode 100644 index 0000000..ce379d6 --- /dev/null +++ b/lib/youplot.rb @@ -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 diff --git a/lib/uplot/command.rb b/lib/youplot/command.rb similarity index 99% rename from lib/uplot/command.rb rename to lib/youplot/command.rb index e2776a4..3a6c78f 100644 --- a/lib/uplot/command.rb +++ b/lib/youplot/command.rb @@ -3,7 +3,7 @@ require_relative 'preprocessing' require_relative 'command/parser' -module Uplot +module YouPlot Data = Struct.new(:headers, :series) class Command diff --git a/lib/uplot/command/params.rb b/lib/youplot/command/params.rb similarity index 97% rename from lib/uplot/command/params.rb rename to lib/youplot/command/params.rb index b385161..3e93964 100644 --- a/lib/uplot/command/params.rb +++ b/lib/youplot/command/params.rb @@ -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. diff --git a/lib/uplot/command/parser.rb b/lib/youplot/command/parser.rb similarity index 95% rename from lib/uplot/command/parser.rb rename to lib/youplot/command/parser.rb index a80665f..0002e47 100644 --- a/lib/uplot/command/parser.rb +++ b/lib/youplot/command/parser.rb @@ -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 [options] @@ -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] + Usage: YouPlot #{command} [options] Options for #{command}: MSG diff --git a/lib/uplot/plot.rb b/lib/youplot/plot.rb similarity index 96% rename from lib/uplot/plot.rb rename to lib/youplot/plot.rb index fa30ef2..2bb4347 100644 --- a/lib/uplot/plot.rb +++ b/lib/youplot/plot.rb @@ -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" diff --git a/lib/uplot/preprocessing.rb b/lib/youplot/preprocessing.rb similarity index 99% rename from lib/uplot/preprocessing.rb rename to lib/youplot/preprocessing.rb index 10ee88f..ce67d90 100644 --- a/lib/uplot/preprocessing.rb +++ b/lib/youplot/preprocessing.rb @@ -2,7 +2,7 @@ require 'csv' -module Uplot +module YouPlot module Preprocessing module_function diff --git a/lib/uplot/version.rb b/lib/youplot/version.rb similarity index 50% rename from lib/uplot/version.rb rename to lib/youplot/version.rb index 9f25c2d..0b09407 100644 --- a/lib/uplot/version.rb +++ b/lib/youplot/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -module Uplot - VERSION = '0.2.8' +module YouPlot + VERSION = '0.3.0' end diff --git a/test/test_helper.rb b/test/test_helper.rb index a0f705b..2bdf8e8 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -3,6 +3,6 @@ require 'simplecov' SimpleCov.start -require 'uplot' +require 'youplot' require 'test/unit' diff --git a/test/uplot/command_test.rb b/test/uplot/command_test.rb index f8860fa..491504b 100644 --- a/test/uplot/command_test.rb +++ b/test/uplot/command_test.rb @@ -2,5 +2,5 @@ require_relative '../test_helper' -class UplotCommandTest < Test::Unit::TestCase +class YouPlotCommandTest < Test::Unit::TestCase end diff --git a/test/uplot/plot_test.rb b/test/uplot/plot_test.rb index 985b1eb..4a6184a 100644 --- a/test/uplot/plot_test.rb +++ b/test/uplot/plot_test.rb @@ -2,5 +2,5 @@ require_relative '../test_helper' -class UplotPlotTest < Test::Unit::TestCase +class YouPlotPlotTest < Test::Unit::TestCase end diff --git a/test/uplot/preprocessing_test.rb b/test/uplot/preprocessing_test.rb index 0e314a6..8506820 100644 --- a/test/uplot/preprocessing_test.rb +++ b/test/uplot/preprocessing_test.rb @@ -2,9 +2,9 @@ require_relative '../test_helper' -class UplotPreprocessingTest < Test::Unit::TestCase +class YouPlotPreprocessingTest < Test::Unit::TestCase def setup - @m = Uplot::Preprocessing + @m = YouPlot::Preprocessing end test :transpose2 do diff --git a/test/uplot_test.rb b/test/uplot_test.rb index 85e9859..cee4a5c 100644 --- a/test/uplot_test.rb +++ b/test/uplot_test.rb @@ -2,8 +2,8 @@ require 'test_helper' -class UplotTest < Test::Unit::TestCase +class YouPlotTest < Test::Unit::TestCase def test_that_it_has_a_version_number - assert_kind_of String, ::Uplot::VERSION + assert_kind_of String, ::YouPlot::VERSION end end diff --git a/uplot.gemspec b/youplot.gemspec similarity index 83% rename from uplot.gemspec rename to youplot.gemspec index 054dc98..e43429a 100644 --- a/uplot.gemspec +++ b/youplot.gemspec @@ -1,10 +1,10 @@ # frozen_string_literal: true -require_relative 'lib/uplot/version' +require_relative 'lib/youplot/version' Gem::Specification.new do |spec| - spec.name = 'u-plot' - spec.version = Uplot::VERSION + spec.name = 'youplot' + spec.version = YouPlot::VERSION spec.authors = ['kojix2'] spec.email = ['2xijok@gmail.com'] @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| Create ASCII charts on the terminal with data from standard streams in the pipeline. MSG - spec.homepage = 'https://github.com/kojix2/uplot' + spec.homepage = 'https://github.com/kojix2/youplot' spec.license = 'MIT' spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')