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
3737 slug: slug,
3838 type: type,
3939 release: release,
40− index_path: index_path,
41− db_path: db_path,
4240 links: links }
4341 end
4442
lib/docs/core/manifest.rb+7−5
@@ -14,9 +14,11 @@ module Docs · 13 unmodified lines
1414 end
1515
1616 def as_json
17− indexed_docs.map(&:as_json).each do |json|
18− json[:mtime] = doc_mtime(json)
19− json[:db_size] = doc_db_size(json)
17+ indexed_docs.map do |doc|
18+ json = doc.as_json
19+ json[:mtime] = doc_mtime(doc)
20+ json[:db_size] = doc_db_size(doc)
21+ json
2022 end
2123 end
2224
@@ -33,11 +35,11 @@ module Docs · 10 unmodified lines
3335 end
3436
3537 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
3739 end
3840
3941 def doc_db_size(doc)
40− @store.size(doc[:db_path])
42+ @store.size(doc.db_path)
4143 end
4244 end
4345 end