Sha256: e975898620a819e7ba62d259b3adadc78ba52cea594d958cafda77738554f224

Contents?: true

Size: 875 Bytes

Versions: 2

Compression:

Stored size: 875 Bytes

Contents

require 'zip/filesystem'
require 'fileutils'

module Powerpoint
  module Slide
    class Powerpoint::Slide::Intro
      def initialize extract_path, title, subtitile=nil
        template_path = "#{TEMPLATE_PATH}/ppt/slides/slide1.xml"
        xml = File.read template_path

        xml_title = '<a:p><a:r><a:rPr lang="en-US" dirty="0" smtClean="0"/><a:t>' + title.to_s + '</a:t></a:r><a:endParaRPr lang="en-US" dirty="0"/></a:p>'
        xml.gsub!('PRESENTATION_TITLE_PACEHOLDER', xml_title)

        xml_subtitle = '<a:p><a:r><a:rPr lang="en-US" dirty="0" smtClean="0"/><a:t>' + subtitile.to_s+ '</a:t></a:r><a:endParaRPr lang="en-US" dirty="0"/></a:p>'
        xml.gsub!('PRESENTATION_SUBTITLE_PACEHOLDER', xml_subtitle)

        intro_slide_path = "#{extract_path}/ppt/slides/slide1.xml"
        File.open(intro_slide_path, 'w'){ |f| f << xml }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
powerpoint-1.5 lib/powerpoint/slide/intro.rb
powerpoint-1.4 lib/powerpoint/slide/intro.rb