Class: MyManga::CLI::Command
- Inherits:
-
Hanami::CLI::Command
- Object
- Hanami::CLI::Command
- MyManga::CLI::Command
- Defined in:
- lib/my_manga/command.rb
Overview
Base class for CLI commands
Direct Known Subclasses
MyManga::CLI::Commands::Add, MyManga::CLI::Commands::Download, MyManga::CLI::Commands::Env, MyManga::CLI::Commands::Find, MyManga::CLI::Commands::List, MyManga::CLI::Commands::MCleanUp, MyManga::CLI::Commands::Mark, MyManga::CLI::Commands::Remove, MyManga::CLI::Commands::Update, MyManga::CLI::Commands::Version, MyManga::CLI::Commands::Zine
Instance Method Summary collapse
Instance Method Details
#manga_names(input) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/my_manga/command.rb', line 5 def manga_names(input) all = MyManga.names names = Array(input.to_s.split(',')).map(&:strip) names.empty? ? all : all & names end |
#pad(string, width, with: ' ') ⇒ Object
12 13 14 |
# File 'lib/my_manga/command.rb', line 12 def pad(string, width, with: ' ') string.ljust(width + 2, with) end |