doorkeeper 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of doorkeeper might be problematic. Click here for more details.
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/doorkeeper/config.rb +7 -1
- data/lib/doorkeeper/version.rb +1 -1
- data/spec/lib/config_spec.rb +15 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/doorkeeper/config.rb
CHANGED
@@ -1,4 +1,10 @@
|
|
1
1
|
module Doorkeeper
|
2
|
+
class MissingConfiguration < StandardError
|
3
|
+
def initialize
|
4
|
+
super("Configuration for doorkeeper missing. Do you have doorkeeper initializer?")
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
2
8
|
def self.configure(&block)
|
3
9
|
@config = Config::Builder.new(&block).build
|
4
10
|
enable_orm
|
@@ -6,7 +12,7 @@ module Doorkeeper
|
|
6
12
|
end
|
7
13
|
|
8
14
|
def self.configuration
|
9
|
-
@config
|
15
|
+
@config || (raise MissingConfiguration.new)
|
10
16
|
end
|
11
17
|
|
12
18
|
def self.enable_orm
|
data/lib/doorkeeper/version.rb
CHANGED
data/spec/lib/config_spec.rb
CHANGED
@@ -152,4 +152,19 @@ describe Doorkeeper, "configuration" do
|
|
152
152
|
end
|
153
153
|
|
154
154
|
end
|
155
|
+
|
156
|
+
it 'raises an exception when configuration is not set' do
|
157
|
+
old_config = Doorkeeper.configuration
|
158
|
+
Doorkeeper.module_eval do
|
159
|
+
@config = nil
|
160
|
+
end
|
161
|
+
|
162
|
+
expect do
|
163
|
+
Doorkeeper.configuration
|
164
|
+
end.to raise_error Doorkeeper::MissingConfiguration
|
165
|
+
|
166
|
+
Doorkeeper.module_eval do
|
167
|
+
@config = old_config
|
168
|
+
end
|
169
|
+
end
|
155
170
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doorkeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-01-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
type: :runtime
|
@@ -406,7 +406,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
406
406
|
segments:
|
407
407
|
- 0
|
408
408
|
version: '0'
|
409
|
-
hash: -
|
409
|
+
hash: -995956839748063493
|
410
410
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
411
411
|
none: false
|
412
412
|
requirements:
|
@@ -415,7 +415,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
415
415
|
segments:
|
416
416
|
- 0
|
417
417
|
version: '0'
|
418
|
-
hash: -
|
418
|
+
hash: -995956839748063493
|
419
419
|
requirements: []
|
420
420
|
rubyforge_project:
|
421
421
|
rubygems_version: 1.8.24
|