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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/app.rb +8 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d85013f7db71c22d21a28d5a106c66fc89f73ce
4
- data.tar.gz: ed758ef36add9d3dd74ec474b3ea75d355efe252
3
+ metadata.gz: 584a886edbba461b6409fb60d7aedb0ac63be28f
4
+ data.tar.gz: b0bc849813f3743cc50febe352dc814658d5c3b0
5
5
  SHA512:
6
- metadata.gz: 2e3f513fb1b5403b14f103a04a600b49a775bd78d044c13e50fa48ebe31347b101458610c8d99f1060210824dc5a367082d7753d1a44c893c63b92a3bb2c93a8
7
- data.tar.gz: 84cb7e5f2813ee65c91eb523494d5fabc34af090d8c6594de484118a535454d090444fdb6080fe776d5572f0d4e77030d098c8804f52cff9c99c7a9e9920f4f2
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 = get_json('index.rubygems.org', "/api/v1/dependencies.json?gems=#{gem_name}")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: segiddins-test-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 2016.06.09.23.04.48
4
+ version: 2016.06.09.23.06.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - example@example.com