isodoc 0.0.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62b1e9c84a6b13a667a255149db636d52c1075f4
4
- data.tar.gz: f6531013e9bf1b3bef0aa9888b20a9cda2ee47ba
3
+ metadata.gz: '0679d357232b392889d42dff130949b390726397'
4
+ data.tar.gz: 1c5eb12db5f8c9b1cb29802a5a538bf66dbb8ea9
5
5
  SHA512:
6
- metadata.gz: 56defb8c428ce424370ed5ec757347c7d21a12f13ff1b9b41d5d7d1d041d88c7ecda192092c61ce76dca02c05f6c5fcba857c18d2da0b010490289219f8cc66e
7
- data.tar.gz: 3e40a1565e00ee6f191ea08b0a59f5f5db5c2c49cac7ac6efae1c69367cf4de98a505d580a4a782dfde04c391a65fee42134c54a6c2c3fd1e56194fa34fc4e2b
6
+ metadata.gz: e4fe6d944d1cd243db21b7faca859d7658f22fa8ae5076d31920ef3f979e5804e10a57da7073cbf54a2366fa9b4ac0261aa3289cb146905ebf9e74c7c13e6808
7
+ data.tar.gz: 1d0fcdd12674101553cac3a3834a787179000933a22ce07365c6c820557d4c763c17060d2e9cde04039d86a18bc948f6a35bf5975896de500474a5ad6637f9a0
@@ -34,14 +34,14 @@ module IsoDoc
34
34
  dt = key.add_child("<dt></dt>").first
35
35
  dd = key.add_child("<dd></dd>").first
36
36
  fnref.parent = dt
37
- aside.xpath(".//p").each do |a|
37
+ aside.xpath(".//p").each do |a|
38
38
  a.delete("class")
39
- a.parent = dd
39
+ a.parent = dd
40
40
  end
41
41
  end
42
42
 
43
43
  def figure_cleanup(docxml)
44
- # move footnotes into key, and get rid of footnote reference
44
+ # move footnotes into key, and get rid of footnote reference
45
45
  # since it is in diagram
46
46
  docxml.xpath(FIGURE_WITH_FOOTNOTES).each do |f|
47
47
  key = figure_get_or_make_dl(f)
@@ -68,9 +68,7 @@ module IsoDoc
68
68
  docxml.xpath('//div/span[@style="MsoCommentReference"]').
69
69
  each do |x|
70
70
  prev = x.previous_element
71
- if !prev.nil?
72
- x.parent = prev
73
- end
71
+ x.parent = prev unless prev.nil?
74
72
  end
75
73
  docxml
76
74
  end
@@ -79,9 +77,7 @@ module IsoDoc
79
77
  docxml.xpath('//div[@style="mso-element:footnote"]/a').
80
78
  each do |x|
81
79
  n = x.next_element
82
- if !n.nil?
83
- n.children.first.add_previous_sibling(x.remove)
84
- end
80
+ n&.children&.first&.add_previous_sibling(x.remove)
85
81
  end
86
82
  docxml
87
83
  end
@@ -89,7 +85,7 @@ module IsoDoc
89
85
  def merge_fnref_into_fn_text(a)
90
86
  fn = a.at('.//a[@class="zzFootnote"]')
91
87
  n = fn.next_element
92
- n.children.first.add_previous_sibling(fn.remove) unless n.nil?
88
+ n&.children&.first&.add_previous_sibling(fn.remove)
93
89
  end
94
90
 
95
91
  TABLE_WITH_FOOTNOTES = "//table[descendant::aside]".freeze
@@ -118,9 +114,7 @@ module IsoDoc
118
114
  tfoot = t.at(".//tfoot")
119
115
  else
120
116
  # nuke its bottom border
121
- tfoot.xpath(".//td | .//th").each do |td|
122
- remove_bottom_border(td)
123
- end
117
+ tfoot.xpath(".//td | .//th").each { |td| remove_bottom_border(td) }
124
118
  end
125
119
  tfoot
126
120
  end
@@ -129,7 +123,7 @@ module IsoDoc
129
123
  # how many columns in the table?
130
124
  cols = 0
131
125
  t.at(".//tr").xpath("./td | ./th").each do |td|
132
- cols += ( td["colspan"] ? td["colspan"].to_i : 1 )
126
+ cols += (td["colspan"] ? td["colspan"].to_i : 1)
133
127
  end
134
128
  style = %{border-top:0pt;mso-border-top-alt:0pt;
135
129
  border-bottom:#{SW} 1.5pt;mso-border-bottom-alt:#{SW} 1.5pt;}
@@ -33,8 +33,7 @@ module IsoDoc
33
33
  title = docxml.at("//*[local-name() = 'head']/*[local-name() = 'title']")
34
34
  head = docxml.at("//*[local-name() = 'head']")
35
35
  css = htmlstylesheet
36
- if title.nil?
37
- head.children.first.add_previous_sibling css
36
+ if title.nil? then head.children.first.add_previous_sibling css
38
37
  else
39
38
  title.add_next_sibling css
40
39
  end
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "0.0.1".freeze
2
+ VERSION = "0.4.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.