Sha256: aa7105551c04e96f81007c9c886d0b579693bf92a88fce88093ce12721004a7f

Contents?: true

Size: 571 Bytes

Versions: 2

Compression:

Stored size: 571 Bytes

Contents

require 'zip/filesystem'
require 'fileutils'

module Powerpoint
  class Powerpoint::Relationship
    def initialize extract_path, sllide_number
      xml = '<Relationship Id="rId'+ (sllide_number+666).to_s + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" Target="slides/slide' + sllide_number.to_s + '.xml"/></Relationships>'
      path = "#{extract_path}/ppt/_rels/presentation.xml.rels"
      template = File.read path
      template.gsub!('</Relationships>', 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/relationship.rb
powerpoint-1.4 lib/powerpoint/relationship.rb