Class: Slidict::Cli::Serve
- Inherits:
-
Object
- Object
- Slidict::Cli::Serve
- Includes:
- Options
- Defined in:
- lib/slidict/cli/serve.rb
Constant Summary collapse
- DEFAULT_PUBLIC_DIR =
"public"
Constants included from Options
Options::FAILURE, Options::MISSING, Options::SUCCESS
Instance Method Summary collapse
-
#initialize ⇒ Serve
constructor
A new instance of Serve.
- #run(args = []) ⇒ Object
Methods included from Options
Constructor Details
#initialize ⇒ Serve
Returns a new instance of Serve.
17 18 19 20 |
# File 'lib/slidict/cli/serve.rb', line 17 def initialize(**) super @public_dir = File.(@public_dir) end |
Instance Method Details
#run(args = []) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/slidict/cli/serve.rb', line 22 def run(args = []) app = build_app original_argv = ARGV.dup ARGV.replace(args) @output.puts "Serving slides from #{@public_dir}" app.run! SUCCESS ensure ARGV.replace(original_argv) if original_argv end |