History

Add db_size attribute in doc manifest

Thibaut committed 11 years ago

Commit a59ef1c1 parent 456c4cb3 files · +11 −1Browse files

Showing the changes to lib/docs (1 of 3 files). Show all

Unified · Split

lib/docs/core/manifest.rb+5−0
@@ -16,6 +16,7 @@ module Docs · 15 unmodified lines
1616 def as_json
1717 indexed_docs.map(&:as_json).each do |json|
1818 json[:mtime] = doc_mtime(json)
19+ json[:db_size] = doc_db_size(json)
1920 end
2021 end
2122
@@ -34,5 +35,9 @@ module Docs · 12 unmodified lines
3435 def doc_mtime(doc)
3536 [@store.mtime(doc[:index_path]).to_i, @store.mtime(doc[:db_path]).to_i].max
3637 end
38+
39+ def doc_db_size(doc)
40+ @store.size(doc[:db_path])
41+ end
3742 end
3843 end