Class: Neetob::CLI::Github::Base

Inherits:
Base
  • Object
show all
Includes:
Utils
Defined in:
lib/neetob/cli/github/base.rb

Constant Summary

Constants inherited from Base

Base::NEETO_APPS_LIST_LINK

Instance Attribute Summary collapse

Attributes inherited from Base

#ui

Instance Method Summary collapse

Methods included from Utils

#camel_case_to_slug, #is_upper?, #symbolize_keys

Constructor Details

#initializeBase

Returns a new instance of Base.



17
18
19
20
21
22
23
24
# File 'lib/neetob/cli/github/base.rb', line 17

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

Instance Attribute Details

#clientObject

Returns the value of attribute client.



15
16
17
# File 'lib/neetob/cli/github/base.rb', line 15

def client
  @client
end

Instance Method Details

#check_for_apps_and_all_neeto_repos_option(apps, all_neeto_repos) ⇒ Object



26
27
28
29
30
31
# File 'lib/neetob/cli/github/base.rb', line 26

def check_for_apps_and_all_neeto_repos_option(apps, all_neeto_repos)
  if (apps.nil? && !all_neeto_repos) || (!apps.nil? && all_neeto_repos)
    ui.error("Please provide either \"apps\" or \"all-neeto-repos\" option.")
    exit
  end
end