pathspec 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/lib/pathspec.rb +1 -1
- data/spec/unit/pathspec_spec.rb +9 -0
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 326cb387706e8df95bce9c259781ab7101e94163
|
4
|
+
data.tar.gz: 403d0e22353ce7efe78bd805c4b387813d548097
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 675179bbf0e44eef814732e015545c8ea27ae99eab0b572337e127ddb68124e7e903853081a8613d937055b557a0fc1d032899f908cc7a856b215e29e0044e81
|
7
|
+
data.tar.gz: ef1446b84a159f3646802e61981ff84d61bf2b08311dcd214687977a062b5c6a30d6ed95eb4afbe1b052a08190460a0d1bdc147c792ca988760fbc9c8618e2d9
|
data/lib/pathspec.rb
CHANGED
@@ -75,7 +75,7 @@ class PathSpec
|
|
75
75
|
|
76
76
|
# Generate specs from a filename, such as a .gitignore
|
77
77
|
def self.from_filename(filename, type=:git)
|
78
|
-
self.from_lines(File.open(filename, 'r'))
|
78
|
+
self.from_lines(File.open(filename, 'r'), type)
|
79
79
|
end
|
80
80
|
|
81
81
|
def self.from_lines(lines, type=:git)
|
data/spec/unit/pathspec_spec.rb
CHANGED
@@ -307,6 +307,15 @@ REGEX
|
|
307
307
|
expect(subject.match('anna')).to be false
|
308
308
|
expect(subject.match('abba')).to be true
|
309
309
|
end
|
310
|
+
|
311
|
+
context "#from_filename" do
|
312
|
+
it "forwards the type argument" do
|
313
|
+
expect(File).to receive(:open).and_return(anything)
|
314
|
+
expect(PathSpec).to receive(:from_lines).with(anything, :regex)
|
315
|
+
|
316
|
+
PathSpec.from_filename "/some/file", :regex
|
317
|
+
end
|
318
|
+
end
|
310
319
|
end
|
311
320
|
|
312
321
|
context "unsuppored spec type" do
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pathspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon High
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.15'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.15'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '3.6'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '3.6'
|
41
41
|
description: Use to match path patterns such as gitignore
|
42
42
|
email: bh@brandon-high.com
|
43
43
|
executables: []
|