summaryrefslogtreecommitdiff
path: root/helpers.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2023-08-14 17:42:57 +0200
committerpdp8 <pdp8@pdp8.info>2023-08-14 17:42:57 +0200
commit8cb9bc7e4d516a27b4fe27ba0d0a9c40497e003d (patch)
treea6d9626b248849a5d620e644144880d8febb1df1 /helpers.rb
parent9781dda58c3d2926f928544a8155d493fc2f1ca2 (diff)
undo/delete activities for outbox posts, cleanup
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