module Papercall

Module for fetching submissions from the PaperCall.io paper submission system Also providing some analytics

Constants

METHOD_REGEX
VERSION

Attributes

configuration[W]

Public Class Methods

active_reviewers() click to toggle source
# File lib/papercall/core.rb, line 47
def self.active_reviewers
  @analysis.reviewers
end
all() click to toggle source
# File lib/papercall/core.rb, line 28
def self.all
  @submissions.analysis
end
analysis() click to toggle source
# File lib/papercall/core.rb, line 59
def self.analysis
  @analysis
end
configuration() click to toggle source
# File lib/papercall/core.rb, line 9
def self.configuration
  @configuration ||= Configuration.new
end
configure() { |configuration| ... } click to toggle source
# File lib/papercall/core.rb, line 13
def self.configure
  yield(configuration)
end
confirmed_talks() click to toggle source
# File lib/papercall/core.rb, line 41
def self.confirmed_talks
  @submissions.accepted.select do |s|
    s.confirmed?
  end
end
fetch(from, *states) click to toggle source
# File lib/papercall/core.rb, line 17
def self.fetch(from, *states)
  if from == :from_file
    @submissions = Papercall::FileFetcher.new
  elsif from == :from_papercall
    @submissions = Papercall::RestFetcher.new
  end
  @submissions.fetch(states)
  #puts @submissions.analysis
  @analysis = Papercall::Analysis.new(@submissions.analysis)
end
method_missing(method_name, *args, &block) click to toggle source
Calls superclass method
# File lib/papercall/core.rb, line 88
def self.method_missing(method_name, *args, &block)
  if METHOD_REGEX.match method_name.to_s
    @submissions.send(Regexp.last_match[1])
  else
    super
  end
end
number_of_submissions() click to toggle source
# File lib/papercall/core.rb, line 37
def self.number_of_submissions
  all.length
end
respond_to_missing?(method_name, _include_private = false) click to toggle source
# File lib/papercall/core.rb, line 84
def self.respond_to_missing?(method_name, _include_private = false)
  METHOD_REGEX.match method_name.to_s
end
save_to_file(filename) click to toggle source
# File lib/papercall/core.rb, line 32
def self.save_to_file(filename)
  ff = File.open(filename, 'w') { |f| f.write(@submissions.all.to_json) }
  puts "All submissions written to file #{filename}." if ff && configuration.output
end
submissions_with_enough_reviews() click to toggle source
# File lib/papercall/core.rb, line 55
def self.submissions_with_enough_reviews
  @analysis.submissions - @analysis.talks_missing_reviews
end
submissions_without_feedback() click to toggle source
# File lib/papercall/core.rb, line 51
def self.submissions_without_feedback
  @analysis.talks_without_feedback
end
summary() click to toggle source
# File lib/papercall/core.rb, line 63
def self.summary
  a = @analysis
  if configuration.output
    puts "Number of submissions: #{a.number_of_submissions}"
    puts "Number of active reviewers: #{a.number_of_active_reviewers}"
    puts "Number of submitted talks without feedback: #{a.number_without_feedback}"
    puts "Number of talks with three or more reviews: #{a.number_completed}"
    puts "Number of highly rated talks: #{a.number_of_highly_rated}"
    puts "Number of low rated talks: #{a.number_of_low_rated}"
    puts "Number of middle rated talks: #{a.number_of_maybes}"
    puts "Number of talks with less than three reviews: #{a.number_with_few_reviews}"
    puts "Number of talks with four or more reviews: #{a.number_with_many_reviews}"
    puts "Number of talks without reviews: #{a.number_without_reviews}"
    puts "Number of accepted talks: #{a.number_accepted}"
    puts "Number of waitlisted talks: #{a.number_of_waitlisted}"
    puts "Number of rejected talks: #{a.number_rejected}"
    puts "Number of confirmed talks: #{a.number_confirmed}"
  end
  a
end