From 8cb9bc7e4d516a27b4fe27ba0d0a9c40497e003d Mon Sep 17 00:00:00 2001 From: pdp8 Date: Mon, 14 Aug 2023 17:42:57 +0200 Subject: undo/delete activities for outbox posts, cleanup --- helpers.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'helpers.rb') 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 -- cgit v1.2.3