segiddins-test-gem 2016.06.09.23.53.18 → 2016.06.09.23.56.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app.rb +5 -2
- 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: 8515e7eb44887b460c1f4d1cad71ad8f89e7285a
|
4
|
+
data.tar.gz: c16e96707669c4c2c578ef0b097f30171956eea6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5796b1dd2f09dcafd2f78a169c2f369f0d77b794604b50fc333f948d4a0b1d7256c7f8f0597c46b30aeb9918b54b2cec24da31466566033a655d2cb3d519ac61
|
7
|
+
data.tar.gz: aca9ea889185c901a2903a859d06e87ba38df3a274dcdc25e9bb270316a0cd2695e39297010d31350b1c180ae8216c4e47bde19ef34fa9f43fe1a9125f914a43
|
data/app.rb
CHANGED
@@ -47,7 +47,7 @@ def get_info(name)
|
|
47
47
|
Net::HTTP.get('index.rubygems.org', "/info/#{name}")
|
48
48
|
end
|
49
49
|
|
50
|
-
|
50
|
+
post "/" do
|
51
51
|
halt 401, "token does not match" unless ENV["TOKEN"] == params['token']
|
52
52
|
|
53
53
|
version = params.fetch('version') { Time.now.strftime("%Y.%m.%d.%H.%M.%S") }
|
@@ -70,7 +70,10 @@ get "/" do
|
|
70
70
|
new_gem = get_dependency_api(gem_name) - dependency_endpoint
|
71
71
|
case new_gem.size
|
72
72
|
when 0 then halt 404, "gem not added to dependency API"
|
73
|
-
when 1
|
73
|
+
when 1
|
74
|
+
unless new_gem.first.values_at('name', 'number', 'platform', 'dependencies') == [gem_name, version, 'ruby', [['foo', '~> 1.0']]]
|
75
|
+
halt 404, "wrong gem added: #{new_gem}"
|
76
|
+
end
|
74
77
|
else halt 404, "too many new gems added: #{new_gem}"
|
75
78
|
end
|
76
79
|
|