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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/app.rb +5 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 908dcc3f26f7323db797266f86a90302cd35f9ae
4
- data.tar.gz: a2d50d09a534f2ff87adc6c436183918dfc4ab4c
3
+ metadata.gz: 8515e7eb44887b460c1f4d1cad71ad8f89e7285a
4
+ data.tar.gz: c16e96707669c4c2c578ef0b097f30171956eea6
5
5
  SHA512:
6
- metadata.gz: 36548c2f9fd735eafd4acc7fb6056be9e39f20635cd6ed687defc8daa8a1fd5dc1d776d2d9572c3d510b6a069814ce03a0807c16640eae9ffa393b6e86b30940
7
- data.tar.gz: b1df40de57df2ca347f8a5c385d38d7fe700614973ad2a7fc0b0a933105b5512ed1587562cde4f4899582c7522191f017035a4b0f00d0e9ca41920e20613a32b
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
- get "/" do
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 then halt 404, "wrong gem added: #{new_gem}" unless new_gem.first.values_at('name', 'version') == [gem_name, version]
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
 
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.53.18
4
+ version: 2016.06.09.23.56.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - example@example.com