comparison app/helpers/application_helper.rb @ 260:e2150dce4e90

Rubocop (rails) time
author nanaya <me@nanaya.net>
date Sun, 15 Dec 2024 22:59:09 +0900
parents c6a50441a58d
children
comparison
equal deleted inserted replaced
259:8b75d00c77ba 260:e2150dce4e90
8 def expand_url(text, urls) 8 def expand_url(text, urls)
9 text.gsub /https?:\/\/t\.co\/[A-Za-z0-9]+/ do |url| 9 text.gsub /https?:\/\/t\.co\/[A-Za-z0-9]+/ do |url|
10 expanded = urls[url] 10 expanded = urls[url]
11 11
12 case expanded 12 case expanded
13 when nil then url 13 when nil then url
14 when Hash then expanded[:url] 14 when Hash then expanded[:url]
15 else expanded 15 else expanded
16 end 16 end
17 end 17 end
18 end 18 end
19 19
20 def status_url(tweet) 20 def status_url(tweet)