build-files 0.2.4 → 0.2.5
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/path.rb +5 -0
- data/lib/build/files/state.rb +4 -0
- data/lib/build/files/version.rb +1 -1
- data/spec/build/files/path_spec.rb +7 -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: 9f8d979ca269abf303a7196c8bd872b44d7dbfff
|
4
|
+
data.tar.gz: 166555ad73dbc6dea7f112c84fd2d409ea116727
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6df78d64005b0393a7046fca325c19cc128ec2747635687b81278e5f55dfdcd30d8e0c183b884edd3032b693f1655d6930ad8277edf17ba11a0dab4f9967677f
|
7
|
+
data.tar.gz: 14dcbdd89245d6c3cebb51a35bd8e6dad7be5f81ae12bcecb9099edd3c5cf28d9cec8255dab86a1a0b846c6d378cb4a7864e83ad4c3afd701ef2aa0ae15362d7
|
data/lib/build/files/path.rb
CHANGED
@@ -123,6 +123,11 @@ module Build
|
|
123
123
|
self.class.new(File.join(@full_path, path), @root)
|
124
124
|
end
|
125
125
|
|
126
|
+
# Define a new root with a sub-path:
|
127
|
+
def /(path)
|
128
|
+
self.class.new(File.join(self, path), self)
|
129
|
+
end
|
130
|
+
|
126
131
|
def rebase(root)
|
127
132
|
self.class.new(File.join(root, relative_path), root)
|
128
133
|
end
|
data/lib/build/files/state.rb
CHANGED
@@ -83,11 +83,13 @@ module Build
|
|
83
83
|
# Path was valid last update:
|
84
84
|
if modified_time != last_time
|
85
85
|
@changed << path
|
86
|
+
|
86
87
|
# puts "Changed: #{path}"
|
87
88
|
end
|
88
89
|
else
|
89
90
|
# Path didn't exist before:
|
90
91
|
@added << path
|
92
|
+
|
91
93
|
# puts "Added: #{path}"
|
92
94
|
end
|
93
95
|
|
@@ -98,11 +100,13 @@ module Build
|
|
98
100
|
end
|
99
101
|
else
|
100
102
|
@missing << path
|
103
|
+
|
101
104
|
# puts "Missing: #{path}"
|
102
105
|
end
|
103
106
|
end
|
104
107
|
|
105
108
|
@removed = last_times.keys
|
109
|
+
# puts "Removed: #{@removed.inspect}" if @removed.size > 0
|
106
110
|
|
107
111
|
@oldest_time = file_times.min
|
108
112
|
@newest_time = file_times.max
|
data/lib/build/files/version.rb
CHANGED
@@ -113,5 +113,12 @@ module Build::Files::PathSpec
|
|
113
113
|
|
114
114
|
expect(path + "d/e/f").to be == "/a/b/c/d/e/f"
|
115
115
|
end
|
116
|
+
|
117
|
+
it "should have a new root" do
|
118
|
+
rerooted_path = path / "cat"
|
119
|
+
|
120
|
+
expect(rerooted_path.root).to be == "/foo/bar/baz"
|
121
|
+
expect(rerooted_path.relative_path).to be == "cat"
|
122
|
+
end
|
116
123
|
end
|
117
124
|
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: 0.2.
|
4
|
+
version: 0.2.5
|
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-06-
|
11
|
+
date: 2014-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|