Add rubocop to our build. (#5004)

This commit is contained in:
Guo Xiang Tan
2017-07-28 10:20:09 +09:00
committed by GitHub
parent ff4e295c4f
commit 5012d46cbd
871 changed files with 5480 additions and 6056 deletions

View File

@ -2,13 +2,13 @@ require_dependency 'retrieve_title'
class InlineOneboxer
def initialize(urls, opts=nil)
def initialize(urls, opts = nil)
@urls = urls
@opts = opts || {}
end
def process
@urls.map {|url| InlineOneboxer.lookup(url, @opts) }.compact
@urls.map { |url| InlineOneboxer.lookup(url, @opts) }.compact
end
def self.purge(url)
@ -19,7 +19,7 @@ class InlineOneboxer
Rails.cache.read(cache_key(url))
end
def self.lookup(url, opts=nil)
def self.lookup(url, opts = nil)
opts ||= {}
unless opts[:skip_cache]
@ -44,7 +44,7 @@ class InlineOneboxer
uri.hostname.present? &&
domains.include?(uri.hostname) &&
title = RetrieveTitle.crawl(url)
return onebox_for(url, title, opts)
return onebox_for(url, title, opts)
end
end
@ -70,4 +70,3 @@ class InlineOneboxer
end
end