Class: InfuseDSL

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/infuse/infuse_dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInfuseDSL

Returns a new instance of InfuseDSL.



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

def initialize
  @slides = []

  @template_dir = File.dirname(__FILE__) + "/themes/plain/"
  @operashow_templates = {
      :header => "operashow-header.html.erb",
      :footer => "operashow-footer.html.erb",
      :slide => "slide.html.erb",
      :title_slide => "title-page.html.erb"
  }

  @html_templates = {
      :header => "header.html.erb",
      :footer => "footer.html.erb",
      :slide => "slide.html.erb",
      :title_slide => "title-page.html.erb"
  }
end

Instance Attribute Details

#authorObject

Specified



8
9
10
# File 'lib/infuse/infuse_dsl.rb', line 8

def author
  @author
end

#backgroundObject

Specified



8
9
10
# File 'lib/infuse/infuse_dsl.rb', line 8

def background
  @background
end

#companyObject

Specified



8
9
10
# File 'lib/infuse/infuse_dsl.rb', line 8

def company
  @company
end

Specified



8
9
10
# File 'lib/infuse/infuse_dsl.rb', line 8

def copyright
  @copyright
end

#formatObject

Specified



8
9
10
# File 'lib/infuse/infuse_dsl.rb', line 8

def format
  @format
end

#output_dirObject

Derived



10
11
12
# File 'lib/infuse/infuse_dsl.rb', line 10

def output_dir
  @output_dir
end

#slidesObject

Specified



8
9
10
# File 'lib/infuse/infuse_dsl.rb', line 8

def slides
  @slides
end

#source_fileObject

Derived



10
11
12
# File 'lib/infuse/infuse_dsl.rb', line 10

def source_file
  @source_file
end

#subtitleObject

Specified



8
9
10
# File 'lib/infuse/infuse_dsl.rb', line 8

def subtitle
  @subtitle
end

#titleObject

Specified



8
9
10
# File 'lib/infuse/infuse_dsl.rb', line 8

def title
  @title
end

#transitionObject

Specified



8
9
10
# File 'lib/infuse/infuse_dsl.rb', line 8

def transition
  @transition
end

Instance Method Details

#add_slide(slide) ⇒ Object



31
32
33
# File 'lib/infuse/infuse_dsl.rb', line 31

def add_slide(slide)
  @slides << slide
end

#runObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/infuse/infuse_dsl.rb', line 35

def run
  html_output = generate_slideshow(@html_templates)
  operashow_output = generate_slideshow(@operashow_templates)

  prepare_target_dir

  begin
    File.new(output_file, "w").puts(html_output)
    File.new(output_file('operashow-'), "w").puts(operashow_output)
  rescue
    puts $!
    exit
  end

end