dynarex-blog 0.3.10 → 0.3.12

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-blog.rb +7 -2
  2. metadata +1 -1
data/lib/dynarex-blog.rb CHANGED
@@ -131,9 +131,14 @@ class DynarexBlog
131
131
  @hc_lookup.refresh(@current_lookup) # refresh to maintain @current_lookup in the cache
132
132
  end
133
133
 
134
+ total_records = XPath.first(doc.root, 'count(records/entry)')
135
+ total_pages, remainder = %w(/ %).map {|x| total_records.send x, 10}
136
+ total_pages += 1 if remainder > 0
137
+
134
138
  [
135
- ['total_records', XPath.first(doc.root, 'count(records/entry)')],
136
- ['page_number', number]
139
+ ['total_records', total_records],
140
+ ['page_number', number],
141
+ ['total_pages', total_pages]
137
142
  ].each do |name, text|
138
143
  r.root.elements['summary'].add Element.new(name).add_text(text.to_s)
139
144
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex-blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors: []
7
7