mumukit-auth 2.1.0 → 2.2.0

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: ff7c69435ecb899c5608c46cbed9be525b22070d
4
- data.tar.gz: 2f346c4d3278634444c8869610e4ee6a22e4f01e
3
+ metadata.gz: 822a6899489c66e29fcf58843040f7db681eb322
4
+ data.tar.gz: 2b8d6099424c7d62797275bf01f425b888907901
5
5
  SHA512:
6
- metadata.gz: 7f96bd977dae66d8eace8ab3e4f842e2794e65ebe4c60ec0ea3deeb18fa1025e74e4601cf54c4d814593a8ec2ca27e79e66111a90e8e64d184d65a5c2eea1e4a
7
- data.tar.gz: 1f7202678e723cd41214f426f267f1e2203d03036ef6803bcb8ef4c49cb08d6e479bbfaae02f8aca06043c0f9f32b822a464132cc7aac9f874a76077cb45dd56
6
+ metadata.gz: 089dfa0aa8114c662c792b1e376f365a46a8a9a00c141c98db30ea76732335dffb05926f0e0b6a347fd4b9926577aa902285c5b7c763e247250e1b0a69e5a5fc
7
+ data.tar.gz: 3b7312806588e1e707099c6f090ef4e02aa3b520b91547e84b4a2bdd06f4904219be5c4251956ab6f649980e4fc5c4f2899785b5e5e9e2e95c40e364c98ff85c
@@ -39,9 +39,24 @@ module Mumukit::Auth
39
39
  self
40
40
  end
41
41
 
42
+ def self.from_options(hash)
43
+ first = hash[:first] || hash[:organization]
44
+ second = hash[:second] || hash[:repository] || hash[:course] || hash[:content]
45
+ new(first, second)
46
+ end
47
+
42
48
  def self.join(*parts)
43
49
  raise 'Slugs must have up to two parts' if parts.length > 2
44
- new(*parts.pad_with('_', 2))
50
+
51
+ if parts.first.is_a? Hash
52
+ from_options parts.first
53
+ else
54
+ new(*parts.pad_with('_', 2))
55
+ end
56
+ end
57
+
58
+ def self.join_s(*args)
59
+ join(*args).to_s
45
60
  end
46
61
 
47
62
  def self.parse(slug)
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Auth
3
- VERSION = '2.1.0'
3
+ VERSION = '2.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli