summaryrefslogtreecommitdiff
path: root/helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'helpers.rb')
-rw-r--r--helpers.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/helpers.rb b/helpers.rb
index 4940b34..bb43303 100644
--- a/helpers.rb
+++ b/helpers.rb
@@ -135,4 +135,10 @@ helpers do
type = extensions.find { |_k, v| v.include? ext }
"#{type[0]}/#{ext}"
end
+
+ def find_file(id)
+ Dir[File.join('*', 'object', '*', '*.json')].find do |f|
+ JSON.parse(File.read(f))['id'] == id
+ end
+ end
end