build-files 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/lib/build/files/path.rb +7 -0
- data/lib/build/files/version.rb +1 -1
- data/spec/build/files/path_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d857637d882d5322746e18a7a59d061ced453dbf
|
4
|
+
data.tar.gz: b52d15db6ec6cfc6e8f08bca241279912e74839a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07c809c74fd85b83de132d96c8912cd0931c267a267767aa4619bfb330f84d68c50d3f32e85ee12a32f78ace7485f6ae8f979e58f13719f62c0bf694cdfea756
|
7
|
+
data.tar.gz: 603c95508f385fb65dbee455fd1f9f8babe842b399f73bec1b596d10bb60158d0f6427a60e3c36573f9ddd5da15cf0c8c2cebd10959812241282adfc8c13919f
|
data/.travis.yml
CHANGED
data/lib/build/files/path.rb
CHANGED
@@ -200,6 +200,13 @@ module Build
|
|
200
200
|
self.to_s == other.to_s
|
201
201
|
end
|
202
202
|
|
203
|
+
# Match a path with a given pattern, using `File#fnmatch`.
|
204
|
+
def match(pattern, flags = 0)
|
205
|
+
path = pattern.start_with?('/') ? full_path : relative_path
|
206
|
+
|
207
|
+
return File.fnmatch(pattern, path, flags)
|
208
|
+
end
|
209
|
+
|
203
210
|
def for_reading
|
204
211
|
[@full_path, File::RDONLY]
|
205
212
|
end
|
data/lib/build/files/version.rb
CHANGED
@@ -180,5 +180,16 @@ module Build::Files::PathSpec
|
|
180
180
|
it "should give correct modes for appending" do
|
181
181
|
expect(subject.for_appending).to be == [subject.to_s, File::CREAT|File::APPEND|File::WRONLY]
|
182
182
|
end
|
183
|
+
|
184
|
+
it "should match against relative path" do
|
185
|
+
expect(subject.match(subject.relative_path)).to be_truthy
|
186
|
+
expect(subject.match("*/baz")).to be_truthy
|
187
|
+
expect(subject.match("/baz")).to be_falsey
|
188
|
+
end
|
189
|
+
|
190
|
+
it "should match against absolute path" do
|
191
|
+
expect(subject.match(subject.to_s)).to be_truthy
|
192
|
+
expect(subject.match("/foo/**")).to be_truthy
|
193
|
+
end
|
183
194
|
end
|
184
195
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build-files
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|