summaryrefslogtreecommitdiff
path: root/helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'helpers.rb')
-rw-r--r--helpers.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/helpers.rb b/helpers.rb
index 21ff206..a43966b 100644
--- a/helpers.rb
+++ b/helpers.rb
@@ -46,7 +46,7 @@ helpers do
tag_path = File.join(TAGS[:dir], tag['name'].sub('#', '')) + '.json'
tag_collection = if File.exist? tag_path
- JSON.parse(File.read(tag_path))
+ JSON.load_file(tag_path)
else
{
'@context' => 'https://www.w3.org/ns/activitystreams',
@@ -92,8 +92,7 @@ helpers do
begin
uri = URI(url)
rescue StandardError => e
- p url
- p e
+ p url, e
return nil
end
httpdate = Time.now.utc.httpdate
@@ -112,8 +111,7 @@ helpers do
if $CHILD_STATUS.success?
response
else
- p url
- p response
+ p url, response
nil
end
end
@@ -172,7 +170,7 @@ helpers do
def find_file(id)
Dir[File.join('*', 'object', '*', '*.json')].find do |f|
- JSON.parse(File.read(f))['id'] == id
+ JSON.load_file(f)['id'] == id
end
end
end