Showing the changes to lib/docs (2 of 7 files). Show all
Unified · Split
| @@ -37,8 +37,6 @@ module Docs · 36 unmodified lines | |||
| 37 | slug: slug, | 37 | slug: slug, |
| 38 | type: type, | 38 | type: type, |
| 39 | release: release, | 39 | release: release, |
| 40 | index_path: index_path, | ||
| 41 | db_path: db_path, | ||
| 42 | links: links } | 40 | links: links } |
| 43 | end | 41 | end |
| 44 | 42 | ||
| @@ -14,9 +14,11 @@ module Docs · 13 unmodified lines | |||
| 14 | end | 14 | end |
| 15 | 15 | ||
| 16 | def as_json | 16 | def as_json |
| 17 | indexed_docs.map(&:as_json).each do |json| | 17 | indexed_docs.map do |doc| |
| 18 | json[:mtime] = doc_mtime(json) | 18 | json = doc.as_json |
| 19 | json[:db_size] = doc_db_size(json) | 19 | json[:mtime] = doc_mtime(doc) |
| 20 | json[:db_size] = doc_db_size(doc) | ||
| 21 | json | ||
| 20 | end | 22 | end |
| 21 | end | 23 | end |
| 22 | 24 | ||
| @@ -33,11 +35,11 @@ module Docs · 10 unmodified lines | |||
| 33 | end | 35 | end |
| 34 | 36 | ||
| 35 | def doc_mtime(doc) | 37 | def doc_mtime(doc) |
| 36 | [@store.mtime(doc[:index_path]).to_i, @store.mtime(doc[:db_path]).to_i].max | 38 | [@store.mtime(doc.index_path).to_i, @store.mtime(doc.db_path).to_i].max |
| 37 | end | 39 | end |
| 38 | 40 | ||
| 39 | def doc_db_size(doc) | 41 | def doc_db_size(doc) |
| 40 | @store.size(doc[:db_path]) | 42 | @store.size(doc.db_path) |
| 41 | end | 43 | end |
| 42 | end | 44 | end |
| 43 | end | 45 | end |