Skip to content

Instantly share code, notes, and snippets.

@bitops
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitops/9a37afab4cc2414cd66b to your computer and use it in GitHub Desktop.
Save bitops/9a37afab4cc2414cd66b to your computer and use it in GitHub Desktop.
docs and stuff
# omg
require 'bundler/setup'
require 'docx'
f = File.expand_path(File.join(File.dirname(__FILE__), "baz.docx"))
if File.exists? f
puts "It lives"
end
# Create a Docx::Document object for our existing docx file
doc = Docx::Document.open(f)
# Retrieve and display paragraphs
doc.paragraphs.each do |p|
puts p
end
source "http://rubygems.org/"
ruby "2.1.1"
gem 'docx', '~> 0.2.03'
GEM
remote: http://rubygems.org/
specs:
docx (0.2.03)
nokogiri (~> 1.5)
rubyzip (~> 0.9)
mini_portile (0.6.0)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
rubyzip (0.9.9)
PLATFORMS
ruby
DEPENDENCIES
docx (~> 0.2.03)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment