Skip to content

Commit

Permalink
ruby 3 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
pushcx authored and jmcharter committed Oct 21, 2023
1 parent 28d0c35 commit ed7081d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extras/diff_bot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ def self.get_story_text(story)
# turn newlines into double newlines, so they become paragraphs
j["text"] = j["text"].to_s.gsub("\n", "\n\n")

while j["text"] =~ "\n\n\n"
while j["text"].include?("\n\n\n")
j["text"].gsub!("\n\n\n", "\n\n")
end

return j["text"]
end
rescue => e
Rails.logger.error "error fetching #{db_url}: #{e.message}"
Rails.logger.error "error fetching #{db_url} #{e.backtrace.first} #{e.message}"
end

begin
s = Sponge.new
s.timeout = 45
s.fetch(story.archive_url)
s.fetch(story.archiveorg_url)
rescue => e
Rails.logger.error "error caching #{db_url}: #{e.message}"
Rails.logger.error "error caching #{db_url}: #{e.backtrace.first} #{e.message}"
end

nil
Expand Down

0 comments on commit ed7081d

Please sign in to comment.