Module: Hubkit::Configuration
- Defined in:
- lib/hubkit/configuration.rb
Overview
Hold the configuration of the Hubkit library. Holds the client, default github organization, and the github library configuration options.
Class Attribute Summary collapse
-
.client ⇒ Github::Client
The underlying Github::Client that will be used for library operations.
-
.default_org ⇒ Object
Returns the value of attribute default_org.
-
.github_config ⇒ Object
Returns the value of attribute github_config.
Class Method Summary collapse
-
.configure(opts = {}) {|this| ... } ⇒ Github::Client
Set configuration for the library.
-
.method_missing(name, *args) {|...| ... } ⇒ Object
Pass through all method calls which are not implemented directly on the Configuration to the client’s configuration method.
Class Attribute Details
.client ⇒ Github::Client
The underlying Github::Client that will be used for library operations
32 33 34 |
# File 'lib/hubkit/configuration.rb', line 32 def client @client || Github.new end |
.default_org ⇒ Object
Returns the value of attribute default_org.
13 14 15 |
# File 'lib/hubkit/configuration.rb', line 13 def default_org @default_org end |
.github_config ⇒ Object
Returns the value of attribute github_config.
14 15 16 |
# File 'lib/hubkit/configuration.rb', line 14 def github_config @github_config end |
Class Method Details
.configure(opts = {}) {|this| ... } ⇒ Github::Client
Set configuration for the library
21 22 23 24 25 26 27 |
# File 'lib/hubkit/configuration.rb', line 21 def configure(opts = {}, &block) hubkit_config = self @client = Github.new do |github_config| hubkit_config.github_config = github_config yield hubkit_config end end |
.method_missing(name, *args) {|...| ... } ⇒ Object
Pass through all method calls which are not implemented directly on the Configuration to the client’s configuration method
43 44 45 46 47 48 |
# File 'lib/hubkit/configuration.rb', line 43 def method_missing(name, *args, &block) if github_config.present? && github_config.respond_to?(name, false) return github_config.public_send(name, *args, &block) end super end |