Class: RevealCK::Builders::CreateSlidesHtml

Inherits:
CreationTask show all
Defined in:
lib/reveal-ck/builders/create_slides_html.rb

Overview

Given a slides_file, a Rake application, and a place where the transformed slides file should end up, this class knows how to work with Rake and create the slides.html.

Instance Attribute Summary collapse

Attributes inherited from CreationTask

#application, #things_to_create

Instance Method Summary collapse

Methods inherited from CreationTask

#name, #prepare

Methods included from RakeAware

#copy_file, #create_directory, #task

Methods included from Retrieve

included, #retrieve

Constructor Details

#initialize(args) ⇒ CreateSlidesHtml

Returns a new instance of CreateSlidesHtml.



12
13
14
15
16
17
# File 'lib/reveal-ck/builders/create_slides_html.rb', line 12

def initialize(args)
  @slides_file = retrieve(:slides_file, args)
  @output_dir = retrieve(:output_dir, args)
  @config = retrieve(:config, args)
  super
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



10
11
12
# File 'lib/reveal-ck/builders/create_slides_html.rb', line 10

def config
  @config
end

#output_dirObject (readonly)

Returns the value of attribute output_dir.



10
11
12
# File 'lib/reveal-ck/builders/create_slides_html.rb', line 10

def output_dir
  @output_dir
end

#slides_fileObject (readonly)

Returns the value of attribute slides_file.



10
11
12
# File 'lib/reveal-ck/builders/create_slides_html.rb', line 10

def slides_file
  @slides_file
end

Instance Method Details

#setupObject



19
20
21
22
23
24
25
26
27
# File 'lib/reveal-ck/builders/create_slides_html.rb', line 19

def setup
  slides_html_file = "#{output_dir}/slides.html"
  task(slides_html_file) do
    File.open(slides_html_file, 'w') do |slides_html|
      slides_html.puts(presentation_html)
    end
  end
  things_to_create.add(slides_html_file)
end