Sha256: 253f1189a31db24c9a42150c0b8b94c2ba74ea3a5ac3a59091d9b286ab06cc2a

Contents?: true

Size: 610 Bytes

Versions: 7

Compression:

Stored size: 610 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/spreadbase'
require_relative 'utils_helpers'

include UtilsHelpers

def test_recoding_from_content(file_path)
  content_xml_data = IO.read(file_path)
  document         = SpreadBase::Codecs::OpenDocument12.new.decode_content_xml(content_xml_data)

  with_tempfile do | temp_file |
    document.document_path = temp_file.path
    document.save(prettify: true)

    open_office_document(temp_file.path)
  end
end

if __FILE__ == $PROGRAM_NAME
  file_path = ARGV[0] || raise("Usage: test_recoding_from_content.rb <file>")

  test_recoding_from_content(file_path)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spreadbase-0.6.0 utils/test_recoding_from_content.rb
spreadbase-0.5.0 utils/test_recoding_from_content.rb
spreadbase-0.4.0 utils/test_recoding_from_content.rb
spreadbase-0.3.0 utils/test_recoding_from_content.rb
spreadbase-0.2.1 utils/test_recoding_from_content.rb
spreadbase-0.2.0 utils/test_recoding_from_content.rb
spreadbase-0.1.4 utils/test_recoding_from_content.rb