Sha256: ac4298e40615910b454bf6ff223bd7abd84b0650027f60794b1780ed9e7a4a8d
Contents?: true
Size: 1.12 KB
Versions: 1
Compression:
Stored size: 1.12 KB
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 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 @client = Octokit::Client.new(access_token: auth_client.access_token) end def check_for_apps_and_all_neeto_repos_option(repos, all_neeto_repos) if (repos.nil? && !all_neeto_repos) || (!repos.nil? && all_neeto_repos) ui.error("Please provide either \"repos\" or \"all-neeto-repos\" option.") exit end 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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
neetob-0.2.3 | lib/neetob/cli/github/base.rb |