hx 0.7.2 → 0.7.4
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.
- 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
|