coach_assist 0.2.1 → 0.2.2

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: 825a48ddff4715336e5d350d6651ec94fb6a5f1b
4
- data.tar.gz: 35661453cbfd0e9b09deb5a6b5ada71a162ca75a
3
+ metadata.gz: fb072701526f5f8e012a30179c47439f46eeb13c
4
+ data.tar.gz: 0c5e6bae534d3fd527608dfd2b2144ca1b20dd2f
5
5
  SHA512:
6
- metadata.gz: 580256fba7b637106ea57732c267a345945f85dfe59672f4de187d85ffa1699e1d07d01571d5fdedc581da4c2c4837299d0d36edcaec77931305884330036ab0
7
- data.tar.gz: b9e58a80ee1bbe031973f0f4b20e5cc88e19206356d03f71fc7a477b3c55c3ac1e0a52f07a90effbff97ef6ddcf0ea5613336dd39bac4b635267124fd21001be
6
+ metadata.gz: f5bf38e6912169eea7ef5242e70d90cba330940a7db284754ca5625caa7893cd74da0c037f4dd6d3a0a3cfec4fdd3424328897c542519cb7dd326594ab722d95
7
+ data.tar.gz: 5866e62256ad5e7784f864b752079ae084a3ebb322061102e075ad4eaeec1a5b07829f83c46b5974838de2b0e3755b8fde8ddc98fe92a2a774b9b916bea0cbed
@@ -30,8 +30,9 @@ module Coach
30
30
 
31
31
  def authenticated(username, password, &block)
32
32
  authenticate(username, password)
33
- block.call
33
+ block_result = block.call
34
34
  @auth = nil
35
+ block_result
35
36
  end
36
37
 
37
38
  def has_auth?
@@ -22,7 +22,14 @@ module Coach
22
22
  end
23
23
 
24
24
  def authenticated?(username, password)
25
- authenticated(username, password) do
25
+ client.authenticated(username, password) do
26
+ response = client.get '/authenticateduser'
27
+ response.code == 200
28
+ end
29
+ end
30
+
31
+ def authenticated(username, password)
32
+ client.authenticated(username, password) do
26
33
  response = client.get '/authenticateduser'
27
34
  response.code == 200 ? build(JSON.parse(response.body)) : nil
28
35
  end
@@ -1,3 +1,3 @@
1
1
  module CoachAssist
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coach_assist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Urs Gerber