lib/papercall/rest_fetcher.rb in papercall-0.15.0 vs lib/papercall/rest_fetcher.rb in papercall-0.15.1

- old
+ new

@@ -1,11 +1,11 @@ require 'json' require 'rest-client' require 'parallel' module Papercall - #Fetches submissions from Papercall REST API + # Fetches submissions from Papercall REST API # Params: class RestFetcher < Fetcher SUBMISSIONS_URL = 'https://www.papercall.io/api/v1/submissions'.freeze def initialize(api_key) @@ -46,11 +46,11 @@ fetch_feedback end def fetch_ratings start_time = Time.now - print "Fetching ratings for all submissions from Papercall API..." + print 'Fetching ratings for all submissions from Papercall API...' Parallel.each(analysis, in_threads: 8) do |submission| unless submission['ratings'] ratings_url = "#{SUBMISSIONS_URL}/#{submission['id']}/ratings" submission['ratings'] = papercall(ratings_url) @@ -59,18 +59,18 @@ end puts "finished in #{Time.now - start_time} seconds." end def fetch_feedback - startTime = Time.now - print "Fetching feedback for all submissions from Papercall API..." + start_time = Time.now + print 'Fetching feedback for all submissions from Papercall API...' Parallel.each(analysis, in_threads: 8) do |submission| unless submission['feedback'] feedback_url = "#{SUBMISSIONS_URL}/#{submission['id']}/feedback" submission['feedback'] = papercall(feedback_url) end submission['feedback'] = [] unless submission['feedback'] end - puts "finished in #{Time.now - startTime} seconds." + puts "finished in #{Time.now - start_time} seconds." end end end