dynarex 1.2.27 → 1.2.28
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 +4 -4
- checksums.yaml.gz.sig +1 -3
- data.tar.gz.sig +0 -0
- data/lib/dynarex.rb +37 -9
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 926aa9c0961f2dc726d0daf369783f900a5ec88a
|
|
4
|
+
data.tar.gz: ecd3a9f1a1f6d21e5495b64138fe996f175abeb8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8a2e24c7507d1bff6709eca13051caef06e49333983677a0594781f71b20e184fc2753a3bd1a5b4f17643b16d6c3143e0c99b4b15881f1c1e42c76e9b2fb3fa5
|
|
7
|
+
data.tar.gz: ff8d38e94fa24e71e966ff545f535a966b165c8f7267ddfbd24e56e00e0e308a19a382ed27e6b356226bf0424e2ae622d7327d7e73e2776a633fd6afbfadf6cf
|
checksums.yaml.gz.sig
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/dynarex.rb
CHANGED
|
@@ -144,18 +144,45 @@ EOF
|
|
|
144
144
|
|
|
145
145
|
#format_mask = XPath.first(@doc.root, 'summary/format_mask/text()').to_s
|
|
146
146
|
#format_mask = @doc.root.element('summary/format_mask/text()')
|
|
147
|
-
format_mask = self.format_mask
|
|
148
|
-
format_mask.gsub!(/\[[^!\]]+\]/) {|x| x[1] }
|
|
149
|
-
xslt_format = format_mask.gsub(/\s(?=\[!\w+\])/,'<xsl:text> </xsl:text>')
|
|
150
|
-
.gsub(/\[!(\w+)\]/, '<xsl:value-of select="\1"/>')
|
|
151
|
-
|
|
152
|
-
xsl_buffer.sub!(/\[!regex_values\]/, xslt_format)
|
|
153
147
|
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
if self.summary[:rawdoc_type] == 'rowx' then
|
|
149
|
+
a = self.fields.map do |field|
|
|
150
|
+
"<xsl:if test=\"%s != ''\">
|
|
151
|
+
<xsl:text>\n</xsl:text>%s: <xsl:value-of select='%s'/>
|
|
152
|
+
</xsl:if>" % ([field]*3)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
xslt_format = a.join
|
|
156
|
+
|
|
157
|
+
xsl_buffer.sub!(/\[!regex_values\]/, xslt_format)
|
|
158
|
+
xslt = Nokogiri::XSLT(xsl_buffer)
|
|
159
|
+
out = xslt.transform(Nokogiri::XML(@doc.to_s))
|
|
160
|
+
|
|
161
|
+
declaration = %Q(<?dynarex schema="%s"?>\n--+) % self.schema
|
|
162
|
+
declaration + out.text
|
|
163
|
+
|
|
164
|
+
else
|
|
165
|
+
|
|
166
|
+
format_mask = self.format_mask
|
|
167
|
+
format_mask.gsub!(/\[[^!\]]+\]/) {|x| x[1] }
|
|
168
|
+
xslt_format = format_mask.gsub(/\s(?=\[!\w+\])/,'<xsl:text> </xsl:text>')
|
|
169
|
+
.gsub(/\[!(\w+)\]/, '<xsl:value-of select="\1"/>')
|
|
170
|
+
|
|
171
|
+
xsl_buffer.sub!(/\[!regex_values\]/, xslt_format)
|
|
172
|
+
xslt = Nokogiri::XSLT(xsl_buffer)
|
|
173
|
+
|
|
174
|
+
out = xslt.transform(Nokogiri::XML(@doc.to_s))
|
|
175
|
+
declaration = %Q(<?dynarex schema="%s" format_mask="%s"?>\n) %
|
|
176
|
+
[self.schema, self.format_mask]
|
|
177
|
+
out.text
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
#xsl_buffer.sub!(/\[!regex_values\]/, xslt_format)
|
|
181
|
+
#xslt = Nokogiri::XSLT(xsl_buffer)
|
|
182
|
+
#out = xslt.transform(Nokogiri::XML(@doc.to_s))
|
|
156
183
|
#jr250811 puts 'xsl_buffer: ' + xsl_buffer
|
|
157
184
|
#jr250811 puts 'doc_to_s: ' + @doc.to_s
|
|
158
|
-
out.text
|
|
185
|
+
#out.text
|
|
159
186
|
#jr231211 Rexslt.new(xsl_buffer, @doc.to_s).to_s
|
|
160
187
|
|
|
161
188
|
end
|
|
@@ -525,6 +552,7 @@ EOF
|
|
|
525
552
|
|
|
526
553
|
when '--+'
|
|
527
554
|
|
|
555
|
+
self.summary[:rawdoc_type] = 'rowx'
|
|
528
556
|
raw_lines.shift
|
|
529
557
|
|
|
530
558
|
key = raw_lines.first[/^[^:]+/]
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|