Class: RevealCK::Commands::PrintBanner

Inherits:
Object
  • Object
show all
Defined in:
lib/reveal-ck/commands/print_banner.rb

Overview

The idea of displaying a banner via an injected ui. Messages sent explain everything to do with the serve command (listening, reloading, and webserving)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc_root, port, slides_file, ui) ⇒ PrintBanner

Returns a new instance of PrintBanner.



8
9
10
11
# File 'lib/reveal-ck/commands/print_banner.rb', line 8

def initialize(doc_root, port, slides_file, ui)
  @doc_root, @port, @slides_file = doc_root, port, slides_file
  @ui = ui
end

Instance Attribute Details

#doc_rootObject (readonly)

Returns the value of attribute doc_root.



7
8
9
# File 'lib/reveal-ck/commands/print_banner.rb', line 7

def doc_root
  @doc_root
end

#portObject (readonly)

Returns the value of attribute port.



7
8
9
# File 'lib/reveal-ck/commands/print_banner.rb', line 7

def port
  @port
end

#slides_fileObject (readonly)

Returns the value of attribute slides_file.



7
8
9
# File 'lib/reveal-ck/commands/print_banner.rb', line 7

def slides_file
  @slides_file
end

#uiObject (readonly)

Returns the value of attribute ui.



7
8
9
# File 'lib/reveal-ck/commands/print_banner.rb', line 7

def ui
  @ui
end

Instance Method Details

#runObject



13
14
15
16
17
18
19
# File 'lib/reveal-ck/commands/print_banner.rb', line 13

def run
  ui.separator
  ui.message "Serving up slide content in '#{doc_root}/'."
  ui.message "Open your browser to 'http://localhost:#{port}'."
  ui.message 'Press CTRL-C to stop.'
  ui.separator
end