credly 0.0.8 → 0.0.9

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: df0506cc4324ac54a7fa107c2dee178e72948002
4
- data.tar.gz: 817057680e8debcf15d00e7814f76a3897becea3
3
+ metadata.gz: fdd88fadf204620537ca1c14e017394e64a163df
4
+ data.tar.gz: 13b5da9183273834934c11d2e803bc57059731a6
5
5
  SHA512:
6
- metadata.gz: af129ee98ab28a38d79b99d4b3249e74f927da23d4a0d5049dc950c45867aa6a21e816afe704e37f2206c45f6f9966aeae1585bab8211e2854d0f659170fbb1a
7
- data.tar.gz: 7c7b007724d3c6f59180345bde47e4d26ef335c1f8100717b1a6700885920aeb51ed262722b243606292e84bee50842233d9901c8d40d15d6099e7c353a2ddc4
6
+ metadata.gz: d83e16a0b45d397ad7d854bbf6547033c58b6559b2eec0853bafaa2c6eb9fb67d0521d7b9ae00540a65aca9ca327a047634ec28c48cfe3f77736b32115682de8
7
+ data.tar.gz: 483981409862b309ebf173685887be6de2283b9340c9936e9e2a203a7953e3886524d034c836eb617908c0284482d9308e5ab72888bf415bfd5f30aa7865fc99
data/Rakefile CHANGED
@@ -13,6 +13,7 @@ task :publish => :build do
13
13
  system("git tag #{Credly::VERSION}") unless tags =~ /#{Credly::VERSION}/
14
14
  system("gem push credly-#{Credly::VERSION}.gem")
15
15
  system("git push --tags")
16
+ system("gem push")
16
17
  end
17
18
 
18
19
  task :release => :publish do
@@ -57,7 +57,7 @@ module Credly
57
57
  if defined? @@options
58
58
  @@options
59
59
  else
60
- @@options = { :base_endpoint => 'https://apistaging2.credly.com',
60
+ @@options = { :base_endpoint => 'https://apistaging.credly.com',
61
61
  :base_domain => 'https://staging.credly.com',
62
62
  :access_token => nil,
63
63
  :version => 'v0.2',
@@ -22,7 +22,7 @@ module Credly
22
22
  if resp['meta']['status_code'] == 200
23
23
  resp['data']['token']
24
24
  else
25
- raise AuthFailed.new("The username or password was invalid\n#{resp}")
25
+ raise AuthFailed.new("The username or password was invalid\n#{resp.inspect}")
26
26
  end
27
27
  end
28
28
 
@@ -1,3 +1,3 @@
1
1
  module Credly
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
@@ -12,6 +12,9 @@ describe 'API' do
12
12
  end
13
13
 
14
14
  describe "configuration" do
15
+ before(:each) { @default_credly_configuration = Credly.configuration }
16
+ before(:after) { Credly.configuration = @default_credly_configuration }
17
+
15
18
  it "badge domain" do
16
19
  Credly::Client.any_instance.should_receive(:authenticate)
17
20
  expect(Credly::Client.new(:username => 'whatever', :password => 'password').options[:base_domain]).to eq('https://staging.credly.com')
@@ -21,6 +24,17 @@ describe 'API' do
21
24
  Credly::Client.any_instance.should_receive(:authenticate)
22
25
  expect(Credly::Client.new(:username => 'whatever', :password => 'password', :base_domain => 'mymy').options[:base_domain]).to eq('mymy')
23
26
  end
27
+
28
+ it "badge domain can be defined" do
29
+ Credly.configuration do |config|
30
+ config.base_domain = 'mymy'
31
+ end
32
+
33
+ Credly::Client.any_instance.should_receive(:authenticate)
34
+ expect(Credly::Client.new(:username => 'whatever', :password => 'password').options[:base_domain]).to eq('mymy')
35
+
36
+ tmp = Credly.configuration.base_domain
37
+ end
24
38
  end
25
39
 
26
40
  describe 'Badges' do
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.8
4
+ version: 0.0.9
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-10-19 00:00:00.000000000 Z
11
+ date: 2013-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday