rubocop: fix various issues

This commit is contained in:
lllusion3469
2020-05-11 01:08:18 +02:00
parent 0d5e31868f
commit 70beb7288d
3 changed files with 10 additions and 12 deletions

View File

@@ -40,7 +40,7 @@ class DeviantArtApiClient
mature_content: mature_content, mature_content: mature_content,
ext_submission: ext_submission, ext_submission: ext_submission,
ext_camera: ext_camera, ext_camera: ext_camera,
ext_stats: ext_stats, ext_stats: ext_stats
} }
request("deviation/metadata", **params) request("deviation/metadata", **params)

View File

@@ -201,8 +201,6 @@ module Sources
end.gsub(/\A[[:space:]]+|[[:space:]]+\z/, "") end.gsub(/\A[[:space:]]+|[[:space:]]+\z/, "")
end end
public
def self.deviation_id_from_url(url) def self.deviation_id_from_url(url)
if url =~ ASSET if url =~ ASSET
$~[:base36_deviation_id].try(:to_i, 36) $~[:base36_deviation_id].try(:to_i, 36)
@@ -308,7 +306,7 @@ module Sources
{ {
deviation: api_deviation, deviation: api_deviation,
metadata: api_metadata, metadata: api_metadata,
download: api_download, download: api_download
} }
end end
end end

View File

@@ -40,15 +40,15 @@ module Sources
end end
def self.stash_id_from_url(url) def self.stash_id_from_url(url)
if url =~ STASH if url =~ STASH
$~[:post_id].downcase $~[:post_id].downcase
else else
nil nil
end end
end end
def stash_id def stash_id
[url, referer_url].map{ |x| self.class.stash_id_from_url(x) }.compact.first [url, referer_url].map { |x| self.class.stash_id_from_url(x) }.compact.first
end end
end end
end end