summaryrefslogtreecommitdiff
path: root/lib/github/collection.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-10-18 21:46:05 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2017-11-07 23:25:03 +0100
commit6e242e82237ad2cf362098f3f42f4a9dd1a4ad27 (patch)
tree415639ff14183a4914dac69fcc400806cb477525 /lib/github/collection.rb
parent4dfe26cd8b6863b7e6c81f5c280cdafe9b6e17b6 (diff)
downloadgitlab-ce-github-importer-refactor.tar.gz
Replace old GH importer with the parallel importergithub-importer-refactor
Diffstat (limited to 'lib/github/collection.rb')
-rw-r--r--lib/github/collection.rb29
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/github/collection.rb b/lib/github/collection.rb
deleted file mode 100644
index 014b2038c4b..00000000000
--- a/lib/github/collection.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-module Github
- class Collection
- attr_reader :options
-
- def initialize(options)
- @options = options
- end
-
- def fetch(url, query = {})
- return [] if url.blank?
-
- Enumerator.new do |yielder|
- loop do
- response = client.get(url, query)
- response.body.each { |item| yielder << item }
-
- raise StopIteration unless response.rels.key?(:next)
- url = response.rels[:next]
- end
- end.lazy
- end
-
- private
-
- def client
- @client ||= Github::Client.new(options)
- end
- end
-end