gemirro 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gemirro might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a27216c3e7f57ead579ec183d3f266b06a67450c
4
- data.tar.gz: 0c90923f014ab3d15d75ccc8e6e6c48320ffddc4
3
+ metadata.gz: c6318523920b6520d0b923a6dd48a17f9a3a8b8d
4
+ data.tar.gz: 9a2b31b7ca5663053595aabe05c386da53278e66
5
5
  SHA512:
6
- metadata.gz: 216bf415b374c5fa3a95b3fc3dc7e15c7ad03a59de69fb83eb3f16ea3e61633b21d01b71370bd580d1e826cbf6b429cd4b8a8c9ca8bd3f7776e11a268ea7c22e
7
- data.tar.gz: fcebca52be22d67439c6b4897959667e9afaf9890765d2cd06b19cdfca4e8d1d113744c2267835f8ec15afda413bbbafcad64375525ce2a0d78d4e78e8e55c33
6
+ metadata.gz: ee46ebb3b5eed46f4c34836d7a17c5d4eddf6024f14344e4095a4d8bd8c61f644b6ca906a1f5615c40d6132b52fb028853059d2301454255d2916331e96ff9bc
7
+ data.tar.gz: 0eaa5e5ce06015dc73b2dc9c387d162af14964c9ab0774d0f8a51ea6544162b6dba70d34cfb3fe2f138b9865e6236f265d30c41c1fd5851bceccf1f606a8b628
data/.gitignore CHANGED
@@ -3,3 +3,4 @@ coverage
3
3
  Gemfile.lock
4
4
  pkg
5
5
  .ruby-version
6
+ *.gem
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Gemirro | [![Build Status](https://travis-ci.org/PierreRambaud/gemirro.svg)](https://travis-ci.org/PierreRambaud/gemirro) [![Gem Version](https://badge.fury.io/rb/gemirro.svg)](http://badge.fury.io/rb/gemirro)
1
+ # Gemirro | [![Build Status](https://travis-ci.org/PierreRambaud/gemirro.svg?branch=master)](https://travis-ci.org/PierreRambaud/gemirro) [![Gem Version](https://badge.fury.io/rb/gemirro.svg)](http://badge.fury.io/rb/gemirro)
2
2
 
3
3
  Gemirro is a Ruby application that makes it easy way to create your own RubyGems mirror without having to push or write all gem you wanted in a configuration file.
4
4
  It does mirroring without any authentication and you can add your private gems in the `gems` directory.
@@ -91,7 +91,7 @@ server {
91
91
 
92
92
  location / {
93
93
  proxy_pass http://gemirro;
94
- proxy_set_header Host $host;
94
+ proxy_set_header Host $http_host;
95
95
  proxy_set_header X-Real-IP $remote_addr;
96
96
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
97
97
  }
data/gemirro.gemspec CHANGED
@@ -18,16 +18,16 @@ Gem::Specification.new do |s|
18
18
  s.required_ruby_version = '>= 1.9.2'
19
19
 
20
20
  s.add_dependency 'slop', '~>3.6'
21
- s.add_dependency 'httpclient', '~>2.4'
22
- s.add_dependency 'confstruct', '~>0.2'
21
+ s.add_dependency 'httpclient', '~>2.6'
22
+ s.add_dependency 'confstruct', '~>1.0'
23
23
  s.add_dependency 'builder', '~>3.2'
24
24
  s.add_dependency 'sinatra', '~>1.4'
25
25
  s.add_dependency 'thin', '~>1.6'
26
26
 
27
- s.add_development_dependency 'rake', '~>10.0'
27
+ s.add_development_dependency 'rake', '~>10.4'
28
28
  s.add_development_dependency 'rack-test', '~>0.6'
29
- s.add_development_dependency 'rspec', '~>3.0'
29
+ s.add_development_dependency 'rspec', '~>3.2'
30
30
  s.add_development_dependency 'simplecov', '~>0.9'
31
- s.add_development_dependency 'rubocop', '~>0.28'
32
- s.add_development_dependency 'fakefs', '~>0.6.4'
31
+ s.add_development_dependency 'rubocop', '~>0.30'
32
+ s.add_development_dependency 'fakefs', '~>0.6.7'
33
33
  end
@@ -5,12 +5,13 @@ module Gemirro
5
5
  # @return [Gemirro::Configuration]
6
6
  #
7
7
  def self.configuration
8
- @configuration ||= Configuration.new do
9
- server do
10
- access_log '/tmp/gemirro.access.log'
11
- error_log '/tmp/gemirro.error.log'
12
- end
13
- end
8
+ default_config = {
9
+ server: {
10
+ access_log: '/tmp/gemirro.access.log',
11
+ error_log: '/tmp/gemirro.access.log'
12
+ }
13
+ }
14
+ @configuration ||= Configuration.new(default_config)
14
15
  end
15
16
 
16
17
  ##
@@ -45,7 +45,7 @@ module Gemirro
45
45
  end
46
46
 
47
47
  files.each do |path|
48
- file = path.sub(/^#{Regexp.escape @directory}\/?/, '')
48
+ file = path.sub(%r{^#{Regexp.escape @directory}/?}, '')
49
49
  dst_name = File.join @dest_directory, file
50
50
 
51
51
  if ["#{@specs_index}.gz",
@@ -106,7 +106,7 @@ module Gemirro
106
106
  files = build_marshal_gemspecs
107
107
 
108
108
  files.each do |path|
109
- file = path.sub(/^#{Regexp.escape @directory}\/?/, '')
109
+ file = path.sub(%r{^#{Regexp.escape @directory}/?}, '')
110
110
  src_name = File.join @directory, file
111
111
  dst_name = File.join @dest_directory, file
112
112
  FileUtils.mv(src_name, dst_name)
@@ -39,7 +39,7 @@ module Gemirro
39
39
  set :views, Gemirro::Configuration.views_directory
40
40
  set :port, config.server.port
41
41
  set :bind, config.server.host
42
- set :public_folder, config.destination.gsub(/\/$/, '')
42
+ set :public_folder, config.destination.gsub(%r{/$}, '')
43
43
  set :environment, config.environment
44
44
  set :dump_errors, true
45
45
  set :raise_errors, true
@@ -81,6 +81,26 @@ module Gemirro
81
81
  erb(:index)
82
82
  end
83
83
 
84
+ ##
85
+ # Return gem dependencies as binary
86
+ #
87
+ # @return [nil]
88
+ #
89
+ get '/api/v1/dependencies' do
90
+ content_type 'application/octet-stream'
91
+ query_gems.any? ? Marshal.dump(query_gems_list) : 200
92
+ end
93
+
94
+ ##
95
+ # Return gem dependencies as json
96
+ #
97
+ # @return [nil]
98
+ #
99
+ get '/api/v1/dependencies.json' do
100
+ content_type 'application/json'
101
+ query_gems.any? ? JSON.dump(query_gems_list) : {}
102
+ end
103
+
84
104
  ##
85
105
  # Try to get all request and download files
86
106
  # if files aren't found.
@@ -154,8 +174,8 @@ module Gemirro
154
174
  # @see Gemirro::VersionsFetcher.fetch
155
175
  #
156
176
  def versions_fetcher
157
- @versions_fetcher ||= Gemirro::VersionsFetcher.new(
158
- configuration.source).fetch
177
+ @versions_fetcher ||= Gemirro::VersionsFetcher
178
+ .new(configuration.source).fetch
159
179
  end
160
180
 
161
181
  ##
@@ -166,6 +186,15 @@ module Gemirro
166
186
  configuration.source, versions_fetcher)
167
187
  end
168
188
 
189
+ ##
190
+ # Return all gems pass to query
191
+ #
192
+ # @return [Array]
193
+ #
194
+ def query_gems
195
+ params[:gems].to_s.split(',')
196
+ end
197
+
169
198
  ##
170
199
  # @see Gemirro::Configuration#logger
171
200
  # @return [Logger]
@@ -191,6 +220,54 @@ module Gemirro
191
220
  GemVersionCollection.new(gems)
192
221
  end
193
222
 
223
+ ##
224
+ # Return gems list from query params
225
+ #
226
+ # @return [Array]
227
+ #
228
+ def query_gems_list
229
+ query_gems.flat_map do |query_gem|
230
+ gem_dependencies(query_gem)
231
+ end
232
+ end
233
+
234
+ ##
235
+ # List of versions and dependencies of each version
236
+ # from a gem name.
237
+ #
238
+ # @return [Array]
239
+ #
240
+ def gem_dependencies(gem_name)
241
+ gems = gems_collection
242
+ gem_collection = gems.find_by_name(gem_name)
243
+ return '' if gem_collection.nil?
244
+
245
+ gem_collection = gem_collection.map do |gem|
246
+ [gem, spec_for(gem.name, gem.number, gem.platform)]
247
+ end
248
+
249
+ gem_collection.reject! do |_, spec|
250
+ spec.nil?
251
+ end
252
+
253
+ gem_collection.map do |gem, spec|
254
+ dependencies = spec.dependencies.select do |d|
255
+ d.type == :runtime
256
+ end
257
+
258
+ dependencies.map! do |d|
259
+ [d.name.is_a?(Array) ? d.name.first : d.name, d.requirement.to_s]
260
+ end
261
+
262
+ {
263
+ name: gem.name,
264
+ number: gem.number,
265
+ platform: gem.platform,
266
+ dependencies: dependencies
267
+ }
268
+ end
269
+ end
270
+
194
271
  ##
195
272
  # Return specs fils paths
196
273
  #
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Gemirro Version
3
3
  module Gemirro
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.0'
5
5
  end
data/lib/gemirro.rb CHANGED
@@ -10,6 +10,7 @@ require 'zlib'
10
10
  require 'httpclient'
11
11
  require 'logger'
12
12
  require 'stringio'
13
+ require 'json'
13
14
 
14
15
  unless $LOAD_PATH.include?(File.expand_path('../', __FILE__))
15
16
  $LOAD_PATH.unshift(File.expand_path('../', __FILE__))
@@ -68,7 +68,7 @@ module Gemirro
68
68
  end
69
69
 
70
70
  it 'should return ignored gems' do
71
- expect(@config.ignored_gems).to eq(Hash.new)
71
+ expect(@config.ignored_gems).to eq({})
72
72
  expect(@config.ignore_gem?('rake', '1.0.0')).to be_falsy
73
73
  expect(@config.ignore_gem('rake', '1.0.0')).to eq(['1.0.0'])
74
74
  expect(@config.ignored_gems).to eq('rake' => ['1.0.0'])
@@ -97,8 +97,8 @@ module Gemirro
97
97
 
98
98
  indexer = Indexer.new('/')
99
99
 
100
- dir.add_directory("#{indexer.directory.gsub(/^\//, '')}/gems")
101
- dir.add_directory("#{indexer.directory.gsub(/^\//, '')}/quick")
100
+ dir.add_directory("#{indexer.directory.gsub(%r{^/}, '')}/gems")
101
+ dir.add_directory("#{indexer.directory.gsub(%r{^/}, '')}/quick")
102
102
  MirrorFile.new('/specs.4.8').write('')
103
103
  MirrorFile.new("#{indexer.directory}/gems/gemirro-0.1.0.gem").write('')
104
104
  MirrorFile.new('gems/gemirro-0.1.0.gem').write('')
@@ -1,5 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'rack/test'
3
+ require 'json'
3
4
  require 'gemirro/mirror_directory'
4
5
  require 'gemirro/mirror_file'
5
6
  require 'gemirro/gem_version_collection'
@@ -33,117 +34,199 @@ module Gemirro
33
34
  FakeFS::FileSystem.clone(Gemirro::Configuration.views_directory)
34
35
  end
35
36
 
36
- it 'should display index page' do
37
- allow(Logger).to receive(:new).twice.and_return(@fake_logger)
38
- allow(@fake_logger).to receive(:tap).and_return(nil)
39
- .and_yield(@fake_logger)
40
-
41
- get '/'
42
- expect(last_response).to be_ok
43
- end
44
-
45
- it 'should return 404' do
46
- get '/wrong-path'
47
- expect(last_response.status).to eq(404)
48
- expect(last_response).to_not be_ok
49
- end
50
-
51
- it 'should return 404 when gem does not exist' do
52
- get '/gem/something'
53
- expect(last_response.status).to eq(404)
54
- expect(last_response).to_not be_ok
55
- end
56
-
57
- it 'should display gem specifications' do
58
- marshal_dump = Marshal.dump([['groove-dl',
59
- ::Gem::Version.create('0.1.0'),
60
- 'ruby']])
61
-
62
- MirrorFile.new('/var/www/gemirro/specs.4.8.gz.orig').write(marshal_dump)
63
- Struct.new('SuccessGzipReader', :read)
64
- gzip_reader = Struct::SuccessGzipReader.new(marshal_dump)
65
-
66
- allow(Zlib::GzipReader).to receive(:open)
67
- .once
68
- .with('/var/www/gemirro/specs.4.8.gz.orig')
69
- .and_return(gzip_reader)
70
-
71
- get '/gem/groove-dl'
72
- expect(last_response.status).to eq(200)
73
- expect(last_response).to be_ok
74
- end
75
-
76
- it 'should download existing file' do
77
- get '/test'
78
- expect(last_response.body).to eq('content')
79
- expect(last_response).to be_ok
37
+ context 'HTML render' do
38
+ it 'should display index page' do
39
+ allow(Logger).to receive(:new).twice.and_return(@fake_logger)
40
+ allow(@fake_logger).to receive(:tap).and_return(nil)
41
+ .and_yield(@fake_logger)
42
+
43
+ get '/'
44
+ expect(last_response).to be_ok
45
+ end
46
+
47
+ it 'should return 404' do
48
+ get '/wrong-path'
49
+ expect(last_response.status).to eq(404)
50
+ expect(last_response).to_not be_ok
51
+ end
52
+
53
+ it 'should return 404 when gem does not exist' do
54
+ get '/gem/something'
55
+ expect(last_response.status).to eq(404)
56
+ expect(last_response).to_not be_ok
57
+ end
58
+
59
+ it 'should display gem specifications' do
60
+ marshal_dump = Marshal.dump([['groove-dl',
61
+ ::Gem::Version.create('0.1.0'),
62
+ 'ruby']])
63
+
64
+ MirrorFile.new('/var/www/gemirro/specs.4.8.gz.orig').write(marshal_dump)
65
+ Struct.new('SuccessGzipReader', :read)
66
+ gzip_reader = Struct::SuccessGzipReader.new(marshal_dump)
67
+
68
+ allow(Zlib::GzipReader).to receive(:open)
69
+ .once
70
+ .with('/var/www/gemirro/specs.4.8.gz.orig')
71
+ .and_return(gzip_reader)
72
+
73
+ get '/gem/groove-dl'
74
+ expect(last_response.status).to eq(200)
75
+ expect(last_response).to be_ok
76
+ end
80
77
  end
81
78
 
82
- it 'should try to download gems.' do
83
- source = Gemirro::Source.new('test', 'http://rubygems.org')
84
-
85
- versions_fetcher = Gemirro::VersionsFetcher.new(source)
86
- allow(versions_fetcher).to receive(:fetch).once.and_return(true)
87
-
88
- gems_fetcher = Gemirro::VersionsFetcher.new(source)
89
- allow(gems_fetcher).to receive(:fetch).once.and_return(true)
90
-
91
- Struct.new('GemIndexer')
92
- gem_indexer = Struct::GemIndexer.new
93
- allow(gem_indexer).to receive(:only_origin=).once.and_return(true)
94
- allow(gem_indexer).to receive(:ui=).once.and_return(true)
95
- allow(gem_indexer).to receive(:generate_index).once.and_return(true)
96
-
97
- allow(Gemirro.configuration).to receive(:source).twice.and_return(source)
98
- allow(Gemirro::GemsFetcher).to receive(:new).once.and_return(gems_fetcher)
99
- allow(Gemirro::VersionsFetcher).to receive(:new)
100
- .once.and_return(versions_fetcher)
101
- allow(Gemirro::Indexer).to receive(:new).once.and_return(gem_indexer)
102
- allow(::Gem::SilentUI).to receive(:new).once.and_return(true)
103
-
104
- allow(Gemirro.configuration).to receive(:logger)
105
- .exactly(3).and_return(@fake_logger)
106
- allow(@fake_logger).to receive(:info).exactly(3)
107
-
108
- get '/gems/gemirro-0.0.1.gem'
109
- expect(last_response).to_not be_ok
110
- expect(last_response.status).to eq(404)
111
-
112
- MirrorFile.new('/var/www/gemirro/gems/gemirro-0.0.1.gem').write('content')
113
- get '/gems/gemirro-0.0.1.gem'
114
- expect(last_response).to be_ok
115
- expect(last_response.status).to eq(200)
116
- expect(last_response.body).to eq('content')
79
+ context 'Download' do
80
+ it 'should download existing file' do
81
+ get '/test'
82
+ expect(last_response.body).to eq('content')
83
+ expect(last_response).to be_ok
84
+ end
85
+
86
+ it 'should try to download gems.' do
87
+ source = Gemirro::Source.new('test', 'http://rubygems.org')
88
+
89
+ versions_fetcher = Gemirro::VersionsFetcher.new(source)
90
+ allow(versions_fetcher).to receive(:fetch).once.and_return(true)
91
+
92
+ gems_fetcher = Gemirro::VersionsFetcher.new(source)
93
+ allow(gems_fetcher).to receive(:fetch).once.and_return(true)
94
+
95
+ Struct.new('GemIndexer')
96
+ gem_indexer = Struct::GemIndexer.new
97
+ allow(gem_indexer).to receive(:only_origin=).once.and_return(true)
98
+ allow(gem_indexer).to receive(:ui=).once.and_return(true)
99
+ allow(gem_indexer).to receive(:generate_index).once.and_return(true)
100
+
101
+ allow(Gemirro.configuration).to receive(:source)
102
+ .twice.and_return(source)
103
+ allow(Gemirro::GemsFetcher).to receive(:new)
104
+ .once.and_return(gems_fetcher)
105
+ allow(Gemirro::VersionsFetcher).to receive(:new)
106
+ .once.and_return(versions_fetcher)
107
+ allow(Gemirro::Indexer).to receive(:new).once.and_return(gem_indexer)
108
+ allow(::Gem::SilentUI).to receive(:new).once.and_return(true)
109
+
110
+ allow(Gemirro.configuration).to receive(:logger)
111
+ .exactly(3).and_return(@fake_logger)
112
+ allow(@fake_logger).to receive(:info).exactly(3)
113
+
114
+ get '/gems/gemirro-0.0.1.gem'
115
+ expect(last_response).to_not be_ok
116
+ expect(last_response.status).to eq(404)
117
+
118
+ MirrorFile.new('/var/www/gemirro/gems/gemirro-0.0.1.gem')
119
+ .write('content')
120
+ get '/gems/gemirro-0.0.1.gem'
121
+ expect(last_response).to be_ok
122
+ expect(last_response.status).to eq(200)
123
+ expect(last_response.body).to eq('content')
124
+ end
125
+
126
+ it 'should catch exceptions' do
127
+ source = Gemirro::Source.new('test', 'http://rubygems.org')
128
+
129
+ versions_fetcher = Gemirro::VersionsFetcher.new(source)
130
+ allow(versions_fetcher).to receive(:fetch).once.and_return(true)
131
+
132
+ gems_fetcher = Gemirro::VersionsFetcher.new(source)
133
+ allow(gems_fetcher).to receive(:fetch)
134
+ .once.and_raise(StandardError, 'Not ok')
135
+
136
+ gem_indexer = Struct::GemIndexer.new
137
+ allow(gem_indexer).to receive(:only_origin=).once.and_return(true)
138
+ allow(gem_indexer).to receive(:ui=).once.and_return(true)
139
+ allow(gem_indexer).to receive(:generate_index)
140
+ .once.and_raise(SystemExit)
141
+
142
+ allow(Gemirro.configuration).to receive(:source)
143
+ .twice.and_return(source)
144
+ allow(Gemirro::GemsFetcher).to receive(:new)
145
+ .once.and_return(gems_fetcher)
146
+ allow(Gemirro::VersionsFetcher).to receive(:new)
147
+ .once.and_return(versions_fetcher)
148
+ allow(Gemirro::Indexer).to receive(:new).once.and_return(gem_indexer)
149
+ allow(::Gem::SilentUI).to receive(:new).once.and_return(true)
150
+
151
+ allow(Gemirro.configuration).to receive(:logger)
152
+ .exactly(4).and_return(@fake_logger)
153
+ allow(@fake_logger).to receive(:info).exactly(3)
154
+ allow(@fake_logger).to receive(:error)
155
+ get '/gems/gemirro-0.0.1.gem'
156
+ expect(last_response).to_not be_ok
157
+ end
117
158
  end
118
159
 
119
- it 'should catch exceptions' do
120
- source = Gemirro::Source.new('test', 'http://rubygems.org')
121
-
122
- versions_fetcher = Gemirro::VersionsFetcher.new(source)
123
- allow(versions_fetcher).to receive(:fetch).once.and_return(true)
124
-
125
- gems_fetcher = Gemirro::VersionsFetcher.new(source)
126
- allow(gems_fetcher).to receive(:fetch).once.and_raise(
127
- StandardError, 'Not ok')
128
-
129
- gem_indexer = Struct::GemIndexer.new
130
- allow(gem_indexer).to receive(:only_origin=).once.and_return(true)
131
- allow(gem_indexer).to receive(:ui=).once.and_return(true)
132
- allow(gem_indexer).to receive(:generate_index).once.and_raise(SystemExit)
133
-
134
- allow(Gemirro.configuration).to receive(:source).twice.and_return(source)
135
- allow(Gemirro::GemsFetcher).to receive(:new).once.and_return(gems_fetcher)
136
- allow(Gemirro::VersionsFetcher).to receive(:new)
137
- .once.and_return(versions_fetcher)
138
- allow(Gemirro::Indexer).to receive(:new).once.and_return(gem_indexer)
139
- allow(::Gem::SilentUI).to receive(:new).once.and_return(true)
140
-
141
- allow(Gemirro.configuration).to receive(:logger)
142
- .exactly(4).and_return(@fake_logger)
143
- allow(@fake_logger).to receive(:info).exactly(3)
144
- allow(@fake_logger).to receive(:error)
145
- get '/gems/gemirro-0.0.1.gem'
146
- expect(last_response).to_not be_ok
160
+ context 'dependencies' do
161
+ it 'should retrieve nothing' do
162
+ get '/api/v1/dependencies'
163
+ expect(last_response.headers['Content-Type'])
164
+ .to eq('application/octet-stream')
165
+ expect(last_response.body).to eq('')
166
+ expect(last_response).to be_ok
167
+ end
168
+
169
+ it 'should retrieve empty json' do
170
+ get '/api/v1/dependencies.json'
171
+ expect(last_response.headers['Content-Type'])
172
+ .to eq('application/json')
173
+ expect(last_response.body).to eq('')
174
+ expect(last_response).to be_ok
175
+ end
176
+
177
+ it 'should retrieve empty json when gem was not found' do
178
+ get '/api/v1/dependencies.json?gems=gemirro'
179
+ expect(last_response.headers['Content-Type'])
180
+ .to eq('application/json')
181
+ expect(last_response.body).to eq('[""]')
182
+ expect(last_response).to be_ok
183
+ end
184
+
185
+ it 'should retrieve empty json when gem was not found' do
186
+ MirrorDirectory.new('/var/www/gemirro')
187
+ .add_directory('quick/Marshal.4.8')
188
+ MirrorFile.new('/var/www/gemirro/quick/Marshal.4.8/' \
189
+ 'volay-0.1.0.gemspec.rz')
190
+ .write("x\x9C\x8D\x94]\x8F\xD2@\x14\x86\x89Y\xBB\xB4|\xEC\x12\xD7h" \
191
+ "\xD4h\xD3K\x13J\x01\x97\xC84n\x9A\xA8\xBBi\xE2\xC5\x06\xBB" \
192
+ "{\xC3\x85)\xE5\x00\x13f:u:E\xD1\xC4\xDF\xE6\xB5\xBF\xCAiK" \
193
+ "\x11\xE3GK\xEF\x98\xF7\xBC\xCFy\xCF\xC9\xCCQ=A\x0F\xAE\x80" \
194
+ "\"\xF4>\x82\x00/p\xE0\v\xCC\xC2;\xC1\xDD\xA3\xFA\xF4\xA1k4" \
195
+ "\x06\xA6e\xF6_(Hy\xEBa\xD55\xB4\r#\xFEV\xB1k\xDE\r\xEAdu" \
196
+ "\xB7\xC0cY1U\xE4\xA1\x95\x8A\xD3C7A\xAA\x87)\xB4\x9C\x1FO" \
197
+ "\xBE\xD7\xE4OA\xEA\x17\x16\x82k\xD4o\xBC\xD7\x99\xC2x\xEC" \
198
+ "\xAD@\xBFe$\xA1\xA0\xC7\xDBX\x00\xD5\x05/\xBC\xEFg\xDE\x13" \
199
+ "\xF8\x98`\x0E\x14B1U\xE4w\xEC\x1A\xC7\x17\xAF2\x85\xADd\xC4" \
200
+ "\xBE96\x87\xF9\x1F\xEA\xDF%\x8A\x95\xE3T\x9E\xCC2\xF3i\x9B" \
201
+ "\xA1\xB3\xCC\xFE\rD\x10\xCE!\f\xB6\x1A\xD2\x9C\xD0\xA7\xB2" \
202
+ "\xBF\x13\x8A?\x13<\xEB\x06\x04\xA7b\xD4q\xF8\xAF&\x0E!\xDF" \
203
+ ".~\xEF\xE3\xDC\xCC@\xD2Hl\#@M\x9E\x84BN\x00\x9D:\x11\a\x0E" \
204
+ "\x04\xFC\x18.\xD1#g\x93\xCF\xEB\xC3\x81m\\\xC1\x97\xD9" \
205
+ "\x9Af7\\\xE3l\xD7_\xBC\x02BX\"\xD23\xBB\xF9o\x83A\xB1\x12" \
206
+ "\xBBe\xB7\xED\x93K\xFB\xB4\x82\xB6\x80\xA9K\xB1\x1E\x96" \
207
+ "\x10\xEA\x03sP\xCD\xBFP\x16\xEE\x8D\x85\xBF\x86E\\\x96" \
208
+ "\xC02G\xF9\b\xEC\x16:\x9D\xC3\x06\b\x8B\xD2\xA9\x95\x84" \
209
+ "\xD9\x97\xED\xC3p\x89+\x81\xA9}\xAB`\xD9\x9D\xFF\x03\xF6" \
210
+ "\xD2\xC2\xBF\xCD\xFD`\xDD\x15\x10\x97\xED\xA4.[\xAB\xC6(" \
211
+ "\x94\x05B\xE3\xB1\xBC\xA5e\xF6\xC3\xAA\x11\n\xE5>A\x8CiD " \
212
+ "`\x9B\xF2\x04\xE3\xCA\t\xC6\x87\by-f,`Q\xD9\x1E,sp^q\x0F" \
213
+ "\x85\xD4r\x8Dg\x11\x06\xCE\xC1\xE4>\x9D\xF9\xC9\xFC\xE5" \
214
+ "\xC8YR\x1F\x133`4\xBB\xF9R~\xEF:\x93\xE8\x93\\\x92\xBF\r" \
215
+ "\xA3\t\xF8\x84l\xF5<\xBF\xBE\xF9\xE3Q\xD2?q,\x04\x84:\x0E" \
216
+ "\xF5\xF4\x1D1\xF3\xBA\xE7+!\"\xD4\xEB-\xB1X%\xB3\x14\xD3" \
217
+ "\xCB\xEDw\xEE\xBD\xFDk\xE99OSz\xF3\xEA\xFA]w7\xF5\xAF\xB5" \
218
+ "\x9F+\xFEG\x96")
219
+
220
+ gem = Gemirro::GemVersion.new('volay', '0.1.0', 'ruby')
221
+ collection = Gemirro::GemVersionCollection.new([gem])
222
+ allow_any_instance_of(Gemirro::Server).to receive(:gems_collection)
223
+ .and_return(collection)
224
+ get '/api/v1/dependencies.json?gems=volay'
225
+ expect(last_response.headers['Content-Type'])
226
+ .to eq('application/json')
227
+ expect(last_response.body).to match(/"name":"volay"/)
228
+ expect(last_response).to be_ok
229
+ end
147
230
  end
148
231
  end
149
232
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemirro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Rambaud
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.4'
33
+ version: '2.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '2.4'
40
+ version: '2.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: confstruct
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.2'
47
+ version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.2'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: builder
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '10.0'
103
+ version: '10.4'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '10.0'
110
+ version: '10.4'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rack-test
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '3.0'
131
+ version: '3.2'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '3.0'
138
+ version: '3.2'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: simplecov
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -156,28 +156,28 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '0.28'
159
+ version: '0.30'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0.28'
166
+ version: '0.30'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: fakefs
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 0.6.4
173
+ version: 0.6.7
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 0.6.4
180
+ version: 0.6.7
181
181
  description: Create your own gem mirror with a simple TCPServer.
182
182
  email: pierre.rambaud86@gmail.com
183
183
  executables:
@@ -269,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
269
269
  version: '0'
270
270
  requirements: []
271
271
  rubyforge_project:
272
- rubygems_version: 2.0.14
272
+ rubygems_version: 2.4.6
273
273
  signing_key:
274
274
  specification_version: 4
275
275
  summary: Gem for easily creating your own RubyGems mirror.