lib/onebox/engine/github_commit_onebox.rb in onebox-2.2.12 vs lib/onebox/engine/github_commit_onebox.rb in onebox-2.2.13
- old
+ new
@@ -15,14 +15,13 @@
end
private
def match
- return @match if @match
+ return @match if defined?(@match)
@match = @url.match(%{github\.com/(?<owner>[^/]+)/(?<repository>[^/]+)/commit/(?<sha>[^/]+)})
-
- @match = @url.match(%{github\.com/(?<owner>[^/]+)/(?<repository>[^/]+)/pull/(?<pr>[^/]+)/commit/(?<sha>[^/]+)}) if @match.nil?
+ @match ||= @url.match(%{github\.com/(?<owner>[^/]+)/(?<repository>[^/]+)/pull/(?<pr>[^/]+)/commit/(?<sha>[^/]+)})
@match
end
def data