gold 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/lib/gold.rb +13 -3
- metadata +3 -3
data/History.txt
CHANGED
data/lib/gold.rb
CHANGED
@@ -12,7 +12,7 @@ require 'yaml'
|
|
12
12
|
# TODO: move Settings inside each project ?
|
13
13
|
|
14
14
|
class Gold
|
15
|
-
VERSION = '0.4.
|
15
|
+
VERSION = '0.4.6'
|
16
16
|
|
17
17
|
DefaultSettings = {
|
18
18
|
'gold_branch' => 'gold', # name of local branch tracking gold master (in developer's local git)
|
@@ -68,7 +68,17 @@ class Gold
|
|
68
68
|
|
69
69
|
def setup
|
70
70
|
return error("Could not create settings file #{settings_path.inspect}.") unless create_settings_file
|
71
|
-
|
71
|
+
# Check if remote exists:
|
72
|
+
if remote = `git remote -v`.split("\n").detect { |l| l =~ /^#{gold_remote}\s+([^\s]+)/ }
|
73
|
+
if $1 == gold_repository
|
74
|
+
# ok
|
75
|
+
else
|
76
|
+
return error("Remote '#{gold_remote}' exists with different setting ('#{$1}'). Abort.")
|
77
|
+
end
|
78
|
+
else
|
79
|
+
return error("Could create remote #{gold_remote}.") unless system("git remote add #{gold_remote} #{gold_repository}")
|
80
|
+
end
|
81
|
+
|
72
82
|
return error("Could not fetch #{gold_remote}.") unless system("git fetch #{gold_remote}")
|
73
83
|
return error("Could not create #{gold_branch} branch.") unless system("git checkout --track -b #{gold_branch} #{gold_remote}/#{gold_master}")
|
74
84
|
end
|
@@ -208,7 +218,7 @@ gold review #{developer_name}/#{branch}
|
|
208
218
|
real_key = key.gsub(/\A.*? /,'')
|
209
219
|
print "#{SettingsMessages[key]} (#{real_key}: #{defaults[real_key]}) "
|
210
220
|
value = STDIN.gets.chomp
|
211
|
-
new_settings[real_key] = value == '' ?
|
221
|
+
new_settings[real_key] = value == '' ? defaults[real_key] : value
|
212
222
|
end
|
213
223
|
File.open(settings_path, 'wb') do |f|
|
214
224
|
f.puts YAML::dump(new_settings)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 0.4.
|
8
|
+
- 6
|
9
|
+
version: 0.4.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Gaspard Bucher
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-06-
|
17
|
+
date: 2010-06-15 00:00:00 +02:00
|
18
18
|
default_executable: gold
|
19
19
|
dependencies: []
|
20
20
|
|