Sha256: 07d4d6b9d2ee07d1e9e187edf41949521694ff2c0d905c6f40f5390b34f989f2

Contents?: true

Size: 705 Bytes

Versions: 1

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true

require 'octokit'

require_relative 'event_adapter'
require 'roko/source/base/report_events'

module Roko
  module Source
    module Github
      # report events from github
      class ReportEvents < Roko::Source::Base::ReportEvents
        def client
          Octokit.configure do |c|
            c.netrc_file = ENV['NETRC_FILE_PATH'] || '~/.netrc'
            c.auto_paginate = true
          end
          Octokit::Client.new(netrc: true)
        end

        def fetch_service_event(client)
          client.user_events(client.login)
        end

        def to_report_event(event)
          EventAdapter.to_report_event(event)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roko-0.2.0 lib/roko/source/github/report_events.rb