credly 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/credly.rb +9 -0
- data/lib/credly/api/badge_builder.rb +1 -1
- data/lib/credly/version.rb +1 -1
- data/spec/unit/api_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d7f89751d8211b23e17e8b0485eceaeb67cf527
|
4
|
+
data.tar.gz: 89d6b0f102330a2a2c844e4b1f5f6d5544b6a1d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e008f9e261319a12b1ef15bfbabb3fe8954744fca01b9b0246be0e5f4db571e49788ce926b15959f2aa53458cf3fc66161167480004be37933d488edb2312cd2
|
7
|
+
data.tar.gz: 59e1de859e01a4b41a5144654e9198e65117dc3ae3067e0db1b4bd73b0afd098498039258f6e39f48ad50ec3e697dcc7e5404a2f7b533501c8e601d307ab68ed
|
data/lib/credly.rb
CHANGED
@@ -45,11 +45,20 @@ module Credly
|
|
45
45
|
options[:version]
|
46
46
|
end
|
47
47
|
|
48
|
+
def self.base_domain
|
49
|
+
options[:base_domain]
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.base_domain=(domain)
|
53
|
+
options[:domain] = domain
|
54
|
+
end
|
55
|
+
|
48
56
|
def self.options
|
49
57
|
if defined? @@options
|
50
58
|
@@options
|
51
59
|
else
|
52
60
|
@@options = { :base_endpoint => 'https://apistaging2.credly.com',
|
61
|
+
:base_domain => 'https://staging.credly.com',
|
53
62
|
:access_token => nil,
|
54
63
|
:version => 'v0.2',
|
55
64
|
:debugging => false,
|
@@ -4,7 +4,7 @@ module Credly
|
|
4
4
|
def initialize(options = {})
|
5
5
|
super
|
6
6
|
@client = @client.dup
|
7
|
-
@client.connection = @client.new_connection(:base_url =>
|
7
|
+
@client.connection = @client.new_connection(:base_url => @client.options[:base_domain])
|
8
8
|
end
|
9
9
|
|
10
10
|
def token
|
data/lib/credly/version.rb
CHANGED
data/spec/unit/api_spec.rb
CHANGED
@@ -11,6 +11,18 @@ describe 'API' do
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
describe "configuration" do
|
15
|
+
it "badge domain" do
|
16
|
+
Credly::Client.any_instance.should_receive(:authenticate)
|
17
|
+
expect(Credly::Client.new(:username => 'whatever', :password => 'password').options[:base_domain]).to eq('https://staging.credly.com')
|
18
|
+
end
|
19
|
+
|
20
|
+
it "badge domain can be defined" do
|
21
|
+
Credly::Client.any_instance.should_receive(:authenticate)
|
22
|
+
expect(Credly::Client.new(:username => 'whatever', :password => 'password', :base_domain => 'mymy').options[:base_domain]).to eq('mymy')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
14
26
|
describe 'Badges' do
|
15
27
|
it 'list all badges' do
|
16
28
|
expect_api_call(:get, 'badges', {})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: credly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gonzalo Rodríguez-Baltanás Díaz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|