Sha256: 3815b00b3d24b916fabe3f389b4d6800a4a03db5d79e6e9e3be8193c3ff87e4b

Contents?: true

Size: 507 Bytes

Versions: 2

Compression:

Stored size: 507 Bytes

Contents

require 'zip/filesystem'
require 'fileutils'

module Powerpoint
  class Powerpoint::ContentType
    def initialize extract_path, sllide_number
      xml = '<Override PartName="/ppt/slides/slide' + sllide_number.to_s + '.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"/></Types>'
      path = "#{extract_path}/[Content_Types].xml"
      template = File.read path
      template.gsub!('</Types>', xml)
      File.open(path, 'w'){ |f| f << template }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
powerpoint-1.5 lib/powerpoint/content_type.rb
powerpoint-1.4 lib/powerpoint/content_type.rb