Class: InfuseDSL
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#background ⇒ Object
Returns the value of attribute background.
-
#company ⇒ Object
Returns the value of attribute company.
-
#copyright ⇒ Object
Returns the value of attribute copyright.
-
#format ⇒ Object
Returns the value of attribute format.
-
#output_dir ⇒ Object
Derived.
-
#slides ⇒ Object
Returns the value of attribute slides.
-
#source_file ⇒ Object
Derived.
-
#subtitle ⇒ Object
Returns the value of attribute subtitle.
-
#title ⇒ Object
Returns the value of attribute title.
-
#transition ⇒ Object
Returns the value of attribute transition.
Instance Method Summary collapse
- #add_slide(slide) ⇒ Object
-
#initialize ⇒ InfuseDSL
constructor
A new instance of InfuseDSL.
- #run ⇒ Object
Constructor Details
#initialize ⇒ InfuseDSL
Returns a new instance of InfuseDSL.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/infuse/infuse_dsl.rb', line 12 def initialize @slides = [] @title = @author = @company = @copyright = @subtitle = @background = @format = @transition = "" @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
#author ⇒ Object
Returns the value of attribute author.
7 8 9 |
# File 'lib/infuse/infuse_dsl.rb', line 7 def @author end |
#background ⇒ Object
Returns the value of attribute background.
8 9 10 |
# File 'lib/infuse/infuse_dsl.rb', line 8 def background @background end |
#company ⇒ Object
Returns the value of attribute company.
7 8 9 |
# File 'lib/infuse/infuse_dsl.rb', line 7 def company @company end |
#copyright ⇒ Object
Returns the value of attribute copyright.
7 8 9 |
# File 'lib/infuse/infuse_dsl.rb', line 7 def copyright @copyright end |
#format ⇒ Object
Returns the value of attribute format.
8 9 10 |
# File 'lib/infuse/infuse_dsl.rb', line 8 def format @format end |
#output_dir ⇒ Object
Derived
10 11 12 |
# File 'lib/infuse/infuse_dsl.rb', line 10 def output_dir @output_dir end |
#slides ⇒ Object
Returns the value of attribute slides.
7 8 9 |
# File 'lib/infuse/infuse_dsl.rb', line 7 def @slides end |
#source_file ⇒ Object
Derived
10 11 12 |
# File 'lib/infuse/infuse_dsl.rb', line 10 def source_file @source_file end |
#subtitle ⇒ Object
Returns the value of attribute subtitle.
7 8 9 |
# File 'lib/infuse/infuse_dsl.rb', line 7 def subtitle @subtitle end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/infuse/infuse_dsl.rb', line 7 def title @title end |
#transition ⇒ Object
Returns the value of attribute transition.
8 9 10 |
# File 'lib/infuse/infuse_dsl.rb', line 8 def transition @transition end |
Instance Method Details
#add_slide(slide) ⇒ Object
32 33 34 |
# File 'lib/infuse/infuse_dsl.rb', line 32 def () @slides << end |
#run ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/infuse/infuse_dsl.rb', line 36 def run html_output = (@html_templates) operashow_output = (@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 |