mushin_ext_github 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Github/version.rb +1 -1
- data/lib/mushin_ext_github.rb +12 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cb18c3b5f3a2cd9ff2002bf9fad3ac4b9e8cad6
|
4
|
+
data.tar.gz: 03a4809fb83c8a73ff43d5304011dec66417c26b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2e9f7bc202f3c2cb61e323c9f7f81ae5666e4f8f0ab2cc73a5dc4b074e5e802bee1df19757cdd84e45ecb7fd47bbac8b8abe9f95af12bbd5560799f2f7a9f31
|
7
|
+
data.tar.gz: d7466b06bb7cbf80a81f306b0d4ad6132ac280deb96ea751a0640b5120eb2ab1cb7d75966c9747638f7157c2a821089ff8d6ad575a4d22a7826415d095a6f9c9
|
data/lib/Github/version.rb
CHANGED
data/lib/mushin_ext_github.rb
CHANGED
@@ -11,6 +11,11 @@ module Github
|
|
11
11
|
@opts = opts
|
12
12
|
@params = params
|
13
13
|
end
|
14
|
+
|
15
|
+
def check_params *keys
|
16
|
+
return (keys.all? {|key| (@params.key?(key) && !@params[key].nil?)})
|
17
|
+
end
|
18
|
+
|
14
19
|
def call env
|
15
20
|
env ||= Hash.new
|
16
21
|
|
@@ -26,17 +31,16 @@ module Github
|
|
26
31
|
env[:login] = user.login
|
27
32
|
|
28
33
|
#TODO in case of private repos the clone_url should be prefixed with a token and passed to other domain extenstions to handle the local work
|
29
|
-
if
|
34
|
+
if check_params(:username, :reponame) then
|
30
35
|
@slug = @params[:username] + "/" + @params[:reponame]
|
31
|
-
|
32
|
-
env[:repo_metadata] = @client.repo(@slug).to_h
|
33
|
-
env[:clone_url] = @client.repo(@slug).clone_url
|
34
|
-
elsif !@params[:slug].nil? then
|
36
|
+
elsif check_params(:slug) then
|
35
37
|
@slug = @params[:slug]
|
36
|
-
env[:slug] = @slug
|
37
|
-
env[:repo_metadata] = @client.repo(@slug).to_h
|
38
|
-
env[:clone_url] = @client.repo(@slug).clone_url
|
39
38
|
end
|
39
|
+
|
40
|
+
env[:slug] = @slug
|
41
|
+
env[:repo_metadata] = @client.repo(@slug).to_h unless @slug.nil?
|
42
|
+
env[:clone_url] = @client.repo(@slug).clone_url unless @slug.nil?
|
43
|
+
|
40
44
|
@app.call(env)
|
41
45
|
#outbound code
|
42
46
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mushin_ext_github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zotherstupidguy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|