dynarex 1.1.31 → 1.1.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/dynarex.rb +11 -1
  2. metadata +2 -2
@@ -297,12 +297,22 @@ EOF
297
297
 
298
298
  xslif = Rexle.new("<xsl:if test='position() &lt; #{h[:limit]}'/>").root
299
299
  e2.add xslif.root
300
+
301
+ pubdate = Rexle.new("<pubDate><xsl:value-of select='pubDate'></xsl:value-of></pubDate>").root
302
+ new_item.add pubdate
300
303
  xslif.add new_item
301
304
 
302
305
  xslt = doc.xml
303
306
  end
304
307
 
305
- xml = Rexslt.new(xslt, self.to_xml).to_s
308
+ doc = self.to_doc
309
+ doc.root.xpath('records/*').each do |x|
310
+ raw_dt = DateTime.parse x.attributes[:created]
311
+ dt = raw_dt.strftime("%a, %d %b %Y %H:%M:%S %z")
312
+ x.add Rexle::Element.new('pubDate').add_text dt
313
+ end
314
+
315
+ xml = Rexslt.new(xslt, doc.xml).to_s
306
316
  Rexle.new("<rss version='2.0'>%s</rss>" % xml).xml(pretty: true)
307
317
  end
308
318
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.31
5
+ version: 1.1.32
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Robertson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-06-26 00:00:00 Z
13
+ date: 2012-06-28 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rexle