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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/hx.rb +7 -9
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.2
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(/(\*\*)|(\*)|([^*]+)/).map { |s2, s, r|
129
- case
130
- when s2
131
- ".*"
132
- when s
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
- }.join("")}$"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - MenTaLguY