DEV: Apply syntax_tree formatting to lib/*

This commit is contained in:
David Taylor
2023-01-09 12:10:19 +00:00
parent b0fda61a8e
commit 6417173082
507 changed files with 16550 additions and 12627 deletions

View File

@ -1,12 +1,12 @@
# frozen_string_literal: true
require_relative '../mixins/git_blob_onebox'
require_relative "../mixins/git_blob_onebox"
module Onebox
module Engine
class GithubBlobOnebox
def self.git_regexp
/^https?:\/\/(www\.)?github\.com.*\/blob\//
%r{^https?://(www\.)?github\.com.*/blob/}
end
def self.onebox_name
@ -16,7 +16,7 @@ module Onebox
include Onebox::Mixins::GitBlobOnebox
def raw_regexp
/github\.com\/(?<user>[^\/]+)\/(?<repo>[^\/]+)\/blob\/(?<sha1>[^\/]+)\/(?<file>[^#]+)(#(L(?<from>[^-]*)(-L(?<to>.*))?))?/mi
%r{github\.com/(?<user>[^/]+)/(?<repo>[^/]+)/blob/(?<sha1>[^/]+)/(?<file>[^#]+)(#(L(?<from>[^-]*)(-L(?<to>.*))?))?}mi
end
def raw_template(m)
@ -24,7 +24,7 @@ module Onebox
end
def title
Sanitize.fragment(Onebox::Helpers.uri_unencode(link).sub(/^https?\:\/\/github\.com\//, ''))
Sanitize.fragment(Onebox::Helpers.uri_unencode(link).sub(%r{^https?\://github\.com/}, ""))
end
end
end