open_xml 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b75c6c22557762c26b167295be1afa1e6598abc1
4
- data.tar.gz: e149a88a547038884e322ddb66f5dea018591027
3
+ metadata.gz: 02c61739d67753b349cd2f5f2cb771ef2823596a
4
+ data.tar.gz: a094993b8dd8599300a4b2a116cad7c24bbf6a66
5
5
  SHA512:
6
- metadata.gz: 071829499a303aeeb9d536e1ee07d8f1f9537b207fd17352a5a350cae341a8c97d715a8d5b88e39542f2cb04f65386804f7803c91f1e0696ee2257a181a86ed6
7
- data.tar.gz: f76afcba14892b117bbcf1ff0d2d03da1ff029e046bd3a1952c690432aa4a423c774719ae92fa3e5df2256cffcb7ef7e72095e948175bec3e4d733c7257873cf
6
+ metadata.gz: 981c242d1e3858a7b86f09431399c81b7edf6eeba645587472c2a2bb6b9104aaf4097eb008505f54f24dd6d0783493f6b9e44bd72b3fc9f3bc449dc704ac294d
7
+ data.tar.gz: b2047a76f0d9f3bcb22374827015ffef1ffe37297d51ab8a85a71c5067bbcf2053e906da246ff75367695bb0fcebe3e9ce7ad4b5d982e82bca8bfc1763cdb530
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.1.1
2
+ * When provided content is empty, the parent paragraph node of the
3
+ keyword is always removed.
4
+
1
5
  ## v0.1.0
2
6
  * API Change!!! the template document is now created once and the data
3
7
  is passed in through the process call. This allows you to loop over
@@ -59,13 +59,14 @@ module OpenXml
59
59
  node.remove
60
60
  else
61
61
  node.content = node.content.gsub(key, values.first.to_s) if values.first
62
+ node.parent.parent.remove if value[:text].to_s.empty?
62
63
  end
63
64
  end
64
65
 
65
66
  def process_html(node, key, value, doc)
66
67
  new_node = create_chunk_file(key, value, doc)
67
68
  node.parent.parent.add_next_sibling new_node
68
- node.remove
69
+ node.parent.parent.remove
69
70
  end
70
71
 
71
72
  def create_chunk_file(key, content, doc)
@@ -1,3 +1,3 @@
1
1
  module OpenXml
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Espejo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-25 00:00:00.000000000 Z
11
+ date: 2014-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler