Class: Jackasset::Cli
- Inherits:
-
Object
- Object
- Jackasset::Cli
- Defined in:
- lib/jackasset/cli.rb
Overview
The main class
Constant Summary collapse
- BAD_CALL_MSG =
'Usage: jackasset [-p PORT] path/to/html_files'- PORT_RANGE =
1..65535
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.call ⇒ Object
9 10 11 |
# File 'lib/jackasset/cli.rb', line 9 def self.call new.call end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/jackasset/cli.rb', line 13 def call if valid_args_without_port? check_assets source_dir: ARGV.first elsif valid_args_with_port? check_assets host: "http://localhost:#{ARGV[1]}", source_dir: ARGV.last else puts BAD_CALL_MSG.red end end |