auth_manager 0.0.1 → 0.0.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: b8521841e5314b1d118d3065deeacb4c9784a4dc
4
- data.tar.gz: 6d732386347e5c838d88d64195b10dfb8f2a5fd1
3
+ metadata.gz: d82e648bc36a09ed97c642107200d61274fcdcaf
4
+ data.tar.gz: 667d2179e19911d1a7912fd3e519b4e217539375
5
5
  SHA512:
6
- metadata.gz: e06913f4662d119d8fb4a572000645a69e67359136813721028c8205c19d6bc2970b7b6b48a9042c3b65c07ff3f349cd55426c4e09c63da6ce53f7fc2feaa171
7
- data.tar.gz: d282c24bf6db2e084b93d7ab48625859483ff85ea00b93801475f297fac02d4190652546a8e5e46a4f9c11b9b30e681cfd54d99c4c62d5341460d495939ed36a
6
+ metadata.gz: c1905bb61805123c4fc156b81bca20d8d884341eb69210ac4d5b450bf239574520d73e879d8a27406ee4e7bffe21e6740de6c0706195ba630ff16f297c3ddd81
7
+ data.tar.gz: 10dc82a07b862085be82c8c8b17df89d3fff79b99e4ee058091816a4febaf7029f5746b89feee88332b3ecc5be02a0f3924f8259db454f44984ce14682fb9101
@@ -13,7 +13,17 @@ class Add < AuthManager::Validation
13
13
 
14
14
  private
15
15
 
16
+ def available_login?(param, liste)
17
+ all = @redis.smembers(liste)
18
+ all.each do |member|
19
+ member_json = JSON.parse(member)
20
+ param_json = JSON.parse(param)
21
+ member_json['login'] == param_json['login'] ? false : true
22
+ end
23
+ end
24
+
16
25
  def save_this(liste, params)
26
+ available_login?(params, liste)
17
27
  @redis.sadd(liste, params)
18
28
  end
19
29
 
@@ -1,3 +1,3 @@
1
1
  module AuthManager
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - atacraft && fabira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-06 00:00:00.000000000 Z
11
+ date: 2014-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler