Class: Marksman::Converter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(presentation) ⇒ Converter

Returns a new instance of Converter.



9
10
11
# File 'lib/marksman/converter.rb', line 9

def initialize(presentation)
  @presentation = presentation
end

Instance Attribute Details

#presentationObject

Returns the value of attribute presentation.



7
8
9
# File 'lib/marksman/converter.rb', line 7

def presentation
  @presentation
end

#themeObject

Returns the value of attribute theme.



7
8
9
# File 'lib/marksman/converter.rb', line 7

def theme
  @theme
end

Instance Method Details

#write(directory) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/marksman/converter.rb', line 13

def write(directory)
  puts 'Generating HTML...'
  FileUtils.mkdir_p(directory)
  Dir.glob(@presentation.theme.path.join('**/*')).each do |file|
    if File.file? file
      copy_file(Pathname.new(file), directory)
    end
  end
end