Module: Octokit::Configurable
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Extended In:
| |
Included In:
| |
Defined in: | lib/octokit/configurable.rb |
Overview
Class Method Summary
-
.keys ⇒ Array
List of configurable keys for
Client
Instance Attribute Summary
- #access_token rw
- #api_endpoint ⇒ String rw
- #api_endpoint=(value) ⇒ String rw
- #auto_paginate ⇒ Boolean rw
- #bearer_token rw
- #client_id ⇒ String rw
- #client_secret rw
- #connection_options ⇒ Hash rw
- #default_media_type ⇒ String rw
- #login ⇒ String rw
- #login=(value) ⇒ String rw
- #manage_ghes_endpoint ⇒ String rw
- #manage_ghes_endpoint=(value) ⇒ String rw
- #manage_ghes_password ⇒ String rw
- #manage_ghes_password=(value) ⇒ String rw
- #manage_ghes_username ⇒ String rw
- #manage_ghes_username=(value) ⇒ String rw
- #management_console_endpoint ⇒ String rw
- #management_console_endpoint=(value) ⇒ String rw
- #management_console_password ⇒ String rw
- #management_console_password=(value) ⇒ String rw
- #middleware ⇒ Faraday::Builder or Faraday::RackBuilder rw
- #netrc ⇒ Boolean rw
- #netrc? ⇒ Boolean rw
- #netrc_file ⇒ String rw
- #password=(value) ⇒ String writeonly
- #per_page ⇒ String rw
- #proxy ⇒ String rw
- #ssl_verify_mode ⇒ String rw
- #user_agent ⇒ String rw
-
#web_endpoint ⇒ String
rw
Base URL for generated web URLs.
- #web_endpoint=(value) ⇒ String rw
Instance Method Summary
-
#configure {|_self| ... }
Set configuration options using a block.
-
#reset!
(also: #setup)
Reset configuration options to default values.
-
#same_options?(opts) ⇒ Boolean
Compares client options to a Hash of requested options.
-
#setup
Alias for #reset!.
- #fetch_client_id_and_secret(overrides = {}) private
- #options private
Class Method Details
.keys ⇒ Array
List of configurable keys for Client
# File 'lib/octokit/configurable.rb', line 76
def keys @keys ||= %i[ access_token api_endpoint auto_paginate bearer_token client_id client_secret connection_options default_media_type login management_console_endpoint management_console_password manage_ghes_endpoint manage_ghes_username manage_ghes_password middleware netrc netrc_file per_page password proxy ssl_verify_mode user_agent web_endpoint ] end
Instance Attribute Details
#access_token (rw)
[ GitHub ]# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#api_endpoint ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 133
def api_endpoint File.join(@api_endpoint, '') end
#api_endpoint=(value) ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#auto_paginate ⇒ Boolean
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#bearer_token (rw)
[ GitHub ]# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#client_id ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#client_secret (rw)
[ GitHub ]# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#connection_options ⇒ Hash
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#default_media_type ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#login ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 152
def login @login ||= (user.login if token_authenticated?) end
#login=(value) ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#manage_ghes_endpoint ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 141
def manage_ghes_endpoint File.join(@manage_ghes_endpoint, '') end
#manage_ghes_endpoint=(value) ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#manage_ghes_password ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#manage_ghes_password=(value) ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#manage_ghes_username ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#manage_ghes_username=(value) ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#management_console_endpoint ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 137
def management_console_endpoint File.join(@management_console_endpoint, '') end
#management_console_endpoint=(value) ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#management_console_password ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#management_console_password=(value) ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#middleware ⇒ Faraday::Builder
or
Faraday::RackBuilder
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#netrc ⇒ Boolean
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#netrc? ⇒ Boolean
(rw)
[ GitHub ]
# File 'lib/octokit/configurable.rb', line 156
def netrc? !!@netrc end
#netrc_file ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#password=(value) ⇒ String
(writeonly)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#per_page ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#proxy ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#ssl_verify_mode ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#user_agent ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
#web_endpoint ⇒ String
(rw)
Base URL for generated web URLs
# File 'lib/octokit/configurable.rb', line 148
def web_endpoint File.join(@web_endpoint, '') end
#web_endpoint=(value) ⇒ String
(rw)
# File 'lib/octokit/configurable.rb', line 63
attr_accessor :access_token, :auto_paginate, :bearer_token, :client_id, :client_secret, :default_media_type, :, :middleware, :netrc, :netrc_file, :per_page, :proxy, :ssl_verify_mode, :user_agent
Instance Method Details
#configure {|_self| ... }
Set configuration options using a block
# File 'lib/octokit/configurable.rb', line 106
def configure yield self end
#fetch_client_id_and_secret(overrides = {}) (private)
[ GitHub ]# File 'lib/octokit/configurable.rb', line 166
def fetch_client_id_and_secret(overrides = {}) opts = .merge(overrides) opts.values_at :client_id, :client_secret end
#options (private)
[ GitHub ]#reset! Also known as: #setup
Reset configuration options to default values
# File 'lib/octokit/configurable.rb', line 111
def reset! # rubocop:disable Style/HashEachMethods # # This may look like a `.keys.each` which should be replaced with `#each_key`, but # this doesn't actually work, since `#keys` is just a method we've defined ourselves. # The class doesn't fulfill the whole `Enumerable` contract. Octokit::Configurable.keys.each do |key| # rubocop:enable Style/HashEachMethods instance_variable_set(:"@#{key}", Octokit::Default. [key]) end self end
#same_options?(opts) ⇒ Boolean
Compares client options to a Hash of requested options
# File 'lib/octokit/configurable.rb', line 129
def (opts) opts.hash == .hash end
#setup
Alias for #reset!.
# File 'lib/octokit/configurable.rb', line 123
alias setup reset!