class Everlog::Dom::Module::Github

Public Class Methods

fetch_since(date) click to toggle source
# File lib/everlog/dom/module/github.rb, line 28
def fetch_since date
  instance = self.new(Dom::Entity::Config.github)
  instance.repo_names.map { |r| instance.repo_activity(r, date) }.compact
end
new(config) click to toggle source
# File lib/everlog/dom/module/github.rb, line 3
def initialize config
  @config = config
end

Public Instance Methods

api_client() click to toggle source
# File lib/everlog/dom/module/github.rb, line 7
def api_client
  @api_client ||= Inf::Api::Github.new(@config)
end
commits(repo, date) click to toggle source
# File lib/everlog/dom/module/github.rb, line 21
def commits(repo, date)
  response = api_client.commits_on(repo, date)
  return nil if response.empty?
  response.map { |r| Dom::Value::Github::Commit.new(r) }.reverse
end
repo_activity(repo_name, date) click to toggle source
# File lib/everlog/dom/module/github.rb, line 15
def repo_activity(repo_name, date)
  repo_commits = commits(repo_name.sub(/.*\//, ''), date)
  return nil if repo_commits.nil?
  Dom::Value::Github::Repository_Activity.new(repo_name, repo_commits)
end
repo_names() click to toggle source
# File lib/everlog/dom/module/github.rb, line 11
def repo_names
  api_client.repos.map { |r| r.full_name }
end