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 +4 -4
- data/changelog.md +4 -1
- data/lib/docstache/document.rb +10 -6
- data/lib/docstache/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1451cbaae9c754a84757afa5167f5051ed01eadb
|
4
|
+
data.tar.gz: 943e2cd4f3fccd2cdc6e66aaa8b935ea68673e55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
* [
|
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
|
data/lib/docstache/document.rb
CHANGED
@@ -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
|
-
|
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
|
}
|
data/lib/docstache/version.rb
CHANGED