stickler 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/.bnsignore ADDED
@@ -0,0 +1,14 @@
1
+ *~
2
+ pkg
3
+ log
4
+ doc
5
+ coverage
6
+ *.swp
7
+ *.swo
8
+ .*.swp
9
+ announcement.txt
10
+ spec/tmp
11
+ version.txt
12
+ *.pid
13
+ tmp
14
+ *.html
data/HISTORY.asciidoc CHANGED
@@ -3,6 +3,11 @@ Stickler Changelog
3
3
  Jeremy Hinegardner <jeremy@hinegardner.org>
4
4
 
5
5
 
6
+ Version 2.2.3 - 2012-02-26
7
+ --------------------------
8
+ * Fixed authentication failing on mirror command (copiousfreetime/stickler/#12)
9
+ * Fixed 'list' command not working when no flags where given
10
+
6
11
  Version 2.2.2 - 2012-02-13
7
12
  --------------------------
8
13
  * Updated dependencies to latest versions
data/lib/stickler.rb CHANGED
@@ -8,5 +8,3 @@ require 'stickler/middleware'
8
8
  require 'stickler/spec_lite'
9
9
  require 'stickler/version'
10
10
  require 'stickler/server'
11
-
12
-
@@ -30,7 +30,6 @@ module Stickler
30
30
 
31
31
  def parse( argv )
32
32
  opts = Trollop::with_standard_exception_handling( parser ) do
33
- raise Trollop::HelpNeeded if argv.empty? # show help screen
34
33
  o = parser.parse( argv )
35
34
  yield parser if block_given?
36
35
  return o
@@ -1,3 +1,4 @@
1
+ require 'stickler/repository/remote_mirror'
1
2
  module Stickler
2
3
  class Client
3
4
  class Mirror < Stickler::Client
@@ -36,6 +37,10 @@ _
36
37
  opts[:server] || Client.config.server
37
38
  end
38
39
 
40
+ def remote_repo_for( opts )
41
+ Stickler::Repository::RemoteMirror.new( opts[:server], :debug => opts[:debug] )
42
+ end
43
+
39
44
  def run
40
45
  opts = parse( self.argv )
41
46
  repo = remote_repo_for( opts )
@@ -45,13 +50,11 @@ _
45
50
  $stdout.write "Asking #{repo.uri} to mirror #{spec.full_name} from #{upstream_host} : "
46
51
  $stdout.flush
47
52
 
48
- uri = [ repo.uri.join( upstream_host ), opts[:gem_name], opts[:gem_version], opts[:platform] ].join("/")
49
- resp = Excon.post( uri, :expects => [200, 201] )
53
+ resp = repo.mirror( spec, upstream_host )
50
54
 
51
55
  $stdout.puts "OK -> #{repo.uri.join(resp.headers['Location'])}"
52
- rescue Excon::Errors::Error => he
53
- resp = he.response
54
- $stdout.puts "ERROR -> #{resp.body}"
56
+ rescue Stickler::Repository::Error => e
57
+ $stdout.puts "ERROR: #{e.message}"
55
58
  rescue StandardError => e
56
59
  puts e.backtrace.join("\n")
57
60
  $stdout.puts "ERROR -> #{e.message}"
@@ -1,4 +1,3 @@
1
- require 'stickler/repository'
2
1
  require 'stickler/spec_lite'
3
2
 
4
3
  module Stickler::Repository
@@ -1,7 +1,6 @@
1
1
  require 'stickler/spec_lite'
2
2
  require 'stickler/logable'
3
3
  require 'stickler/repository'
4
- require 'stickler/repository/api'
5
4
  require 'stickler/repository/index'
6
5
  require 'addressable/uri'
7
6
  require 'tempfile'
@@ -1,4 +1,3 @@
1
- require 'stickler/repository'
2
1
  require 'stickler/repository/remote'
3
2
  require 'stickler/repository/local'
4
3
  require 'forwardable'
@@ -1,5 +1,4 @@
1
1
  require 'stickler/repository'
2
-
3
2
  module Stickler::Repository
4
3
  #
5
4
  # A null repository. It is in most respecs like a Repository::Local that has
@@ -1,6 +1,6 @@
1
1
  require 'excon'
2
- require 'stickler/repository'
3
2
  require 'stickler/version'
3
+ require 'stickler/repository'
4
4
  require 'stickler/repository/api'
5
5
  require 'stickler/repository/rubygems_authenticator'
6
6
  require 'stickler/repository/basic_authenticator'
@@ -0,0 +1,31 @@
1
+ require 'stickler/repository/remote'
2
+ module ::Stickler::Repository
3
+ #
4
+ # A Repository::Api implementation that retrieves all is data from an HTTP
5
+ # based remote location. It utilizes the Modern gem server api and the gem
6
+ # cutter api (push/yank/unyank). The legacy gem server api is not utilized.
7
+ #
8
+ # This also supports the single extra method #mirror which tells the remote
9
+ # mirror repostory to mirro the given gem from an upstream server.
10
+ #
11
+ class RemoteMirror < Remote
12
+ # Tell the remote repoistory to mirror the given gem from an upstream
13
+ # repository
14
+ def mirror( spec, upstream_host )
15
+ raise Stickler::Repository::Error, "gem #{spec.full_name} already exists in remote repository" if remote_gem_file_exist?( spec )
16
+ resp = resource_request( mirror_resource( spec, upstream_host ) )
17
+ end
18
+
19
+ private
20
+
21
+ def mirror_uri( spec, upstream_host )
22
+ [ uri.join( upstream_host ), spec.name, spec.version.to_s, spec.platform].join("/")
23
+ end
24
+
25
+ def mirror_resource( spec, upstream_host )
26
+ muri = mirror_uri( spec, upstream_host )
27
+ params = { :method => :post, :expects => [200, 201] }
28
+ Excon.new( muri.to_s, params )
29
+ end
30
+ end
31
+ end
@@ -12,7 +12,7 @@ module Stickler
12
12
 
13
13
  MAJOR = 2
14
14
  MINOR = 2
15
- BUILD = 2
15
+ BUILD = 3
16
16
 
17
17
  def self.to_ary
18
18
  [ MAJOR, MINOR, BUILD ]
metadata CHANGED
@@ -1,217 +1,149 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: stickler
3
- version: !ruby/object:Gem::Version
4
- hash: 3
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.2.3
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 2
9
- - 2
10
- version: 2.2.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Jeremy Hinegardner
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-02-13 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-02-26 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: sinatra
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70269982138640 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 31
29
- segments:
30
- - 1
31
- - 3
32
- - 2
20
+ - !ruby/object:Gem::Version
33
21
  version: 1.3.2
34
22
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: addressable
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70269982138640
25
+ - !ruby/object:Gem::Dependency
26
+ name: addressable
27
+ requirement: &70269982137620 !ruby/object:Gem::Requirement
40
28
  none: false
41
- requirements:
29
+ requirements:
42
30
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 11
45
- segments:
46
- - 2
47
- - 2
48
- - 6
31
+ - !ruby/object:Gem::Version
49
32
  version: 2.2.6
50
33
  type: :runtime
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: excon
54
34
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70269982137620
36
+ - !ruby/object:Gem::Dependency
37
+ name: excon
38
+ requirement: &70269982136040 !ruby/object:Gem::Requirement
56
39
  none: false
57
- requirements:
40
+ requirements:
58
41
  - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 49
61
- segments:
62
- - 0
63
- - 9
64
- - 5
42
+ - !ruby/object:Gem::Version
65
43
  version: 0.9.5
66
44
  type: :runtime
67
- version_requirements: *id003
68
- - !ruby/object:Gem::Dependency
69
- name: trollop
70
45
  prerelease: false
71
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *70269982136040
47
+ - !ruby/object:Gem::Dependency
48
+ name: trollop
49
+ requirement: &70269982134860 !ruby/object:Gem::Requirement
72
50
  none: false
73
- requirements:
51
+ requirements:
74
52
  - - ~>
75
- - !ruby/object:Gem::Version
76
- hash: 83
77
- segments:
78
- - 1
79
- - 16
80
- - 2
53
+ - !ruby/object:Gem::Version
81
54
  version: 1.16.2
82
55
  type: :runtime
83
- version_requirements: *id004
84
- - !ruby/object:Gem::Dependency
85
- name: logging
86
56
  prerelease: false
87
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *70269982134860
58
+ - !ruby/object:Gem::Dependency
59
+ name: logging
60
+ requirement: &70269982133520 !ruby/object:Gem::Requirement
88
61
  none: false
89
- requirements:
62
+ requirements:
90
63
  - - ~>
91
- - !ruby/object:Gem::Version
92
- hash: 11
93
- segments:
94
- - 1
95
- - 6
96
- - 2
64
+ - !ruby/object:Gem::Version
97
65
  version: 1.6.2
98
66
  type: :runtime
99
- version_requirements: *id005
100
- - !ruby/object:Gem::Dependency
101
- name: rake
102
67
  prerelease: false
103
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *70269982133520
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: &70269982132600 !ruby/object:Gem::Requirement
104
72
  none: false
105
- requirements:
73
+ requirements:
106
74
  - - ~>
107
- - !ruby/object:Gem::Version
108
- hash: 11
109
- segments:
110
- - 0
111
- - 9
112
- - 2
113
- - 2
75
+ - !ruby/object:Gem::Version
114
76
  version: 0.9.2.2
115
77
  type: :development
116
- version_requirements: *id006
117
- - !ruby/object:Gem::Dependency
118
- name: bones
119
78
  prerelease: false
120
- requirement: &id007 !ruby/object:Gem::Requirement
79
+ version_requirements: *70269982132600
80
+ - !ruby/object:Gem::Dependency
81
+ name: bones
82
+ requirement: &70269982131600 !ruby/object:Gem::Requirement
121
83
  none: false
122
- requirements:
84
+ requirements:
123
85
  - - ~>
124
- - !ruby/object:Gem::Version
125
- hash: 29
126
- segments:
127
- - 3
128
- - 7
129
- - 3
86
+ - !ruby/object:Gem::Version
130
87
  version: 3.7.3
131
88
  type: :development
132
- version_requirements: *id007
133
- - !ruby/object:Gem::Dependency
134
- name: rack-test
135
89
  prerelease: false
136
- requirement: &id008 !ruby/object:Gem::Requirement
90
+ version_requirements: *70269982131600
91
+ - !ruby/object:Gem::Dependency
92
+ name: rack-test
93
+ requirement: &70269982126400 !ruby/object:Gem::Requirement
137
94
  none: false
138
- requirements:
95
+ requirements:
139
96
  - - ~>
140
- - !ruby/object:Gem::Version
141
- hash: 5
142
- segments:
143
- - 0
144
- - 6
145
- - 1
97
+ - !ruby/object:Gem::Version
146
98
  version: 0.6.1
147
99
  type: :development
148
- version_requirements: *id008
149
- - !ruby/object:Gem::Dependency
150
- name: bones-extras
151
100
  prerelease: false
152
- requirement: &id009 !ruby/object:Gem::Requirement
101
+ version_requirements: *70269982126400
102
+ - !ruby/object:Gem::Dependency
103
+ name: bones-extras
104
+ requirement: &70269982125260 !ruby/object:Gem::Requirement
153
105
  none: false
154
- requirements:
106
+ requirements:
155
107
  - - ~>
156
- - !ruby/object:Gem::Version
157
- hash: 27
158
- segments:
159
- - 1
160
- - 3
161
- - 0
108
+ - !ruby/object:Gem::Version
162
109
  version: 1.3.0
163
110
  type: :development
164
- version_requirements: *id009
165
- - !ruby/object:Gem::Dependency
166
- name: builder
167
111
  prerelease: false
168
- requirement: &id010 !ruby/object:Gem::Requirement
112
+ version_requirements: *70269982125260
113
+ - !ruby/object:Gem::Dependency
114
+ name: builder
115
+ requirement: &70269982124340 !ruby/object:Gem::Requirement
169
116
  none: false
170
- requirements:
117
+ requirements:
171
118
  - - ~>
172
- - !ruby/object:Gem::Version
173
- hash: 7
174
- segments:
175
- - 3
176
- - 0
177
- - 0
119
+ - !ruby/object:Gem::Version
178
120
  version: 3.0.0
179
121
  type: :development
180
- version_requirements: *id010
181
- - !ruby/object:Gem::Dependency
182
- name: rspec
183
122
  prerelease: false
184
- requirement: &id011 !ruby/object:Gem::Requirement
123
+ version_requirements: *70269982124340
124
+ - !ruby/object:Gem::Dependency
125
+ name: rspec
126
+ requirement: &70269982123460 !ruby/object:Gem::Requirement
185
127
  none: false
186
- requirements:
128
+ requirements:
187
129
  - - ~>
188
- - !ruby/object:Gem::Version
189
- hash: 47
190
- segments:
191
- - 2
192
- - 8
193
- - 0
130
+ - !ruby/object:Gem::Version
194
131
  version: 2.8.0
195
132
  type: :development
196
- version_requirements: *id011
197
- description: |
198
- Stickler is a tool to organize and maintain an internal gem repository.
199
- Primarily, you would want to use Stickler if:
200
-
201
- 1. You have proprietary gems that you want to have available via a gem server so
202
- you may +gem install+ them.
203
- 2. You would like to have a local mirror of third party gems from either
204
- http://rubygems.org or some other gem server.
205
- 3. You want both (1) and (2) in the same server.
206
-
133
+ prerelease: false
134
+ version_requirements: *70269982123460
135
+ description: ! "Stickler is a tool to organize and maintain an internal gem repository.\nPrimarily,
136
+ you would want to use Stickler if:\n\n1. You have proprietary gems that you want
137
+ to have available via a gem server so \n you may +gem install+ them.\n2. You would
138
+ like to have a local mirror of third party gems from either \n http://rubygems.org
139
+ or some other gem server.\n3. You want both (1) and (2) in the same server.\n"
207
140
  email: jeremy@hinegardner.org
208
- executables:
141
+ executables:
209
142
  - stickler
210
143
  - stickler-passenger-config
211
144
  - stickler-server
212
145
  extensions: []
213
-
214
- extra_rdoc_files:
146
+ extra_rdoc_files:
215
147
  - bin/stickler
216
148
  - bin/stickler-passenger-config
217
149
  - bin/stickler-server
@@ -224,7 +156,8 @@ extra_rdoc_files:
224
156
  - lib/stickler/server/public/js/modernizr-1.5.min.js
225
157
  - lib/stickler/server/views/index.erb
226
158
  - lib/stickler/server/views/layout.erb
227
- files:
159
+ files:
160
+ - .bnsignore
228
161
  - .gitignore
229
162
  - .rvmrc
230
163
  - HISTORY.asciidoc
@@ -270,6 +203,7 @@ files:
270
203
  - lib/stickler/repository/mirror.rb
271
204
  - lib/stickler/repository/null.rb
272
205
  - lib/stickler/repository/remote.rb
206
+ - lib/stickler/repository/remote_mirror.rb
273
207
  - lib/stickler/repository/rubygems_authenticator.rb
274
208
  - lib/stickler/server.rb
275
209
  - lib/stickler/server/public/css/blueprint/LICENSE
@@ -316,37 +250,28 @@ files:
316
250
  - tasks/man.rake
317
251
  homepage: http://www.copiousfreetime.org/projects/stickler
318
252
  licenses: []
319
-
320
253
  post_install_message:
321
- rdoc_options:
254
+ rdoc_options:
322
255
  - --main
323
256
  - README.asciidoc
324
- require_paths:
257
+ require_paths:
325
258
  - lib
326
- required_ruby_version: !ruby/object:Gem::Requirement
259
+ required_ruby_version: !ruby/object:Gem::Requirement
327
260
  none: false
328
- requirements:
329
- - - ">="
330
- - !ruby/object:Gem::Version
331
- hash: 3
332
- segments:
333
- - 0
334
- version: "0"
335
- required_rubygems_version: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ! '>='
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ required_rubygems_version: !ruby/object:Gem::Requirement
336
266
  none: false
337
- requirements:
338
- - - ">="
339
- - !ruby/object:Gem::Version
340
- hash: 3
341
- segments:
342
- - 0
343
- version: "0"
267
+ requirements:
268
+ - - ! '>='
269
+ - !ruby/object:Gem::Version
270
+ version: '0'
344
271
  requirements: []
345
-
346
272
  rubyforge_project: stickler
347
273
  rubygems_version: 1.8.15
348
274
  signing_key:
349
275
  specification_version: 3
350
276
  summary: Stickler is a tool to organize and maintain an internal gem repository.
351
277
  test_files: []
352
-