crossroads_capistrano 1.4.7 → 1.4.8
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.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "crossroads_capistrano"
|
6
|
-
s.version = "1.4.
|
6
|
+
s.version = "1.4.8"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Steve Kenworthy", "Ben Tillman", "Nathan Broadbent"]
|
9
9
|
s.email = ["it_dept@crossroads.org.hk"]
|
@@ -23,7 +23,8 @@ end
|
|
23
23
|
|
24
24
|
# Replaces strings in a file, i.e. @SOME_STRING@ is replaced with 'replacement'
|
25
25
|
def sed(file, args, char="@")
|
26
|
-
|
26
|
+
cmd = "sed -i #{file} " << args.map{|k,v|"-e 's%#{char}#{k}#{char}%#{v}%g'"}.join(" ")
|
27
|
+
exists?(:use_sudo) && !use_sudo ? run cmd : sudo cmd
|
27
28
|
end
|
28
29
|
|
29
30
|
# Helper function which prompts for user input.
|