Sha256: 876f581afa4f079ecfd56163f5cfcac53863f2535c00b6334ecf93ab009b7320
Contents?: true
Size: 900 Bytes
Versions: 35
Compression:
Stored size: 900 Bytes
Contents
# frozen_string_literal: true require "octokit" require_relative "../base" require_relative "../../exception_handler" require_relative "auth" require_relative "../../utils" module Neetob class CLI module Github class Base < CLI::Base include Utils attr_accessor :client, :access_token def initialize super() auth_client = Auth.new(**read_and_parse_auth_params_from_env) unless auth_client.token_persisted? auth_client.start_oauth2_device_flow end @access_token = auth_client.access_token @client = Octokit::Client.new(access_token:) end private def read_and_parse_auth_params_from_env hash_with_keys_of_string_type = JSON.parse(ENV["AUTH_PARAMS"]) symbolize_keys(hash_with_keys_of_string_type) end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems