mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-06 07:10:10 +08:00
Rename uplot to youplot
This commit is contained in:
parent
d85be56521
commit
e831fa93f4
2
Gemfile
2
Gemfile
@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
# Specify your gem's dependencies in uplot.gemspec
|
# Specify your gem's dependencies in youplot.gemspec
|
||||||
gemspec
|
gemspec
|
||||||
|
20
README.md
20
README.md
@ -1,8 +1,8 @@
|
|||||||
# uplot
|
# YouPlot
|
||||||
|
|
||||||

|

|
||||||
[](https://badge.fury.io/rb/u-plot)
|
[](https://badge.fury.io/rb/youplot)
|
||||||
[](https://rubydoc.info/gems/u-plot)
|
[](https://rubydoc.info/gems/youplot)
|
||||||
[](LICENSE.txt)
|
[](LICENSE.txt)
|
||||||
|
|
||||||
Create ASCII charts on the terminal with data from standard streams in the pipeline.
|
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
|
## Installation
|
||||||
|
|
||||||
```
|
```
|
||||||
gem install u-plot
|
gem install youplot
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: The name of the Gem is `u-plot` (not uplot).
|
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
**histogram**
|
**histogram**
|
||||||
@ -81,9 +79,9 @@ uplot colors
|
|||||||
`uplot --help`
|
`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)
|
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>
|
Usage: uplot <command> [options] <in.tsv>
|
||||||
|
|
||||||
@ -102,7 +100,7 @@ Commands:
|
|||||||
|
|
||||||
Options:
|
Options:
|
||||||
-O, --pass [VAL] file to output standard input data to [stdout]
|
-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]
|
-o, --output VAL file to output results to [stderr]
|
||||||
-d, --delimiter VAL use DELIM instead of TAB for field delimiter
|
-d, --delimiter VAL use DELIM instead of TAB for field delimiter
|
||||||
-H, --headers specify that the input has header row
|
-H, --headers specify that the input has header row
|
||||||
@ -143,7 +141,7 @@ Let's keep it simple.
|
|||||||
|
|
||||||
## Contributing
|
## 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
|
## License
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'uplot'
|
require 'youplot'
|
||||||
|
|
||||||
Uplot::Command.new.run
|
YouPlot::Command.new.run
|
||||||
|
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 'preprocessing'
|
||||||
require_relative 'command/parser'
|
require_relative 'command/parser'
|
||||||
|
|
||||||
module Uplot
|
module YouPlot
|
||||||
Data = Struct.new(:headers, :series)
|
Data = Struct.new(:headers, :series)
|
||||||
|
|
||||||
class Command
|
class Command
|
@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Uplot
|
module YouPlot
|
||||||
class Command
|
class Command
|
||||||
# UnicodePlot parameters.
|
# UnicodePlot parameters.
|
||||||
# * Normally in a Ruby program, you might use hash for the parameter object.
|
# * Normally in a Ruby program, you might use hash for the parameter object.
|
@ -3,7 +3,7 @@
|
|||||||
require 'optparse'
|
require 'optparse'
|
||||||
require_relative 'params'
|
require_relative 'params'
|
||||||
|
|
||||||
module Uplot
|
module YouPlot
|
||||||
class Command
|
class Command
|
||||||
class Parser
|
class Parser
|
||||||
attr_reader :command, :params,
|
attr_reader :command, :params,
|
||||||
@ -26,14 +26,14 @@ module Uplot
|
|||||||
|
|
||||||
def create_default_parser
|
def create_default_parser
|
||||||
OptionParser.new do |opt|
|
OptionParser.new do |opt|
|
||||||
opt.program_name = 'uplot'
|
opt.program_name = 'YouPlot'
|
||||||
opt.version = Uplot::VERSION
|
opt.version = YouPlot::VERSION
|
||||||
opt.summary_width = 24
|
opt.summary_width = 24
|
||||||
opt.on_tail('') # Add a blank line at the end
|
opt.on_tail('') # Add a blank line at the end
|
||||||
opt.separator('')
|
opt.separator('')
|
||||||
opt.on('Common options:')
|
opt.on('Common options:')
|
||||||
opt.on('-O', '--pass [VAL]', 'file to output standard input data to [stdout]',
|
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
|
@pass = v || $stdout
|
||||||
end
|
end
|
||||||
opt.on('-o', '--output VAL', 'file to output results to [stderr]') do |v|
|
opt.on('-o', '--output VAL', 'file to output results to [stderr]') do |v|
|
||||||
@ -102,9 +102,9 @@ module Uplot
|
|||||||
main_parser.banner = \
|
main_parser.banner = \
|
||||||
<<~MSG
|
<<~MSG
|
||||||
|
|
||||||
Program: uplot (Tools for plotting on the terminal)
|
Program: YouPlot (Tools for plotting on the terminal)
|
||||||
Version: #{Uplot::VERSION} (using UnicodePlot #{UnicodePlot::VERSION})
|
Version: #{YouPlot::VERSION} (using UnicodePlot #{UnicodePlot::VERSION})
|
||||||
Source: https://github.com/kojix2/uplot
|
Source: https://github.com/kojix2/youplot
|
||||||
|
|
||||||
Usage: uplot <command> [options] <in.tsv>
|
Usage: uplot <command> [options] <in.tsv>
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ module Uplot
|
|||||||
|
|
||||||
General options:
|
General options:
|
||||||
--help print command specific help menu
|
--help print command specific help menu
|
||||||
--version print the version of uplot
|
--version print the version of YouPlot
|
||||||
MSG
|
MSG
|
||||||
|
|
||||||
# Actually, main_parser can take common optional arguments.
|
# Actually, main_parser can take common optional arguments.
|
||||||
@ -141,7 +141,7 @@ module Uplot
|
|||||||
@sub_parser ||= create_default_parser do |parser|
|
@sub_parser ||= create_default_parser do |parser|
|
||||||
parser.banner = <<~MSG
|
parser.banner = <<~MSG
|
||||||
|
|
||||||
Usage: uplot #{command} [options] <in.tsv>
|
Usage: YouPlot #{command} [options] <in.tsv>
|
||||||
|
|
||||||
Options for #{command}:
|
Options for #{command}:
|
||||||
MSG
|
MSG
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require 'unicode_plot'
|
require 'unicode_plot'
|
||||||
|
|
||||||
module Uplot
|
module YouPlot
|
||||||
# plotting functions.
|
# plotting functions.
|
||||||
module Plot
|
module Plot
|
||||||
module_function
|
module_function
|
||||||
@ -146,7 +146,7 @@ module Uplot
|
|||||||
def check_series_size(data, fmt)
|
def check_series_size(data, fmt)
|
||||||
series = data.series
|
series = data.series
|
||||||
if series.size == 1
|
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 ''
|
||||||
warn " Headers: \e[35m#{data.headers.inspect}\e[0m"
|
warn " Headers: \e[35m#{data.headers.inspect}\e[0m"
|
||||||
warn " The first item is: \e[35m\"#{series[0][0]}\"\e[0m"
|
warn " The first item is: \e[35m\"#{series[0][0]}\"\e[0m"
|
||||||
@ -154,7 +154,7 @@ module Uplot
|
|||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
if fmt == 'xyxy' && series.size.odd?
|
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 ''
|
||||||
warn " Number of series: \e[35m#{series.size}\e[0m"
|
warn " Number of series: \e[35m#{series.size}\e[0m"
|
||||||
warn " Headers: \e[35m#{data.headers.inspect}\e[0m"
|
warn " Headers: \e[35m#{data.headers.inspect}\e[0m"
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
require 'csv'
|
require 'csv'
|
||||||
|
|
||||||
module Uplot
|
module YouPlot
|
||||||
module Preprocessing
|
module Preprocessing
|
||||||
module_function
|
module_function
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Uplot
|
module YouPlot
|
||||||
VERSION = '0.2.8'
|
VERSION = '0.3.0'
|
||||||
end
|
end
|
@ -3,6 +3,6 @@
|
|||||||
require 'simplecov'
|
require 'simplecov'
|
||||||
SimpleCov.start
|
SimpleCov.start
|
||||||
|
|
||||||
require 'uplot'
|
require 'youplot'
|
||||||
|
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
require_relative '../test_helper'
|
require_relative '../test_helper'
|
||||||
|
|
||||||
class UplotCommandTest < Test::Unit::TestCase
|
class YouPlotCommandTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
require_relative '../test_helper'
|
require_relative '../test_helper'
|
||||||
|
|
||||||
class UplotPlotTest < Test::Unit::TestCase
|
class YouPlotPlotTest < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
require_relative '../test_helper'
|
require_relative '../test_helper'
|
||||||
|
|
||||||
class UplotPreprocessingTest < Test::Unit::TestCase
|
class YouPlotPreprocessingTest < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@m = Uplot::Preprocessing
|
@m = YouPlot::Preprocessing
|
||||||
end
|
end
|
||||||
|
|
||||||
test :transpose2 do
|
test :transpose2 do
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class UplotTest < Test::Unit::TestCase
|
class YouPlotTest < Test::Unit::TestCase
|
||||||
def test_that_it_has_a_version_number
|
def test_that_it_has_a_version_number
|
||||||
assert_kind_of String, ::Uplot::VERSION
|
assert_kind_of String, ::YouPlot::VERSION
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative 'lib/uplot/version'
|
require_relative 'lib/youplot/version'
|
||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = 'u-plot'
|
spec.name = 'youplot'
|
||||||
spec.version = Uplot::VERSION
|
spec.version = YouPlot::VERSION
|
||||||
spec.authors = ['kojix2']
|
spec.authors = ['kojix2']
|
||||||
spec.email = ['2xijok@gmail.com']
|
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
|
Create ASCII charts on the terminal with data from standard streams in the
|
||||||
pipeline.
|
pipeline.
|
||||||
MSG
|
MSG
|
||||||
spec.homepage = 'https://github.com/kojix2/uplot'
|
spec.homepage = 'https://github.com/kojix2/youplot'
|
||||||
spec.license = 'MIT'
|
spec.license = 'MIT'
|
||||||
spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
|
spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user