stickler 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/HISTORY.asciidoc +17 -8
- data/LICENSE +13 -54
- data/README.asciidoc +29 -5
- data/Rakefile +11 -10
- data/TODO.asciidoc +6 -0
- data/bin/stickler +5 -2
- data/examples/fetch-a-gem +6 -0
- data/examples/gemcutter_repo.ru +1 -1
- data/lib/stickler.rb +1 -1
- data/lib/stickler/client.rb +1 -0
- data/lib/stickler/client/list.rb +30 -0
- data/lib/stickler/client/mirror.rb +5 -5
- data/lib/stickler/client/push.rb +1 -1
- data/lib/stickler/middleware/gemcutter.rb +2 -2
- data/lib/stickler/middleware/helpers.rb +37 -42
- data/lib/stickler/middleware/index.rb +51 -19
- data/lib/stickler/repository/index.rb +46 -9
- data/lib/stickler/repository/local.rb +75 -20
- data/lib/stickler/repository/null.rb +0 -2
- data/lib/stickler/repository/remote.rb +81 -64
- data/lib/stickler/repository/rubygems_authenticator.rb +3 -8
- data/lib/stickler/server.rb +1 -1
- data/lib/stickler/spec_lite.rb +13 -10
- data/lib/stickler/version.rb +2 -2
- data/man/stickler.asciidoc +3 -1
- data/spec/data/gems/foo-2.0.0a.gem +0 -0
- data/spec/index_spec_helpers.rb +71 -0
- data/spec/middleware/local_spec.rb +58 -10
- data/spec/middleware/not_found_spec.rb +1 -0
- data/spec/repository/index_spec.rb +15 -0
- data/spec/repository/local_spec.rb +20 -5
- data/spec/repository/remote_spec.rb +2 -3
- data/spec/spec.opts +1 -1
- data/spec/spec_helper.rb +8 -6
- data/spec/spec_lite_spec.rb +19 -6
- data/tasks/man.rake +1 -1
- metadata +74 -40
- data/spec/middleware/common_gem_server_helpers.rb +0 -69
- data/spec/middleware/index_spec.rb +0 -26
- data/spec/middleware/legacy_gem_server_behavior.rb +0 -31
- data/spec/middleware/modern_gem_server_behavior.rb +0 -22
data/tasks/man.rake
CHANGED
metadata
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
name: stickler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
hash: 11
|
5
|
-
prerelease:
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 2.0.2
|
10
|
+
version: 2.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeremy Hinegardner
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-03-25 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 29
|
30
30
|
segments:
|
31
31
|
- 1
|
32
|
-
-
|
33
|
-
-
|
34
|
-
version: 1.
|
32
|
+
- 2
|
33
|
+
- 1
|
34
|
+
version: 1.2.1
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
@@ -45,25 +45,25 @@ dependencies:
|
|
45
45
|
hash: 15
|
46
46
|
segments:
|
47
47
|
- 2
|
48
|
-
- 1
|
49
48
|
- 2
|
50
|
-
|
49
|
+
- 4
|
50
|
+
version: 2.2.4
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
54
|
+
name: excon
|
55
55
|
prerelease: false
|
56
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
61
|
+
hash: 27
|
62
62
|
segments:
|
63
|
-
- 1
|
64
63
|
- 0
|
65
|
-
-
|
66
|
-
|
64
|
+
- 5
|
65
|
+
- 8
|
66
|
+
version: 0.5.8
|
67
67
|
type: :runtime
|
68
68
|
version_requirements: *id003
|
69
69
|
- !ruby/object:Gem::Dependency
|
@@ -90,12 +90,12 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
hash:
|
93
|
+
hash: 3
|
94
94
|
segments:
|
95
95
|
- 1
|
96
|
-
-
|
97
|
-
-
|
98
|
-
version: 1.
|
96
|
+
- 5
|
97
|
+
- 0
|
98
|
+
version: 1.5.0
|
99
99
|
type: :runtime
|
100
100
|
version_requirements: *id005
|
101
101
|
- !ruby/object:Gem::Dependency
|
@@ -106,12 +106,12 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
hash:
|
109
|
+
hash: 21
|
110
110
|
segments:
|
111
111
|
- 3
|
112
|
-
- 4
|
113
112
|
- 6
|
114
|
-
|
113
|
+
- 5
|
114
|
+
version: 3.6.5
|
115
115
|
type: :development
|
116
116
|
version_requirements: *id006
|
117
117
|
- !ruby/object:Gem::Dependency
|
@@ -122,12 +122,12 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - ~>
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
hash:
|
125
|
+
hash: 5
|
126
126
|
segments:
|
127
127
|
- 0
|
128
128
|
- 5
|
129
|
-
-
|
130
|
-
version: 0.5.
|
129
|
+
- 7
|
130
|
+
version: 0.5.7
|
131
131
|
type: :development
|
132
132
|
version_requirements: *id007
|
133
133
|
- !ruby/object:Gem::Dependency
|
@@ -138,30 +138,62 @@ dependencies:
|
|
138
138
|
requirements:
|
139
139
|
- - ~>
|
140
140
|
- !ruby/object:Gem::Version
|
141
|
-
hash:
|
141
|
+
hash: 27
|
142
142
|
segments:
|
143
143
|
- 1
|
144
|
-
-
|
145
|
-
-
|
146
|
-
version: 1.
|
144
|
+
- 3
|
145
|
+
- 0
|
146
|
+
version: 1.3.0
|
147
147
|
type: :development
|
148
148
|
version_requirements: *id008
|
149
149
|
- !ruby/object:Gem::Dependency
|
150
|
-
name:
|
150
|
+
name: builder
|
151
151
|
prerelease: false
|
152
152
|
requirement: &id009 !ruby/object:Gem::Requirement
|
153
153
|
none: false
|
154
154
|
requirements:
|
155
|
-
- -
|
155
|
+
- - ~>
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
hash: 7
|
158
|
+
segments:
|
159
|
+
- 3
|
160
|
+
- 0
|
161
|
+
- 0
|
162
|
+
version: 3.0.0
|
163
|
+
type: :development
|
164
|
+
version_requirements: *id009
|
165
|
+
- !ruby/object:Gem::Dependency
|
166
|
+
name: rspec
|
167
|
+
prerelease: false
|
168
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ~>
|
156
172
|
- !ruby/object:Gem::Version
|
157
173
|
hash: 27
|
158
174
|
segments:
|
175
|
+
- 2
|
176
|
+
- 5
|
177
|
+
- 0
|
178
|
+
version: 2.5.0
|
179
|
+
type: :development
|
180
|
+
version_requirements: *id010
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: bones
|
183
|
+
prerelease: false
|
184
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ">="
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
hash: 21
|
190
|
+
segments:
|
159
191
|
- 3
|
160
|
-
- 4
|
161
192
|
- 6
|
162
|
-
|
193
|
+
- 5
|
194
|
+
version: 3.6.5
|
163
195
|
type: :development
|
164
|
-
version_requirements: *
|
196
|
+
version_requirements: *id011
|
165
197
|
description: |
|
166
198
|
Stickler is a tool to organize and maintain an internal gem repository.
|
167
199
|
Primarily, you would want to use Stickler if:
|
@@ -199,10 +231,12 @@ files:
|
|
199
231
|
- LICENSE
|
200
232
|
- README.asciidoc
|
201
233
|
- Rakefile
|
234
|
+
- TODO.asciidoc
|
202
235
|
- bin/stickler
|
203
236
|
- bin/stickler-passenger-config
|
204
237
|
- bin/stickler-server
|
205
238
|
- examples/config.ru
|
239
|
+
- examples/fetch-a-gem
|
206
240
|
- examples/gemcutter_repo.ru
|
207
241
|
- examples/index_repo.ru
|
208
242
|
- examples/local_repo.ru
|
@@ -212,6 +246,7 @@ files:
|
|
212
246
|
- lib/stickler/client.rb
|
213
247
|
- lib/stickler/client/config.rb
|
214
248
|
- lib/stickler/client/config_file.rb
|
249
|
+
- lib/stickler/client/list.rb
|
215
250
|
- lib/stickler/client/mirror.rb
|
216
251
|
- lib/stickler/client/push.rb
|
217
252
|
- lib/stickler/client/yank.rb
|
@@ -255,13 +290,12 @@ files:
|
|
255
290
|
- man/stickler.asciidoc
|
256
291
|
- spec/data/gems/bar-1.0.0.gem
|
257
292
|
- spec/data/gems/foo-1.0.0.gem
|
293
|
+
- spec/data/gems/foo-2.0.0a.gem
|
258
294
|
- spec/data/specifications/bar-1.0.0.gemspec
|
259
295
|
- spec/data/specifications/foo-1.0.0.gemspec
|
260
|
-
- spec/
|
261
|
-
- spec/
|
262
|
-
- spec/middleware/legacy_gem_server_behavior.rb
|
296
|
+
- spec/data/specifications/foo-2.0.0a.gemspec
|
297
|
+
- spec/index_spec_helpers.rb
|
263
298
|
- spec/middleware/local_spec.rb
|
264
|
-
- spec/middleware/modern_gem_server_behavior.rb
|
265
299
|
- spec/middleware/not_found_spec.rb
|
266
300
|
- spec/paths_spec.rb
|
267
301
|
- spec/repository/api_behavior.rb
|
@@ -304,8 +338,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
304
338
|
version: "0"
|
305
339
|
requirements: []
|
306
340
|
|
307
|
-
rubyforge_project:
|
308
|
-
rubygems_version: 1.
|
341
|
+
rubyforge_project: stickler
|
342
|
+
rubygems_version: 1.5.2
|
309
343
|
signing_key:
|
310
344
|
specification_version: 3
|
311
345
|
summary: Stickler is a tool to organize and maintain an internal gem repository.
|
@@ -1,69 +0,0 @@
|
|
1
|
-
require File.expand_path( File.join( File.dirname(__FILE__), "..", "spec_helper.rb" ) )
|
2
|
-
require 'rubygems/server'
|
3
|
-
|
4
|
-
shared_examples_for "common gem server before after" do
|
5
|
-
|
6
|
-
before do
|
7
|
-
@webrick_spec_dir = File.join( @webrick_gem_dir, "specifications" )
|
8
|
-
|
9
|
-
@webrick = ::Gem::Server.new(@webrick_gem_dir,4567,false)
|
10
|
-
@underlying_server = @webrick.instance_variable_get("@server")
|
11
|
-
@webrick_thread = Thread.new( @webrick ) do |webrick|
|
12
|
-
webrick.run
|
13
|
-
end
|
14
|
-
@webrick_request = WEBrick::HTTPRequest.new :Logger => nil
|
15
|
-
@webrick_response = WEBrick::HTTPResponse.new :HTTPVersion => '1.0'
|
16
|
-
end
|
17
|
-
|
18
|
-
|
19
|
-
after do
|
20
|
-
@underlying_server.shutdown
|
21
|
-
@webrick_thread.kill
|
22
|
-
end
|
23
|
-
|
24
|
-
|
25
|
-
#
|
26
|
-
# pulled and modified from sinatra-rubygems
|
27
|
-
# http://github.com/jnewland/sinatra-rubygems
|
28
|
-
#
|
29
|
-
def should_match_webrick_behavior(url)
|
30
|
-
|
31
|
-
#webrick
|
32
|
-
data = StringIO.new "GET #{url} HTTP/1.0\r\n\r\n"
|
33
|
-
@webrick_request.parse data
|
34
|
-
verify_webrick = {}
|
35
|
-
begin
|
36
|
-
@underlying_server.service( @webrick_request, @webrick_response)
|
37
|
-
verify_webrick[:status] = @webrick_response.status
|
38
|
-
verify_webrick[:content_type] = @webrick_response['Content-Type']
|
39
|
-
verify_webrick[:body_length] = @webrick_response.body.length
|
40
|
-
verify_webrick[:body] = @webrick_response.body
|
41
|
-
rescue WEBrick::HTTPStatus::NotFound
|
42
|
-
verify_webrick = {
|
43
|
-
:status => 404,
|
44
|
-
:content_type => 'text/html',
|
45
|
-
:body_length => "446"
|
46
|
-
}
|
47
|
-
end
|
48
|
-
|
49
|
-
#sinatra
|
50
|
-
get url
|
51
|
-
|
52
|
-
#verify
|
53
|
-
if 200 == last_response.status and 200 == verify_webrick[:status] then
|
54
|
-
{
|
55
|
-
:status => last_response.status,
|
56
|
-
:content_type => last_response['Content-Type'],
|
57
|
-
:body_length => last_response.body.length,
|
58
|
-
:body => last_response.body
|
59
|
-
}.should == verify_webrick
|
60
|
-
else
|
61
|
-
puts "webrick: #{verify_webrick[:body]}"
|
62
|
-
#puts "sinatra: #{last_response.body}"
|
63
|
-
last_response.status.should == verify_webrick[:status]
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
|
69
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require File.expand_path( File.join( File.dirname(__FILE__), "..", "spec_helper.rb" ) )
|
2
|
-
require File.expand_path( File.join( File.dirname(__FILE__), "modern_gem_server_behavior.rb" ) )
|
3
|
-
|
4
|
-
require 'stickler/middleware/index'
|
5
|
-
require 'stickler/middleware/compression'
|
6
|
-
|
7
|
-
describe Stickler::Middleware::Index do
|
8
|
-
def app
|
9
|
-
::Rack::Builder.new do
|
10
|
-
use ::Stickler::Middleware::Compression
|
11
|
-
use ::Stickler::Middleware::Index
|
12
|
-
run ::Sinatra::Base
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
before do
|
17
|
-
@webrick_gem_dir = File.expand_path( File.join( File.dirname( __FILE__ ), "tmp" ) )
|
18
|
-
FileUtils.mkdir_p( File.join( @webrick_gem_dir , "specifications" ))
|
19
|
-
end
|
20
|
-
|
21
|
-
after do
|
22
|
-
FileUtils.rm_rf( @webrick_gem_dir )
|
23
|
-
end
|
24
|
-
|
25
|
-
it_should_behave_like "modern gem server indexes"
|
26
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require File.expand_path( File.join( File.dirname(__FILE__), "..", "spec_helper.rb" ) )
|
2
|
-
require File.expand_path( File.join( File.dirname(__FILE__), "common_gem_server_helpers.rb" ) )
|
3
|
-
|
4
|
-
require 'rubygems/server'
|
5
|
-
|
6
|
-
shared_examples_for "legacy gem server indexes" do
|
7
|
-
|
8
|
-
it_should_behave_like "common gem server before after"
|
9
|
-
|
10
|
-
LEGACY_URLS = [
|
11
|
-
"/yaml",
|
12
|
-
"/yam.Z",
|
13
|
-
"/Marshal.#{Gem.marshal_version}",
|
14
|
-
"/Marshal.#{Gem.marshal_version}.Z",
|
15
|
-
"/quick/index",
|
16
|
-
"/quick/index.rz",
|
17
|
-
"/quick/latest_index",
|
18
|
-
"/quick/latest_index.rz",
|
19
|
-
"/quick/foo-1.0.0.gemspec.rz",
|
20
|
-
"/quick/bar-1.0.0.gemspec.rz",
|
21
|
-
"/quick/does-not-exist-1.2.0.gemspec.rz"
|
22
|
-
]
|
23
|
-
|
24
|
-
LEGACY_URLS.each do |url|
|
25
|
-
it "serves a legacy gem server index item from #{url}" do
|
26
|
-
should_match_webrick_behavior url
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require File.expand_path( File.join( File.dirname(__FILE__), "..", "spec_helper.rb" ) )
|
2
|
-
require File.expand_path( File.join( File.dirname(__FILE__), "common_gem_server_helpers.rb" ) )
|
3
|
-
|
4
|
-
shared_examples_for "modern gem server indexes" do
|
5
|
-
|
6
|
-
it_should_behave_like "common gem server before after"
|
7
|
-
|
8
|
-
MODERN_URLS = [
|
9
|
-
"/specs.#{Gem.marshal_version}",
|
10
|
-
"/specs.#{Gem.marshal_version}.gz",
|
11
|
-
"/latest_specs.#{Gem.marshal_version}",
|
12
|
-
"/latest_specs.#{Gem.marshal_version}.gz",
|
13
|
-
"/quick/Marshal.#{Gem.marshal_version}/foo-1.0.0.gemspec.rz",
|
14
|
-
"/quick/Marshal.#{Gem.marshal_version}/bar-1.0.0.gemspec.rz",
|
15
|
-
]
|
16
|
-
|
17
|
-
MODERN_URLS.each do |url|
|
18
|
-
it "serves a modern gem server index item from #{url}" do
|
19
|
-
should_match_webrick_behavior url
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|