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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7c24053ef1f98a6a5fe8e1caf5def46d81be0ea
4
- data.tar.gz: d4f917e500ca4e31cbde8957065c3db8606ede1c
3
+ metadata.gz: d857637d882d5322746e18a7a59d061ced453dbf
4
+ data.tar.gz: b52d15db6ec6cfc6e8f08bca241279912e74839a
5
5
  SHA512:
6
- metadata.gz: 1b69db18cbf7fbb044d6d5d214a3bbac92f72440b855a9a853ed603e531fbef58754995dff83acffec947772eb0d0982a8fe324376f484cc611987a2a7f39885
7
- data.tar.gz: 879bcda49ce04ad7f7d10f93cf4d66abde104b6eabe9efbdf198f27d35e5bf0d0b46874b6a06fb7b589d8b8fc90d2fa66b1cb6562d696634fc0543b5c7543532
6
+ metadata.gz: 07c809c74fd85b83de132d96c8912cd0931c267a267767aa4619bfb330f84d68c50d3f32e85ee12a32f78ace7485f6ae8f979e58f13719f62c0bf694cdfea756
7
+ data.tar.gz: 603c95508f385fb65dbee455fd1f9f8babe842b399f73bec1b596d10bb60158d0f6427a60e3c36573f9ddd5da15cf0c8c2cebd10959812241282adfc8c13919f
data/.travis.yml CHANGED
@@ -10,5 +10,6 @@ rvm:
10
10
  env: COVERAGE=true
11
11
  matrix:
12
12
  allow_failures:
13
- - rvm: "rbx-2"
13
+ - rvm: rbx-2
14
+ - rvm: ruby-head
14
15
 
@@ -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
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Build
22
22
  module Files
23
- VERSION = "1.1.0"
23
+ VERSION = "1.2.0"
24
24
  end
25
25
  end
@@ -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.1.0
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-25 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler