Rename uplot to youplot

This commit is contained in:
kojix2 2020-11-23 13:09:16 +09:00
parent d85be56521
commit e831fa93f4
17 changed files with 50 additions and 52 deletions

View File

@ -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

View File

@ -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 <command> [options] <in.tsv>
@ -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

View File

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'uplot'
require 'youplot'
Uplot::Command.new.run
YouPlot::Command.new.run

View File

@ -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
View 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

View File

@ -3,7 +3,7 @@
require_relative 'preprocessing'
require_relative 'command/parser'
module Uplot
module YouPlot
Data = Struct.new(:headers, :series)
class Command

View File

@ -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.

View File

@ -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

View File

@ -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"

View File

@ -2,7 +2,7 @@
require 'csv'
module Uplot
module YouPlot
module Preprocessing
module_function

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
module Uplot
VERSION = '0.2.8'
module YouPlot
VERSION = '0.3.0'
end

View File

@ -3,6 +3,6 @@
require 'simplecov'
SimpleCov.start
require 'uplot'
require 'youplot'
require 'test/unit'

View File

@ -2,5 +2,5 @@
require_relative '../test_helper'
class UplotCommandTest < Test::Unit::TestCase
class YouPlotCommandTest < Test::Unit::TestCase
end

View File

@ -2,5 +2,5 @@
require_relative '../test_helper'
class UplotPlotTest < Test::Unit::TestCase
class YouPlotPlotTest < Test::Unit::TestCase
end

View File

@ -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

View File

@ -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

View File

@ -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')