Class: GitPresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/git_presenter.rb

Defined Under Namespace

Classes: Controller, Presentation, Slide

Instance Method Summary collapse

Constructor Details

#initialize(current_dir, interactive = true) ⇒ GitPresenter

Returns a new instance of GitPresenter.



11
12
13
14
# File 'lib/git_presenter.rb', line 11

def initialize(current_dir, interactive=true)
  @controller = Controller.new(current_dir)
  @interactive = interactive
end

Instance Method Details

#execute(command) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/git_presenter.rb', line 16

def execute(command)
  if command == 'init'
    @controller.initialise_presentation
  elsif command == 'start'
    @presentation = @controller.start_presentation
    if @interactive
      enter_run_loop
    end
  elsif command == 'update'
    @controller.update_presentation
  else
    puts @presentation.execute(command)
  end
  @presentation
end