hx 0.7.2 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/hx.rb +7 -9
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.4
|
data/lib/hx.rb
CHANGED
@@ -125,16 +125,13 @@ class PathSubset::Predicate
|
|
125
125
|
private :patterns_to_re
|
126
126
|
|
127
127
|
def pattern_to_re(pattern)
|
128
|
-
"^#{pattern.scan(/(
|
129
|
-
case
|
130
|
-
when
|
131
|
-
|
132
|
-
|
133
|
-
"[^/]*"
|
134
|
-
when r
|
135
|
-
Regexp.quote(r)
|
128
|
+
"^#{pattern.scan(/(\*\*?|[^*]+)/).map { |s,|
|
129
|
+
case s
|
130
|
+
when "**"; ".*"
|
131
|
+
when "*"; "[^/]*"
|
132
|
+
else Regexp.quote(s)
|
136
133
|
end
|
137
|
-
}
|
134
|
+
}}$"
|
138
135
|
end
|
139
136
|
private :pattern_to_re
|
140
137
|
end
|
@@ -570,6 +567,7 @@ def self.write_file(pathname, content)
|
|
570
567
|
tempfile = Tempfile.new('.hx-out', parent.to_s)
|
571
568
|
begin
|
572
569
|
File.open(tempfile.path, "wb") { |stream| stream << content.to_s }
|
570
|
+
File.chmod(0666 & ~File.umask, tempfile.path)
|
573
571
|
File.rename(tempfile.path, pathname.to_s)
|
574
572
|
ensure
|
575
573
|
tempfile.unlink
|