Class: M3u8::CLI
- Inherits:
-
Object
- Object
- M3u8::CLI
- Defined in:
- lib/m3u8/cli.rb,
lib/m3u8/cli/diff_command.rb,
lib/m3u8/cli/inspect_command.rb,
lib/m3u8/cli/validate_command.rb
Overview
CLI provides a command-line interface for inspecting and validating m3u8 playlists
Defined Under Namespace
Classes: DiffCommand, InspectCommand, ValidateCommand
Constant Summary collapse
- COMMANDS =
%w[inspect validate diff].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv, stdin, stdout, stderr) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(argv, stdin, stdout, stderr) ⇒ CLI
Returns a new instance of CLI.
18 19 20 21 22 23 |
# File 'lib/m3u8/cli.rb', line 18 def initialize(argv, stdin, stdout, stderr) @argv = argv.dup @stdin = stdin @stdout = stdout @stderr = stderr end |
Class Method Details
.run(argv, stdin, stdout, stderr) ⇒ Object
14 15 16 |
# File 'lib/m3u8/cli.rb', line 14 def self.run(argv, stdin, stdout, stderr) new(argv, stdin, stdout, stderr).run end |
Instance Method Details
#run ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/m3u8/cli.rb', line 25 def run dispatch rescue OptionParser::InvalidOption => e @stderr.puts e. 2 end |