lib/how_is/fetcher.rb in how_is-1.0.0 vs lib/how_is/fetcher.rb in how_is-2.0.0
- old
+ new
@@ -22,12 +22,13 @@
# Struct defines #to_h, but not #to_hash, so we alias them.
alias_method :to_hash, :to_h
end
- Contract String, C::RespondTo[:issues, :pulls] => Results
+ Contract String, C::Or[C::RespondTo[:issues, :pulls], nil] => Results
def call(repository,
- github = Github.new(auto_pagination: true))
+ github = nil)
+ github ||= Github.new(auto_pagination: true)
user, repo = repository.split('/', 2)
issues = github.issues.list user: user, repo: repo
pulls = github.pulls.list user: user, repo: repo
Results.new(