gitolite 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  # gitolite #
2
2
 
3
- This gem is designed to provide a Ruby interface to the {gitolite}[https://github.com/sitaramc/gitolite] git backend system. I am aiming to provide all management functionality that is available via the gitolite-admin repository (like SSH keys, repository permissions, etc)
3
+ This gem is designed to provide a Ruby interface to the [gitolite](https://github.com/sitaramc/gitolite) git backend system. I am aiming to provide all management functionality that is available via the gitolite-admin repository (like SSH keys, repository permissions, etc)
4
4
 
5
5
  This gem can still have problems. Please file an issue if you encounter a bug. If you have a feature request, file one please.
6
6
 
@@ -14,7 +14,7 @@ This gem can still have problems. Please file an issue if you encounter a bug.
14
14
 
15
15
  ## Requirements ##
16
16
  * Ruby 1.8.x or 1.9.x
17
- * a working {gitolite}[https://github.com/sitaramc/gitolite] installation
17
+ * a working [gitolite](https://github.com/sitaramc/gitolite) installation
18
18
  * the <tt>gitolite-admin</tt> repository checked out locally
19
19
 
20
20
  ## Installation ##
@@ -207,6 +207,8 @@ module Gitolite
207
207
 
208
208
  # Add each group to the graph
209
209
  @groups.each_value do |group|
210
+ dp.add_vertex! group
211
+
210
212
  # Select group names from the users
211
213
  subgroups = group.users.select {|u| u =~ /^#{Group::PREPEND_CHAR}.*$/}
212
214
  .map{|g| get_group g.gsub(Group::PREPEND_CHAR, '') }
@@ -1,3 +1,3 @@
1
1
  module Gitolite
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -381,6 +381,44 @@ describe Gitolite::Config do
381
381
  # Attempt to write the config file
382
382
  lambda{ c.to_file('/tmp')}.should raise_error(Gitolite::Config::GroupDependencyError)
383
383
  end
384
+
385
+ it 'should resolve group dependencies even when there are disconnected portions of the graph' do
386
+ c = Gitolite::Config.init
387
+ c.filename = "test_deptree.conf"
388
+
389
+ # Build some groups out of order
390
+ g = Gitolite::Config::Group.new "groupa"
391
+ g.add_users "bob", "timmy", "stephanie"
392
+ c.add_group(g)
393
+
394
+ g = Gitolite::Config::Group.new "groupb"
395
+ g.add_users "joe", "sam", "susan", "andrew"
396
+ c.add_group(g)
397
+
398
+ g = Gitolite::Config::Group.new "groupc"
399
+ g.add_users "jane", "earl", "brandon", "@groupa"
400
+ c.add_group(g)
401
+
402
+ g = Gitolite::Config::Group.new "groupd"
403
+ g.add_users "larry", "chris", "emily"
404
+ c.add_group(g)
405
+
406
+ # Write the config to a file
407
+ file = c.to_file('/tmp')
408
+
409
+ # Read the conf and make sure our order is correct
410
+ f = File.read(file)
411
+ lines = f.lines.map {|l| l.strip}
412
+
413
+ # Compare the file lines. Spacing is important here since we are doing a direct comparision
414
+ lines[0].should == "@groupd = chris emily larry"
415
+ lines[1].should == "@groupb = andrew joe sam susan"
416
+ lines[2].should == "@groupa = bob stephanie timmy"
417
+ lines[3].should == "@groupc = @groupa brandon earl jane"
418
+
419
+ # Cleanup
420
+ File.unlink(file)
421
+ end
384
422
  end
385
423
 
386
424
  describe "#cleanup_config_line" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitolite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-30 00:00:00.000000000 Z
12
+ date: 2012-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec