class Amanogawa::Client

Public Class Methods

new(*args) click to toggle source
# File lib/amanogawa.rb, line 53
def initialize(*args)
  case args.length
  when 0
    @client = Octokit::Client.new(netrc: true)
  when 1
    @client = Octokit::Client.new(access_token: args[0])
  when 2
    @client = Octokit::Client.new(login: args[0], password: args[1])
  else
    raise ArgumentError
  end
end

Public Instance Methods

fetch() click to toggle source
# File lib/amanogawa.rb, line 66
def fetch
  @client.auto_paginate = true
  @client.starred
end
sync() click to toggle source
# File lib/amanogawa.rb, line 71
def sync
  File.open(Amanogawa.cache_file, "w") { |f| f.write(Marshal.dump(fetch)) }
end