File tree Expand file tree Collapse file tree 2 files changed +42
-4
lines changed
Expand file tree Collapse file tree 2 files changed +42
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def included(base)
2828 #
2929 # @api public
3030 def new ( options = { } , &block )
31- Github :: Client . new ( options , &block )
31+ Client . new ( options , &block )
3232 end
3333
3434 # Delegate to Github::Client
@@ -52,7 +52,8 @@ def respond_to?(method_name, include_private = false)
5252 end
5353
5454 module ClassMethods
55- # Requires internal github_api libraries
55+
56+ # Requires internal libraries
5657 #
5758 # @param [String] prefix
5859 # the relative path prefix
@@ -66,9 +67,31 @@ def require_all(prefix, *libs)
6667 end
6768 end
6869
69- # Main client global configuration
70+ # The client configuration
71+ #
72+ # @return [Configuration]
73+ #
74+ # @api public
7075 def configuration
71- @configuration ||= Github ::Configuration . new
76+ @configuration ||= Configuration . new
77+ end
78+
79+ # Configure options
80+ #
81+ # @example
82+ # Github.configure do |c|
83+ # c.some_option = true
84+ # end
85+ #
86+ # @yield the configuration block
87+ # @yieldparam configuration [Github::Configuration]
88+ # the configuration instance
89+ #
90+ # @return [nil]
91+ #
92+ # @api public
93+ def configure
94+ yield configuration
7295 end
7396 end
7497
Original file line number Diff line number Diff line change 1+ # encoding: utf-8
2+
3+ require 'spec_helper'
4+
5+ describe Github , '#configure' do
6+ subject { described_class }
7+
8+ it "allows to configure settings" do
9+ yielded = nil
10+ Github . configure do |config |
11+ yielded = config
12+ end
13+ expect ( yielded ) . to be_a ( Github ::Configuration )
14+ end
15+ end
You can’t perform that action at this time.
0 commit comments