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, host, slides_file, ui) ⇒ PrintBanner

Returns a new instance of PrintBanner.



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

def initialize(doc_root, port, host, slides_file, ui)
  @doc_root = doc_root
  @port = port
  @host = host
  @slides_file = 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

#hostObject (readonly)

Returns the value of attribute host.



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

def host
  @host
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



16
17
18
19
20
21
22
# File 'lib/reveal-ck/commands/print_banner.rb', line 16

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