Skip to content

Commit 4628bbd

Browse files
authored
Merge branch 'master' into patch-1
2 parents 18250f6 + fd1576e commit 4628bbd

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A ruby library/gem for interacting with `.docx` files. currently capabilities in
88

99
Requires ruby (tested with 2.1.1)
1010

11-
gem 'docx', '~> 0.2.07', :require => ["docx"]
11+
gem 'docx', '~> 0.3.0'
1212

1313
### Reading
1414

docx.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
1212
s.homepage = 'https://github.com/chrahunt/docx'
1313
s.files = Dir["README.md", "LICENSE.md", "lib/**/*.rb"]
1414

15-
s.add_dependency 'nokogiri', '>= 1.10.4'
16-
s.add_dependency 'rubyzip', '~> 1.2', '>= 1.2.1'
15+
s.add_dependency 'nokogiri', '~> 1.10', '>= 1.10.4'
16+
s.add_dependency 'rubyzip', '~> 2.0'
1717

1818
s.add_development_dependency 'rspec', '~> 3.7'
19-
s.add_development_dependency 'rake', '~> 12.3'
19+
s.add_development_dependency 'rake', '~> 13.0'
2020
end

lib/docx/document.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def self.open(path, &block)
5151
end
5252

5353
def paragraphs
54-
@doc.xpath('//w:document//w:body//w:p').map { |p_node| parse_paragraph_from p_node }
54+
@doc.xpath('//w:document//w:body/w:p').map { |p_node| parse_paragraph_from p_node }
5555
end
5656

5757
def bookmarks

spec/docx/document_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@
8989
it "should read embedded links" do
9090
expect(@doc.tables[0].columns[1].cells[1].text).to match(/^Directive/)
9191
end
92+
93+
describe '#paragraphs' do
94+
it 'should not grabs paragraphs in the tables' do
95+
expect(@doc.paragraphs.map(&:text)).to_not include("Second table")
96+
end
97+
end
9298
end
9399

94100
describe 'editing' do

0 commit comments

Comments
 (0)