dev 1.0.193 → 1.0.194
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dev/cmd/Replace.rb +12 -4
- metadata +1 -1
data/lib/dev/cmd/Replace.rb
CHANGED
@@ -19,10 +19,18 @@ class Replace < Hash
|
|
19
19
|
puts_debug "Dev::Cmd::Replace.refresh found dep of key #{k.to_s}"
|
20
20
|
if !v.nil? && v.kind_of?(Hash) && v.has_key?(:rev) && v.has_key?(:dir) && !has_key?(k)
|
21
21
|
puts_debug "adding key #{k.to_s}"
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
if(v[:dir].include?('@'))
|
23
|
+
words=v[:dir].split('@')
|
24
|
+
parts=words[0].split('/');
|
25
|
+
searchRegex=Regexp.new "#{parts[0]}\\\\#{parts[1]}\\\\#{parts[2]}@[\\d]+"
|
26
|
+
#searchRegex=Regexp.new "#{words[0].gsub('/','\\\\')}@[\\d]+"
|
27
|
+
self[k]={ glob: "**/*.#{ext}", search: searchRegex, replace: "#{words[0].gsub('/','\\')}@#{v[:rev]}", auto: true }
|
28
|
+
else
|
29
|
+
group=v[:dir].split('/')[0]
|
30
|
+
name=v[:dir].split('/')[1]
|
31
|
+
searchRegex=Regexp.new "#{group}\\\\#{name}\\\\[\\d]+"
|
32
|
+
self[k]={ glob: "**/*.#{ext}", search: searchRegex, replace: "#{group}\\#{name}\\#{v[:rev]}", auto: true }
|
33
|
+
end
|
26
34
|
else
|
27
35
|
puts_debug "skipping key #{k.to_s}"
|
28
36
|
end
|