dynarex-blog 0.3.10 → 0.3.12
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.
- data/lib/dynarex-blog.rb +7 -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',
|
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
|