Class: Slideit::Container

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

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}) ⇒ Container

Returns a new instance of Container.



7
8
9
10
11
# File 'lib/slideit/container.rb', line 7

def initialize(file, options = {})
  @file = file
  @options = options
  prepare
end

Instance Method Details

#startObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/slideit/container.rb', line 13

def start
  if @server
    file_name = File.basename(@file)
    url = "http://localhost:#{@port}/#{file_name}"
    if @options[:pdf]
      url << "?print-pdf"
    end
    Thread.new {
      puts "Just waiting for 1 second...\n"
      sleep 1
      system "open #{url}"
    }

    @server.start
  end
end