Class: Neetob::CLI::Github::Base
- Includes:
- Utils
- Defined in:
- lib/neetob/cli/github/base.rb
Direct Known Subclasses
Issues::Create, Issues::List, Labels::Delete, Labels::DeleteAll, Labels::List, Labels::Show, Labels::Update, Labels::Upsert, Login, MakePr::Base, ProtectBranch, Search, Users::Commits
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Attributes inherited from Base
Instance Method Summary collapse
- #check_for_apps_and_all_neeto_repos_option(apps, all_neeto_repos) ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize ⇒ Base
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
#client ⇒ Object
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 |