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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6615a3f910beb529ce7b0f9841d6abd4ff4dbba1
4
- data.tar.gz: 1d0b6704a295443da2bb974015c582f3aea07008
3
+ metadata.gz: 3d7f89751d8211b23e17e8b0485eceaeb67cf527
4
+ data.tar.gz: 89d6b0f102330a2a2c844e4b1f5f6d5544b6a1d7
5
5
  SHA512:
6
- metadata.gz: a125903ef925d81004ebbb8d1c479761aa29d28436097b518019906e5e9d513bfff9d833e60b3807a1e6ae83724793c1ecc0249e66c781f4a2b41a43ad0d5859
7
- data.tar.gz: 5f4447e1e247a46d27eebe80364af4f0a4ba98eeb6ab36c036c4b18d5fcdab2240067ceceba5ea32a49a8cac88a07a77c19c93ebb1767df636ae20e9b3d7b033
6
+ metadata.gz: e008f9e261319a12b1ef15bfbabb3fe8954744fca01b9b0246be0e5f4db571e49788ce926b15959f2aa53458cf3fc66161167480004be37933d488edb2312cd2
7
+ data.tar.gz: 59e1de859e01a4b41a5144654e9198e65117dc3ae3067e0db1b4bd73b0afd098498039258f6e39f48ad50ec3e697dcc7e5404a2f7b533501c8e601d307ab68ed
@@ -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 => 'https://staging.credly.com')
7
+ @client.connection = @client.new_connection(:base_url => @client.options[:base_domain])
8
8
  end
9
9
 
10
10
  def token
@@ -1,3 +1,3 @@
1
1
  module Credly
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -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.6
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-09-20 00:00:00.000000000 Z
11
+ date: 2013-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday