jbox-gitolite 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gitolite/config.rb +2 -0
- data/lib/gitolite/gitolite_admin.rb +28 -22
- data/lib/gitolite/ssh_key.rb +1 -0
- data/lib/gitolite/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5373d0735ecddbde38ff701ac4e7d8d22abb4eb
|
4
|
+
data.tar.gz: 2666968db7834b8baca9ccf4ed3d5b7968d08ffa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0aca10595c306a81bbe36b8cce66b0ce7a8189617248c0f22d2d97d6003a3a5d7d82a25986141d223ef2577aac6d0ec343074d073ac514e288e7266bf5fd37de
|
7
|
+
data.tar.gz: 6bf8e50d3c55910fde08b42d587a879509a63d52e92e1aae109a11f351516504e17d211bba18e134c40fb8c52fb0433d3c58645f195a0dc3579e13f03ac116f5
|
data/lib/gitolite/config.rb
CHANGED
@@ -63,27 +63,31 @@ module Gitolite
|
|
63
63
|
#Writes all changed aspects out to the file system
|
64
64
|
#will also stage all changes
|
65
65
|
def save
|
66
|
-
|
67
|
-
|
68
|
-
if @config
|
69
|
-
new_conf = @config.to_file(@confdir)
|
70
|
-
@gl_admin.add(new_conf)
|
71
|
-
end
|
66
|
+
confdir = File.join(@gl_admin.working_dir, @confdir)
|
67
|
+
keydir = File.join(@gl_admin.working_dir, @keydir)
|
72
68
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
69
|
+
#Process config file (if loaded, i.e. may be modified)
|
70
|
+
if @config
|
71
|
+
new_conf = @config.to_file(confdir).gsub(@gl_admin.working_dir + '/', '')
|
72
|
+
@gl_admin.git.native(:add, {:chdir => @gl_admin.working_dir}, new_conf)
|
73
|
+
end
|
77
74
|
|
78
|
-
|
79
|
-
|
75
|
+
#Process ssh keys (if loaded, i.e. may be modified)
|
76
|
+
if @ssh_keys
|
77
|
+
files = list_keys(keydir).map{|f| File.basename f}
|
78
|
+
keys = @ssh_keys.values.map{|f| f.map {|t| t.filename}}.flatten
|
79
|
+
|
80
|
+
to_remove = (files - keys).map { |f| File.join(@keydir, f) }
|
81
|
+
to_remove.each do |key|
|
82
|
+
@gl_admin.git.native(:rm, {:chdir => @gl_admin.working_dir}, key)
|
83
|
+
end
|
80
84
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
85
|
+
@ssh_keys.each_value do |key|
|
86
|
+
#Write only keys from sets that has been modified
|
87
|
+
next if key.respond_to?(:dirty?) && !key.dirty?
|
88
|
+
key.each do |k|
|
89
|
+
new_key = k.to_file(keydir).gsub(@gl_admin.working_dir + '/', '')
|
90
|
+
@gl_admin.git.native(:add, {:chdir => @gl_admin.working_dir}, new_key)
|
87
91
|
end
|
88
92
|
end
|
89
93
|
end
|
@@ -172,6 +176,10 @@ module Gitolite
|
|
172
176
|
@config ||= load_config
|
173
177
|
end
|
174
178
|
|
179
|
+
def config=(config)
|
180
|
+
@config = config
|
181
|
+
end
|
182
|
+
|
175
183
|
private
|
176
184
|
#Loads all .pub files in the gitolite-admin
|
177
185
|
#keydir directory
|
@@ -197,10 +205,8 @@ module Gitolite
|
|
197
205
|
end
|
198
206
|
|
199
207
|
def list_keys(path)
|
200
|
-
|
201
|
-
|
202
|
-
keys
|
203
|
-
end
|
208
|
+
keys = %x[ find #{path} -name "\*.pub" -type f -exec basename {} \\; ].chomp.split("\n")
|
209
|
+
keys
|
204
210
|
end
|
205
211
|
end
|
206
212
|
end
|
data/lib/gitolite/ssh_key.rb
CHANGED
data/lib/gitolite/version.rb
CHANGED
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.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Rodriguez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|