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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af8958c780bbbef841f04e8965372dc34d0c29af
4
- data.tar.gz: bc48951dadb1b96090a60bb2655f6d1ebc7f57df
3
+ metadata.gz: 926aa9c0961f2dc726d0daf369783f900a5ec88a
4
+ data.tar.gz: ecd3a9f1a1f6d21e5495b64138fe996f175abeb8
5
5
  SHA512:
6
- metadata.gz: 3e7389b1af0c11bcde4e55b526caa3b95e0d95ac0ad3b80a14a73d18a1c1361527286fa8d8d666b63291d8d1e657fbd9a16e6c0c38c09ca506f459c44dd95c5d
7
- data.tar.gz: 3a7bb836d926972d3b909276f90166a8b7183fbc29391e9a6bdbb3ded42627b165001cadb866b27767c0283a4e48fbb7fdd01397ec1dcf2f6afa4ce3ec9a38ee
6
+ metadata.gz: 8a2e24c7507d1bff6709eca13051caef06e49333983677a0594781f71b20e184fc2753a3bd1a5b4f17643b16d6c3143e0c99b4b15881f1c1e42c76e9b2fb3fa5
7
+ data.tar.gz: ff8d38e94fa24e71e966ff545f535a966b165c8f7267ddfbd24e56e00e0e308a19a382ed27e6b356226bf0424e2ae622d7327d7e73e2776a633fd6afbfadf6cf
@@ -1,3 +1 @@
1
- kpG�-���`Y�S䛯h;��w�ٟGJ����;*����j0FO��/��oR4703���:��
2
- �k>`��p�?ig'�*��]Q�)������?�N�h%
3
- ��s��
1
+ ���%���{fcL#�}�S��zEK����>�$VZl��8��I+�1*�~RЌTa3 �2<3.�*'�Nu�YP�Ms�vuKF�䶇���XŤ!��������1n)T�ua�J`��>�SGW�]�<���/�sH�����[yC�1Ck�9�|Ts�n������=e�^����m��
data.tar.gz.sig CHANGED
Binary file
@@ -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
- xslt = Nokogiri::XSLT(xsl_buffer)
155
- out = xslt.transform(Nokogiri::XML(@doc.to_s))
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.27
4
+ version: 1.2.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file