jbox-gitolite 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -7
  3. data/Guardfile +2 -2
  4. data/README.md +3 -2
  5. data/Rakefile +26 -8
  6. data/gitolite.gemspec +3 -3
  7. data/lib/gitolite.rb +5 -2
  8. data/lib/gitolite/config.rb +181 -152
  9. data/lib/gitolite/config/group.rb +11 -0
  10. data/lib/gitolite/config/repo.rb +22 -9
  11. data/lib/gitolite/dirty_proxy.rb +3 -0
  12. data/lib/gitolite/gitolite_admin.rb +0 -2
  13. data/lib/gitolite/ssh_key.rb +52 -38
  14. data/lib/gitolite/version.rb +1 -1
  15. data/spec/config_spec.rb +18 -11
  16. data/spec/dirty_proxy_spec.rb +4 -1
  17. data/spec/fixtures/configs/complicated.conf +311 -0
  18. data/spec/fixtures/configs/simple.conf +5 -0
  19. data/spec/{keys/bob-ins@zilla-site.com@desktop.pub → fixtures/keys/bob+joe@test.zilla.com@desktop.pub} +0 -0
  20. data/spec/{keys/bob.joe@test.zilla.com@desktop.pub → fixtures/keys/bob-ins@zilla-site.com@desktop.pub} +0 -0
  21. data/spec/{keys/bob@zilla.com@desktop.pub → fixtures/keys/bob.joe@test.zilla.com@desktop.pub} +0 -0
  22. data/spec/{keys → fixtures/keys}/bob.pub +0 -0
  23. data/spec/{keys → fixtures/keys}/bob@desktop.pub +0 -0
  24. data/spec/{keys → fixtures/keys}/bob@foo-bar.pub +0 -0
  25. data/spec/{keys → fixtures/keys}/bob@zilla.com.pub +0 -0
  26. data/spec/{keys/joe-bob@god-zilla.com@desktop.pub → fixtures/keys/bob@zilla.com@desktop.pub} +0 -0
  27. data/spec/{keys → fixtures/keys}/jakub123.pub +0 -0
  28. data/spec/{keys → fixtures/keys}/jakub123@foo.net.pub +0 -0
  29. data/spec/fixtures/keys/joe-bob@god-zilla.com@desktop.pub +1 -0
  30. data/spec/{keys → fixtures/keys}/joe@sch.ool.edu.pub +0 -0
  31. data/spec/{keys → fixtures/keys}/joe@sch.ool.edu@desktop.pub +0 -0
  32. data/spec/gitolite_admin_spec.rb +6 -8
  33. data/spec/group_spec.rb +0 -1
  34. data/spec/repo_spec.rb +0 -1
  35. data/spec/spec_helper.rb +2 -2
  36. data/spec/ssh_key_spec.rb +15 -10
  37. metadata +39 -37
@@ -0,0 +1,5 @@
1
+ repo gitolite-admin
2
+ RW+ = bobzilla
3
+
4
+ repo testing
5
+ RW+ = @all
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
1
+ ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsRofYfjAUdw0McxGpLTxBbZyKN05HGY19ZIjEQmBPUe2Skt1i/SLwIYzTzKv6vEgAdT9SwmCsO/jpDY/ZM+MhWy4okBisn04yIHCW10q4+YNo2WatzttEa1W+hC58nKtoq/0HkvPVdoeOZxcNtpjvgvkrXH2zdmX7xnA1AAWtqRNkRYWPKjiojkg92aqmJLISSIDeZs2wvXbFO3BJhkvyr3W60cinKhGBBscvdCYUi5pb9dXIFhEEqRf1JkT5CEmF3p4GqSt4/L79nR0LV45grS4NbcN+fCnjWZ8PQhmJ+WPLKkydgR1YvobeY7zDHdHJXWLhsPa+SjwI3WfzrB+GQ== bob@zilla.com
File without changes
@@ -1,15 +1,13 @@
1
- require 'gratr'
2
- require 'grit'
3
- require 'gitolite/gitolite_admin'
4
- require 'gitolite/config'
5
1
  require 'spec_helper'
6
- include Gitolite
7
2
 
8
3
  describe Gitolite::GitoliteAdmin do
9
4
 
5
+ output_dir = '/tmp'
6
+ # output_dir = File.join(File.dirname(File.dirname(__FILE__)), 'tmp')
7
+
10
8
  describe '#bootstrap' do
11
9
  it 'should bootstrap a gitolite-admin repository' do
12
- test_dir = '/tmp/gitolite-admin-test'
10
+ test_dir = File.join(output_dir, 'gitolite-admin-test')
13
11
  opts = { :overwrite => false }
14
12
  gl_admin = GitoliteAdmin.bootstrap(test_dir, opts)
15
13
 
@@ -18,7 +16,7 @@ describe Gitolite::GitoliteAdmin do
18
16
  end
19
17
 
20
18
  it 'should bootstrap (overwrite) a gitolite-admin repository' do
21
- test_dir = '/tmp/gitolite-admin-test'
19
+ test_dir = File.join(output_dir, 'gitolite-admin-test')
22
20
  opts = { :overwrite => true }
23
21
  gl_admin = GitoliteAdmin.bootstrap(test_dir, opts)
24
22
 
@@ -29,7 +27,7 @@ describe Gitolite::GitoliteAdmin do
29
27
 
30
28
  describe '#is_gitolite_admin_repo?' do
31
29
  it 'should detect a non gitolite-admin repository' do
32
- test_dir = '/tmp'
30
+ test_dir = output_dir
33
31
  expect(GitoliteAdmin.is_gitolite_admin_repo?(test_dir)).to be false
34
32
  end
35
33
  end
data/spec/group_spec.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'gitolite/config/group'
2
1
  require 'spec_helper'
3
2
 
4
3
  describe Gitolite::Config::Group do
data/spec/repo_spec.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'gitolite/config/repo'
2
1
  require 'spec_helper'
3
2
 
4
3
  describe Gitolite::Config::Repo do
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'spork'
3
3
  require 'forgery'
4
- require 'tmpdir'
5
4
 
6
5
  require 'simplecov'
7
6
  require 'simplecov-rcov'
@@ -17,5 +16,6 @@ end
17
16
 
18
17
  Spork.each_run do
19
18
  # This code will be run each time you run your specs.
20
-
19
+ require File.expand_path('../../lib/gitolite', __FILE__)
20
+ include Gitolite
21
21
  end
data/spec/ssh_key_spec.rb CHANGED
@@ -1,9 +1,10 @@
1
1
  require 'spec_helper'
2
- require 'gitolite/ssh_key'
3
- include Gitolite
4
2
 
5
3
  describe Gitolite::SSHKey do
6
- key_dir = File.join(File.dirname(__FILE__),'keys')
4
+
5
+ key_dir = File.join(File.dirname(__FILE__), 'fixtures', 'keys')
6
+ output_dir = '/tmp'
7
+ # output_dir = File.join(File.dirname(File.dirname(__FILE__)), 'tmp')
7
8
 
8
9
  describe "#from_string" do
9
10
  it 'should construct an SSH key from a string' do
@@ -96,6 +97,12 @@ describe Gitolite::SSHKey do
96
97
  s.owner.should == 'bob.joe@test.zilla.com'
97
98
  end
98
99
 
100
+ it "owner should be bob+joe@test.zilla.com for bob+joe@test.zilla.com@desktop.pub" do
101
+ key = File.join(key_dir, 'bob+joe@test.zilla.com@desktop.pub')
102
+ s = SSHKey.from_file(key)
103
+ s.owner.should == 'bob+joe@test.zilla.com'
104
+ end
105
+
99
106
  it 'owner should be bob@zilla.com for bob@zilla.com@desktop.pub' do
100
107
  key = File.join(key_dir, 'bob@zilla.com@desktop.pub')
101
108
  s = SSHKey.from_file(key)
@@ -313,10 +320,11 @@ describe Gitolite::SSHKey do
313
320
 
314
321
  s = SSHKey.new(type, blob, email, owner, location)
315
322
 
316
- tmpdir = Dir.tmpdir
317
- s.to_file(tmpdir)
323
+ ## write file
324
+ s.to_file(output_dir)
318
325
 
319
- s.to_s.should == File.read(File.join(tmpdir, s.filename))
326
+ ## compare raw string with written file
327
+ s.to_s.should == File.read(File.join(output_dir, s.filename))
320
328
  end
321
329
 
322
330
  it 'should return the filename written' do
@@ -328,10 +336,7 @@ describe Gitolite::SSHKey do
328
336
 
329
337
  s = SSHKey.new(type, blob, email, owner, location)
330
338
 
331
- tmpdir = Dir.tmpdir
332
-
333
-
334
- s.to_file(tmpdir).should == File.join(tmpdir, s.filename)
339
+ s.to_file(output_dir).should == File.join(output_dir, s.filename)
335
340
  end
336
341
  end
337
342
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbox-gitolite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Rodriguez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-19 00:00:00.000000000 Z
11
+ date: 2014-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 2.6.0
61
+ version: 4.2.8
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: 2.6.0
68
+ version: 4.2.8
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard-spork
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: 0.5.0
89
+ version: 0.6.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: 0.5.0
96
+ version: 0.6.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: travis-lint
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -165,19 +165,19 @@ dependencies:
165
165
  - !ruby/object:Gem::Version
166
166
  version: 2.6.5
167
167
  - !ruby/object:Gem::Dependency
168
- name: gratr19
168
+ name: plexus
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ~>
172
172
  - !ruby/object:Gem::Version
173
- version: 0.4.4.1
173
+ version: 0.5.10
174
174
  type: :runtime
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.4.4.1
180
+ version: 0.5.10
181
181
  description: This gem is designed to provide a Ruby interface to the Gitolite Git
182
182
  backend system. This gem aims to provide all management functionality that is available
183
183
  via the gitolite-admin repository (like SSH keys, repository permissions, etc)
@@ -205,23 +205,24 @@ files:
205
205
  - lib/gitolite/ssh_key.rb
206
206
  - lib/gitolite/version.rb
207
207
  - spec/config_spec.rb
208
- - spec/configs/complicated.conf
209
- - spec/configs/simple.conf
210
208
  - spec/dirty_proxy_spec.rb
209
+ - spec/fixtures/configs/complicated.conf
210
+ - spec/fixtures/configs/simple.conf
211
+ - spec/fixtures/keys/bob+joe@test.zilla.com@desktop.pub
212
+ - spec/fixtures/keys/bob-ins@zilla-site.com@desktop.pub
213
+ - spec/fixtures/keys/bob.joe@test.zilla.com@desktop.pub
214
+ - spec/fixtures/keys/bob.pub
215
+ - spec/fixtures/keys/bob@desktop.pub
216
+ - spec/fixtures/keys/bob@foo-bar.pub
217
+ - spec/fixtures/keys/bob@zilla.com.pub
218
+ - spec/fixtures/keys/bob@zilla.com@desktop.pub
219
+ - spec/fixtures/keys/jakub123.pub
220
+ - spec/fixtures/keys/jakub123@foo.net.pub
221
+ - spec/fixtures/keys/joe-bob@god-zilla.com@desktop.pub
222
+ - spec/fixtures/keys/joe@sch.ool.edu.pub
223
+ - spec/fixtures/keys/joe@sch.ool.edu@desktop.pub
211
224
  - spec/gitolite_admin_spec.rb
212
225
  - spec/group_spec.rb
213
- - spec/keys/bob-ins@zilla-site.com@desktop.pub
214
- - spec/keys/bob.joe@test.zilla.com@desktop.pub
215
- - spec/keys/bob.pub
216
- - spec/keys/bob@desktop.pub
217
- - spec/keys/bob@foo-bar.pub
218
- - spec/keys/bob@zilla.com.pub
219
- - spec/keys/bob@zilla.com@desktop.pub
220
- - spec/keys/jakub123.pub
221
- - spec/keys/jakub123@foo.net.pub
222
- - spec/keys/joe-bob@god-zilla.com@desktop.pub
223
- - spec/keys/joe@sch.ool.edu.pub
224
- - spec/keys/joe@sch.ool.edu@desktop.pub
225
226
  - spec/repo_spec.rb
226
227
  - spec/spec_helper.rb
227
228
  - spec/ssh_key_spec.rb
@@ -252,23 +253,24 @@ summary: A Ruby gem for manipulating the Gitolite Git backend via the gitolite-a
252
253
  repository.
253
254
  test_files:
254
255
  - spec/config_spec.rb
255
- - spec/configs/complicated.conf
256
- - spec/configs/simple.conf
257
256
  - spec/dirty_proxy_spec.rb
257
+ - spec/fixtures/configs/complicated.conf
258
+ - spec/fixtures/configs/simple.conf
259
+ - spec/fixtures/keys/bob+joe@test.zilla.com@desktop.pub
260
+ - spec/fixtures/keys/bob-ins@zilla-site.com@desktop.pub
261
+ - spec/fixtures/keys/bob.joe@test.zilla.com@desktop.pub
262
+ - spec/fixtures/keys/bob.pub
263
+ - spec/fixtures/keys/bob@desktop.pub
264
+ - spec/fixtures/keys/bob@foo-bar.pub
265
+ - spec/fixtures/keys/bob@zilla.com.pub
266
+ - spec/fixtures/keys/bob@zilla.com@desktop.pub
267
+ - spec/fixtures/keys/jakub123.pub
268
+ - spec/fixtures/keys/jakub123@foo.net.pub
269
+ - spec/fixtures/keys/joe-bob@god-zilla.com@desktop.pub
270
+ - spec/fixtures/keys/joe@sch.ool.edu.pub
271
+ - spec/fixtures/keys/joe@sch.ool.edu@desktop.pub
258
272
  - spec/gitolite_admin_spec.rb
259
273
  - spec/group_spec.rb
260
- - spec/keys/bob-ins@zilla-site.com@desktop.pub
261
- - spec/keys/bob.joe@test.zilla.com@desktop.pub
262
- - spec/keys/bob.pub
263
- - spec/keys/bob@desktop.pub
264
- - spec/keys/bob@foo-bar.pub
265
- - spec/keys/bob@zilla.com.pub
266
- - spec/keys/bob@zilla.com@desktop.pub
267
- - spec/keys/jakub123.pub
268
- - spec/keys/jakub123@foo.net.pub
269
- - spec/keys/joe-bob@god-zilla.com@desktop.pub
270
- - spec/keys/joe@sch.ool.edu.pub
271
- - spec/keys/joe@sch.ool.edu@desktop.pub
272
274
  - spec/repo_spec.rb
273
275
  - spec/spec_helper.rb
274
276
  - spec/ssh_key_spec.rb