Take the 2008 Git User's Survey and help out! [ hide ]

public
Description: Blanket is a flexible backup framework designed to get the drudgery out of the way and to make automated backups easy.
Homepage: http://jimvanfleet.com/projects/blanket
Clone URL: git://github.com/bigfleet/blanket.git
Search Repo:
Adding Capfile writing to the blanket-cfg command
bigfleet (author)
Sun Mar 02 14:18:46 -0800 2008
commit  3a544761d5005522874bfcbe62e54763b30a3a2e
tree    0e180ffe6d51776e7ad9f53e1f65c7444ff64e18
parent  101c5a6aa00c9a26b65990365b669067cecbc95d
...
49
50
51
52
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
...
49
50
51
 
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
0
@@ -49,4 +49,33 @@ def write_config_for(sym)
0
 end
0
 
0
 write_config_for(:source)
0
-write_config_for(:sink)
0
\ No newline at end of file
0
+write_config_for(:sink)
0
+
0
+
0
+def unindent(string)
0
+ indentation = string[/\A\s*/]
0
+ string.strip.gsub(/^#{indentation}/, "")
0
+end
0
+
0
+files = {
0
+ "Capfile" => unindent(<<-FILE),
0
+ Dir['../plugins/recipes/*.rb'].each { |plugin| load(plugin) }
0
+ load '../lib/init.rb'
0
+ FILE
0
+}
0
+
0
+files.each do |file, content|
0
+ file = File.join(@task_dir, file)
0
+ if File.exists?(file)
0
+ warn "[skip] `#{file}' already exists"
0
+ elsif File.exists?(file.downcase)
0
+ warn "[skip] `#{file.downcase}' exists, which could conflict with `#{file}'"
0
+ elsif !File.exists?(File.dirname(file))
0
+ warn "[skip] directory `#{File.dirname(file)}' does not exist"
0
+ else
0
+ puts "[add] writing `#{file}'"
0
+ File.open(file, "w") { |f| f.write(content) }
0
+ end
0
+end
0
+
0
+puts "[done] blanketed!"
0
\ No newline at end of file

Comments

    No one has commented yet.