Commit 99724152 authored by Michael Witrant's avatar Michael Witrant

dump xml

parent 356222eb
...@@ -3,3 +3,4 @@ source "http://rubygems.org" ...@@ -3,3 +3,4 @@ source "http://rubygems.org"
gem "nokogiri" gem "nokogiri"
gem "htmldiff" gem "htmldiff"
gem "zippy" gem "zippy"
gem "clik"
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
clik (0.1.0)
htmldiff (0.0.1) htmldiff (0.0.1)
nokogiri (1.5.9) nokogiri (1.5.9)
rubyzip (0.9.9) rubyzip (0.9.9)
...@@ -11,6 +12,7 @@ PLATFORMS ...@@ -11,6 +12,7 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
clik
htmldiff htmldiff
nokogiri nokogiri
zippy zippy
...@@ -3,7 +3,11 @@ ...@@ -3,7 +3,11 @@
require 'rubygems' require 'rubygems'
require 'bundler/setup' require 'bundler/setup'
require 'zippy' require 'zippy'
require 'clik'
xml_dump_path = nil
cli '--xml-dump' => lambda { |path| xml_dump_path = path }
opendocument_path = ARGV.first opendocument_path = ARGV.first
raise "usage: #$0 <OpenDocument file>" unless opendocument_path raise "usage: #$0 <OpenDocument file>" unless opendocument_path
...@@ -13,4 +17,8 @@ Zippy.open(opendocument_path) do |zip| ...@@ -13,4 +17,8 @@ Zippy.open(opendocument_path) do |zip|
xml = zip['content.xml'] xml = zip['content.xml']
end end
if xml_dump_path
File.open(xml_dump_path, "w") { |f| f.write xml }
end
puts xml.size puts xml.size
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment