Class: RevealCK::Commands::Serve
- Inherits:
-
Object
- Object
- RevealCK::Commands::Serve
- Includes:
- Retrieve
- Defined in:
- lib/reveal-ck/commands/serve.rb
Overview
This Command is responsible for implementing the idea behind “reveal-ck serve.”
This includes taking an action and managing stdout
Instance Attribute Summary collapse
-
#doc_root ⇒ Object
readonly
Returns the value of attribute doc_root.
-
#gem_dir ⇒ Object
readonly
Returns the value of attribute gem_dir.
-
#output_dir ⇒ Object
readonly
Returns the value of attribute output_dir.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#slides_file ⇒ Object
readonly
Returns the value of attribute slides_file.
-
#ui ⇒ Object
readonly
Returns the value of attribute ui.
-
#user_dir ⇒ Object
readonly
Returns the value of attribute user_dir.
Instance Method Summary collapse
-
#initialize(args) ⇒ Serve
constructor
A new instance of Serve.
- #rebuild_slides ⇒ Object
- #run ⇒ Object
Methods included from Retrieve
Constructor Details
#initialize(args) ⇒ Serve
Returns a new instance of Serve.
12 13 14 15 16 17 18 19 20 |
# File 'lib/reveal-ck/commands/serve.rb', line 12 def initialize(args) @doc_root = retrieve(:doc_root, args) @port = retrieve(:port, args) @slides_file = retrieve(:slides_file, args) @gem_dir = retrieve(:gem_dir, args) @output_dir = retrieve(:output_dir, args) @user_dir = retrieve(:user_dir, args) @ui = ServeUI.new end |
Instance Attribute Details
#doc_root ⇒ Object (readonly)
Returns the value of attribute doc_root.
9 10 11 |
# File 'lib/reveal-ck/commands/serve.rb', line 9 def doc_root @doc_root end |
#gem_dir ⇒ Object (readonly)
Returns the value of attribute gem_dir.
10 11 12 |
# File 'lib/reveal-ck/commands/serve.rb', line 10 def gem_dir @gem_dir end |
#output_dir ⇒ Object (readonly)
Returns the value of attribute output_dir.
10 11 12 |
# File 'lib/reveal-ck/commands/serve.rb', line 10 def output_dir @output_dir end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
9 10 11 |
# File 'lib/reveal-ck/commands/serve.rb', line 9 def port @port end |
#slides_file ⇒ Object (readonly)
Returns the value of attribute slides_file.
10 11 12 |
# File 'lib/reveal-ck/commands/serve.rb', line 10 def @slides_file end |
#ui ⇒ Object (readonly)
Returns the value of attribute ui.
11 12 13 |
# File 'lib/reveal-ck/commands/serve.rb', line 11 def ui @ui end |
#user_dir ⇒ Object (readonly)
Returns the value of attribute user_dir.
10 11 12 |
# File 'lib/reveal-ck/commands/serve.rb', line 10 def user_dir @user_dir end |
Instance Method Details
#rebuild_slides ⇒ Object
29 30 31 32 33 |
# File 'lib/reveal-ck/commands/serve.rb', line 29 def RevealCK::Commands::Generate.new().run rescue => error ui.problem('Failed to Generate Slides:', error) end |
#run ⇒ Object
22 23 24 25 26 27 |
# File 'lib/reveal-ck/commands/serve.rb', line 22 def run listen_to_reload listen_to_rebuild start_web_server end |