docstache 0.3.0 → 0.3.1

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: 64b050be7b5b3314f3970e3cf195dd436c18bbb8
4
- data.tar.gz: ca44b9c1d7f1e2881edb09cac633a759b538412d
3
+ metadata.gz: 1451cbaae9c754a84757afa5167f5051ed01eadb
4
+ data.tar.gz: 943e2cd4f3fccd2cdc6e66aaa8b935ea68673e55
5
5
  SHA512:
6
- metadata.gz: c363eed61fd680c394a7fd47db76f2f1a134d1606bddc2645be3ca36ec09211689b6baf6318b7dcd6a0f676817d0d8e2cbee5b209560e1dc8f363f0dd495fda1
7
- data.tar.gz: 2369c45c26d8e3613277e164d76c9ff17554aaa1f37c8b9251364db393565c69897e2889c29d0332d47a886482901edc41723657d33159c74b2a543a20de3aa0
6
+ metadata.gz: e0e97aec0aeb31dd261f23647a9b0e45014e2fac0b4050d18c2aa151077e048278b0f3cb87bdf0ec3210a8976e21df44ab543cf29282309461336dc2ee52d423
7
+ data.tar.gz: 7c0addc07de012c24ada05a6a30ba2301293db56bf894e1b463684bba0657d0dd24d5cabbcf4580793d9c0b7977647ebbde59720ba95b151ea3f1ba81d3ab954
data/changelog.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1
4
+ * [2228ba727f8a2e3705fe223ce02b5e760c935572] Added `Document#unusable_tags` to list out tags that are not able to be interpolated due to being split across tags in the Document's XML
5
+
3
6
  ## 0.3.0
4
- * [???] Added ability to do tag interpolation in headers and footers. The header/footer used is the header or footer from the first document passed into `Document.new()`
7
+ * [c841078f7d340c18323f05f0785e75cd560eed2c] Added ability to do tag interpolation in headers and footers. The header/footer used is the header or footer from the first document passed into `Document.new()`
5
8
 
6
9
  ## 0.2.1
7
10
  * [25b4c2e9e3dcb19b6fe9a255fec2c2bfd92029a6] Fixed a bug where a tag with regular expression characters could not be fixed with the `fix_errors` method
@@ -29,6 +29,15 @@ module Docstache
29
29
  }
30
30
  end
31
31
 
32
+ def unusable_tags
33
+ unusable_tags = tags
34
+ usable_tags.each do |usable_tag|
35
+ index = missing_tags.index(usable_tag)
36
+ missing_tags.delete_at(index) if index
37
+ end
38
+ return unusable_tags
39
+ end
40
+
32
41
  def fix_errors
33
42
  problem_paragraphs.each do |p|
34
43
  flatten_paragraph(p) if p
@@ -68,12 +77,7 @@ module Docstache
68
77
  private
69
78
 
70
79
  def problem_paragraphs
71
- missing_tags = tags
72
- usable_tags.each do |usable_tag|
73
- index = missing_tags.index(usable_tag)
74
- missing_tags.delete_at(index) if index
75
- end
76
- missing_tags.flat_map { |tag|
80
+ unusable_tags.flat_map { |tag|
77
81
  @documents.values.inject([]) { |tags, document|
78
82
  tags + document.css('w|p').select {|t| t.text =~ /#{Regexp.escape(tag)}/}
79
83
  }
@@ -1,3 +1,3 @@
1
1
  module Docstache
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docstache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Cosgrove