mirror of
https://git.asonix.dog/ceralor/mastodon.git
synced 2025-10-12 21:34:27 +00:00
Fix remaining rubocop lint
This commit is contained in:
parent
214b571eea
commit
4cadb6538b
2 changed files with 39 additions and 37 deletions
|
@ -105,6 +105,7 @@ class TextFormatter
|
|||
HTML
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/CyclomaticComplexity
|
||||
def link_to_mention(entity)
|
||||
username, domain = entity[:screen_name].split('@')
|
||||
domain = nil if local_domain?(domain)
|
||||
|
@ -185,97 +186,98 @@ class TextFormatter
|
|||
<span class="h-card" translate="no"><a href="#{h(url)}" class="u-url mention">@<span>#{h(display_username)}</span></a></span>
|
||||
HTML
|
||||
end
|
||||
# rubocop:enable Metrics/CyclomaticComplexity
|
||||
|
||||
def link_to_twitter(username)
|
||||
link_to(username, "https://twitter.com/#{username}", "twitter.com")
|
||||
link_to(username, "https://twitter.com/#{username}", 'twitter.com')
|
||||
end
|
||||
|
||||
def link_to_tumblr(username)
|
||||
link_to(username, "https://#{username}.tumblr.com", "tumblr.com")
|
||||
link_to(username, "https://#{username}.tumblr.com", 'tumblr.com')
|
||||
end
|
||||
|
||||
def link_to_weasyl(username)
|
||||
link_to username "https://weasyl.com/~#{username}" "weasyl.com"
|
||||
link_to username "https://weasyl.com/~#{username}weasyl.com"
|
||||
end
|
||||
|
||||
def link_to_furaffinity(username)
|
||||
link_to(username, "https://furaffinity.net/user/#{username}", "furaffinity.net")
|
||||
link_to(username, "https://furaffinity.net/user/#{username}", 'furaffinity.net')
|
||||
end
|
||||
|
||||
def link_to_furrynetwork(username)
|
||||
link_to(username, "https://furrynetwork.com/#{username}", "furrynetwork.com")
|
||||
link_to(username, "https://furrynetwork.com/#{username}", 'furrynetwork.com')
|
||||
end
|
||||
|
||||
def link_to_inkbunny(username)
|
||||
link_to(username, "https://inkbunny.net/#{username}", "inkbunny.net")
|
||||
link_to(username, "https://inkbunny.net/#{username}", 'inkbunny.net')
|
||||
end
|
||||
|
||||
def link_to_sofurry(username)
|
||||
link_to(username, "https://#{username}.sofurry.com", "sofurry.com")
|
||||
link_to(username, "https://#{username}.sofurry.com", 'sofurry.com')
|
||||
end
|
||||
|
||||
def link_to_e621(username)
|
||||
link_to username "https://e621.net/user/show/#{username}" "e621.net"
|
||||
link_to username "https://e621.net/user/show/#{username}e621.net"
|
||||
end
|
||||
|
||||
def link_to_e926(username)
|
||||
link_to username "https://e926.net/user/show/#{username}" "e926.net"
|
||||
link_to username "https://e926.net/user/show/#{username}e926.net"
|
||||
end
|
||||
|
||||
def link_to_flist(username)
|
||||
link_to username "https://f-list.net/c/#{username}" "f-list.net"
|
||||
link_to username "https://f-list.net/c/#{username}f-list.net"
|
||||
end
|
||||
|
||||
def link_to_deviantart(username)
|
||||
link_to(username, "https://#{username}.deviantart.com", "deviantart.com")
|
||||
link_to(username, "https://#{username}.deviantart.com", 'deviantart.com')
|
||||
end
|
||||
|
||||
def link_to_artstation(username)
|
||||
link_to(username, "https://www.artstation.com/#{username}", "artstation.com")
|
||||
link_to(username, "https://www.artstation.com/#{username}", 'artstation.com')
|
||||
end
|
||||
|
||||
def link_to_github(username)
|
||||
link_to(username, "https://github.com/#{username}", "github.com")
|
||||
link_to(username, "https://github.com/#{username}", 'github.com')
|
||||
end
|
||||
|
||||
def link_to_gitlab(username)
|
||||
link_to(username, "https://gitlab.com/#{username}", "gitlab.com")
|
||||
link_to(username, "https://gitlab.com/#{username}", 'gitlab.com')
|
||||
end
|
||||
|
||||
def link_to_bitbucket(username)
|
||||
link_to(username, "https://bitbucket.org/#{username}", "bitbucket.org")
|
||||
link_to(username, "https://bitbucket.org/#{username}", 'bitbucket.org')
|
||||
end
|
||||
|
||||
def link_to_telegram(username)
|
||||
link_to(username, "https://t.me/#{username}", "telegram.org")
|
||||
link_to(username, "https://t.me/#{username}", 'telegram.org')
|
||||
end
|
||||
|
||||
def link_to_picarto(username)
|
||||
link_to(username, "https://picarto.tv/#{username}", "picarto.tv")
|
||||
link_to(username, "https://picarto.tv/#{username}", 'picarto.tv')
|
||||
end
|
||||
|
||||
def link_to_twitch(username)
|
||||
link_to(username, "https://twitch.tv/#{username}", "twitch.tv")
|
||||
link_to(username, "https://twitch.tv/#{username}", 'twitch.tv')
|
||||
end
|
||||
|
||||
def link_to_reddit(username)
|
||||
link_to(username, "https://reddit.com/u/#{username}", "reddit.com")
|
||||
link_to(username, "https://reddit.com/u/#{username}", 'reddit.com')
|
||||
end
|
||||
|
||||
def link_to_poizen(username)
|
||||
link_to(username, "https://poizen.me/#{username}", "poizen.me")
|
||||
link_to(username, "https://poizen.me/#{username}", 'poizen.me')
|
||||
end
|
||||
|
||||
def link_to_patreon(username)
|
||||
link_to(username, "https://www.patreon.com/#{username}", "patreon.com")
|
||||
link_to(username, "https://www.patreon.com/#{username}", 'patreon.com')
|
||||
end
|
||||
|
||||
def link_to_boosty(username)
|
||||
link_to(username, "https://boosty.to/#{username}", "boosty.to")
|
||||
link_to(username, "https://boosty.to/#{username}", 'boosty.to')
|
||||
end
|
||||
|
||||
def link_to_subscribestar(username)
|
||||
link_to(username, "https://subscribestar.adult/#{username}", "subscribestar.adult")
|
||||
link_to(username, "https://subscribestar.adult/#{username}", 'subscribestar.adult')
|
||||
end
|
||||
|
||||
def link_to(username, url, domain)
|
||||
|
|
|
@ -20,21 +20,21 @@ Rails.application.configure do
|
|||
:de,
|
||||
:el,
|
||||
:en,
|
||||
:"en-GB",
|
||||
:"en-DG",
|
||||
:"en-LN",
|
||||
:"en-SQ",
|
||||
:'en-GB',
|
||||
:'en-DG',
|
||||
:'en-LN',
|
||||
:'en-SQ',
|
||||
:eo,
|
||||
:es,
|
||||
:"es-AR",
|
||||
:"es-MX",
|
||||
:'es-AR',
|
||||
:'es-MX',
|
||||
:et,
|
||||
:eu,
|
||||
:fa,
|
||||
:fi,
|
||||
:fo,
|
||||
:fr,
|
||||
:"fr-CA",
|
||||
:'fr-CA',
|
||||
:fy,
|
||||
:ga,
|
||||
:gd,
|
||||
|
@ -73,8 +73,8 @@ Rails.application.configure do
|
|||
:oc,
|
||||
:pa,
|
||||
:pl,
|
||||
:"pt-BR",
|
||||
:"pt-PT",
|
||||
:'pt-BR',
|
||||
:'pt-PT',
|
||||
:ro,
|
||||
:ru,
|
||||
:sa,
|
||||
|
@ -85,7 +85,7 @@ Rails.application.configure do
|
|||
:sl,
|
||||
:sq,
|
||||
:sr,
|
||||
:"sr-Latn",
|
||||
:'sr-Latn',
|
||||
:sv,
|
||||
:szl,
|
||||
:ta,
|
||||
|
@ -98,13 +98,13 @@ Rails.application.configure do
|
|||
:ur,
|
||||
:vi,
|
||||
:zgh,
|
||||
:"zh-CN",
|
||||
:"zh-HK",
|
||||
:"zh-TW"
|
||||
:'zh-CN',
|
||||
:'zh-HK',
|
||||
:'zh-TW',
|
||||
]
|
||||
|
||||
config.i18n.default_locale = begin
|
||||
custom_default_locale = ENV["DEFAULT_LOCALE"]&.to_sym
|
||||
custom_default_locale = ENV['DEFAULT_LOCALE']&.to_sym
|
||||
|
||||
if Rails.configuration.i18n.available_locales.include?(custom_default_locale)
|
||||
custom_default_locale
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue