lib/onebox/engine/google_docs_onebox.rb in onebox-2.2.12 vs lib/onebox/engine/google_docs_onebox.rb in onebox-2.2.13

- old
+ new

@@ -17,22 +17,22 @@ presentation: :slides, forms: :forms, } end - matches_regexp /^(https?:)?\/\/(docs\.google\.com)\/(?<endpoint>(#{supported_endpoints.join('|')}))\/d\/((?<key>[\w-]*)).+$/ + matches_regexp(/^(https?:)?\/\/(docs\.google\.com)\/(?<endpoint>(#{supported_endpoints.join('|')}))\/d\/((?<key>[\w-]*)).+$/) always_https protected def data og_data = get_og_data - result = { link: link, - title: og_data[:title] || "Google #{shorttype.to_s.capitalize}", - description: Onebox::Helpers.truncate(og_data[:description], 250) || "This #{shorttype.to_s.chop.capitalize} is private", - type: shorttype - } - result + { + link: link, + title: og_data[:title] || "Google #{shorttype.to_s.capitalize}", + description: Onebox::Helpers.truncate(og_data[:description], 250) || "This #{shorttype.to_s.chop.capitalize} is private", + type: shorttype + } end def doc_type @doc_type ||= match[:endpoint].to_sym end