segiddins-test-gem 2016.06.09.23.04.48 → 2016.06.09.23.06.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app.rb +8 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 584a886edbba461b6409fb60d7aedb0ac63be28f
|
4
|
+
data.tar.gz: b0bc849813f3743cc50febe352dc814658d5c3b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f6e18145d4257973db304c14622306b37535bbae01d19038f154c43e4764500a3a7aef021bdfd1cbe796162c5406a29acb3d3ba89c2402974b43c9d9f6c5e48
|
7
|
+
data.tar.gz: 41a5c92a98d3194e6e402847367e0734aab3019584f12a95cbf129706928324aaf320b5ed03b3f3199f6198ea266af5bad5e5fb2e2ce0574e7899b71273adadd
|
data/app.rb
CHANGED
@@ -27,13 +27,20 @@ def push!(name, version)
|
|
27
27
|
Gem::GemRunner.new.run(%W(push #{file}))
|
28
28
|
end
|
29
29
|
|
30
|
+
def get_dependency_api(gem_name)
|
31
|
+
get_json('index.rubygems.org', "/api/v1/dependencies.json?gems=#{gem_name}")
|
32
|
+
end
|
33
|
+
|
30
34
|
get "/" do
|
31
35
|
halt 401, "token does not match" unless ENV["TOKEN"] == params['token']
|
32
36
|
|
33
37
|
version = params.fetch('version') { Time.now.strftime("%Y.%m.%d.%H.%M.%S") }
|
34
38
|
gem_name = ENV.fetch('GEM_NAME') { 'segiddins-test-gem' }
|
35
39
|
|
36
|
-
dependency_endpoint =
|
40
|
+
dependency_endpoint = get_dependency_api(gem_name)
|
37
41
|
|
38
42
|
push!(gem_name, version)
|
43
|
+
|
44
|
+
new_gem = dependency_endpoint - get_dependency_api(gem_name)
|
45
|
+
halt new_gem.to_json
|
39
46
|
end
|