History

Remove index_path and db_path from docs manifest

Thibaut Courouble committed 10 years ago

Commit a639aed1 parent e1c02187 files · +16 −14Browse files

Showing the changes to lib/docs (2 of 7 files). Show all

Unified · Split

2 files
  1. lib/docs/core/doc.rb +0 −2
  2. lib/docs/core/manifest.rb +7 −5
lib/docs/core/doc.rb+0−2
@@ -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 end41 end
44 42
lib/docs/core/manifest.rb+7−5
@@ -14,9 +14,11 @@ module Docs · 13 unmodified lines
14 end14 end
15 15
16 def as_json16 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 end22 end
21 end23 end
22 24
@@ -33,11 +35,11 @@ module Docs · 10 unmodified lines
33 end35 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].max38 [@store.mtime(doc.index_path).to_i, @store.mtime(doc.db_path).to_i].max
37 end39 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 end43 end
42 end44 end
43end45end