diff options
Diffstat (limited to 'helpers.rb')
-rw-r--r-- | helpers.rb | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |