diff --git a/Gemfile b/Gemfile index 6ccc14fce09ec6daac174c9351603e0944cc0414..fc55e7ddc8c948d06cec7271c056097534ed27bb 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,4 @@ source "http://rubygems.org" gem "nokogiri" gem "htmldiff" +gem "zippy" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000000000000000000000000000000000000..9ce805e75e3d815a0f2d634dd0f994d4dc8e6fcc --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,16 @@ +GEM + remote: http://rubygems.org/ + specs: + htmldiff (0.0.1) + nokogiri (1.5.9) + rubyzip (0.9.9) + zippy (0.2.1) + rubyzip (>= 0.9.1) + +PLATFORMS + ruby + +DEPENDENCIES + htmldiff + nokogiri + zippy diff --git a/extract_amendments.rb b/extract_amendments.rb new file mode 100755 index 0000000000000000000000000000000000000000..5b1fae457b0fd923458dfeb5eab68fd22ed85229 --- /dev/null +++ b/extract_amendments.rb @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby + +require 'rubygems' +require 'bundler/setup' +require 'zippy' + + +opendocument_path = ARGV.first +raise "usage: #$0 " unless opendocument_path + +xml = nil +Zippy.open(opendocument_path) do |zip| + xml = zip['content.xml'] +end + +puts xml.size