build-files 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/build/files/directory.rb +11 -13
- data/lib/build/files/version.rb +1 -1
- data/spec/build/files/directory_spec.rb +2 -2
- 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: 130ed7e444f0f892eb13d423522cf1474f8dc08f
|
4
|
+
data.tar.gz: 0807096d74e6d2cdb5d4d84edf6ea42490181048
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05789c4a0450ec6fb506f9aa06dc31591e7fb1862ad686c55fe3265ddcd1e96a134fa6a6eb91d903c35213aa56fb9157b245371c77779084098741db5b694deb
|
7
|
+
data.tar.gz: 4e3d50d571f258afae6f633c3e5c59766d8a5e4566d589d8c196cd12dd60c0fd0f98bb021ad72a598ec6c90261c5229b14bd5e81c33a1a7168af43f5115cbdb1
|
@@ -27,14 +27,12 @@ module Build
|
|
27
27
|
self.new(Path.join(*args))
|
28
28
|
end
|
29
29
|
|
30
|
-
def initialize(
|
31
|
-
@
|
30
|
+
def initialize(root)
|
31
|
+
@root = root
|
32
32
|
end
|
33
33
|
|
34
|
-
attr :path
|
35
|
-
|
36
34
|
def root
|
37
|
-
@
|
35
|
+
@root
|
38
36
|
end
|
39
37
|
|
40
38
|
def roots
|
@@ -44,34 +42,34 @@ module Build
|
|
44
42
|
def each
|
45
43
|
return to_enum(:each) unless block_given?
|
46
44
|
|
47
|
-
Dir.glob(@
|
48
|
-
yield Path.new(path, @
|
45
|
+
Dir.glob(@root + "**/*") do |path|
|
46
|
+
yield Path.new(path, @root)
|
49
47
|
end
|
50
48
|
end
|
51
49
|
|
52
50
|
def eql?(other)
|
53
|
-
self.class.eql?(other.class) and @
|
51
|
+
self.class.eql?(other.class) and @root.eql?(other.root)
|
54
52
|
end
|
55
53
|
|
56
54
|
def hash
|
57
|
-
@
|
55
|
+
@root.hash
|
58
56
|
end
|
59
57
|
|
60
58
|
def include?(path)
|
61
59
|
# Would be true if path is a descendant of full_path.
|
62
|
-
path.start_with?(@
|
60
|
+
path.start_with?(@root)
|
63
61
|
end
|
64
62
|
|
65
63
|
def rebase(root)
|
66
|
-
self.class.new(@
|
64
|
+
self.class.new(@root.rebase(root))
|
67
65
|
end
|
68
66
|
|
69
67
|
def to_str
|
70
|
-
@
|
68
|
+
@root.to_str
|
71
69
|
end
|
72
70
|
|
73
71
|
def to_path
|
74
|
-
@
|
72
|
+
@root
|
75
73
|
end
|
76
74
|
end
|
77
75
|
end
|
data/lib/build/files/version.rb
CHANGED
@@ -28,8 +28,8 @@ module Build::Files::DirectorySpec
|
|
28
28
|
let(:directory) {Directory.new(path)}
|
29
29
|
|
30
30
|
it "has a root and path component" do
|
31
|
-
expect(directory.root).to be == path
|
32
|
-
expect(directory.
|
31
|
+
expect(directory.root).to be == path
|
32
|
+
expect(directory.roots).to be_include(path)
|
33
33
|
end
|
34
34
|
|
35
35
|
it "includes subpaths" do
|
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: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|