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
16 def as_json16 def as_json
17 indexed_docs.map(&:as_json).each do |json|17 indexed_docs.map(&:as_json).each do |json|
18 json[:mtime] = doc_mtime(json)18 json[:mtime] = doc_mtime(json)
19 json[:db_size] = doc_db_size(json)
19 end20 end
20 end21 end
21 22
@@ -34,5 +35,9 @@ module Docs · 12 unmodified lines
34 def doc_mtime(doc)35 def doc_mtime(doc)
35 [@store.mtime(doc[:index_path]).to_i, @store.mtime(doc[:db_path]).to_i].max36 [@store.mtime(doc[:index_path]).to_i, @store.mtime(doc[:db_path]).to_i].max
36 end37 end
38
39 def doc_db_size(doc)
40 @store.size(doc[:db_path])
41 end
37 end42 end
38end43end