build-files 1.4.1 → 1.4.2

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
  SHA256:
3
- metadata.gz: 75be5d11ca329694964790490793e9b4c69f240e5259c2dfc92d2d3b4e203c29
4
- data.tar.gz: 7e39cf4d7b6099fe52221a9913f69be7fe491b98fed06ac51c09fb2653b88c7d
3
+ metadata.gz: 227e24df878d95517873d1f07ecc789cff1320ad76090f1da90b3273f46c901e
4
+ data.tar.gz: f086ae85dcabc453cb5ee6155af0d6357db47d828eb0b7733461ecd2065b97d0
5
5
  SHA512:
6
- metadata.gz: f9654a357cb594cd2bfe8d12b07aa23645cb4776029003bf044adf108f50becb5755305610f66071daaba78615cd6d044cf1f1fbd05d129024598e1f4c8dd8da
7
- data.tar.gz: 4412ee3e631e85653dd20e4c1dee03bf01d591eecea225213200b927ab6f921e27b8e79c858c60ea8b07b44d6417befcb94edd7af30009cff7600e1f5d6e1a5c
6
+ metadata.gz: ce4cf1a75166c6cfa4acf0703b05e727c3ec2422ee1f29abfc11c3046f9ede6d6460a314ea449b9346bff2f352c137c2bb0d1f061b34ef71ecfda448020ee79e
7
+ data.tar.gz: 7bcc9d126cf37ae30527b908c0f0f4f799f85eb0ea83ff4dd588393c745ea587e334a6141ceadef393e2b7ca5edcb0aa0343d5f5dda8a3c70b5e38a3eb38a101
@@ -207,8 +207,10 @@ module Build
207
207
  self.class.eql?(other.class) and @root.eql?(other.root) and @full_path.eql?(other.full_path)
208
208
  end
209
209
 
210
- def ==(other)
211
- self.to_s == other.to_s
210
+ include Comparable
211
+
212
+ def <=>(other)
213
+ self.to_s <=> other.to_s
212
214
  end
213
215
 
214
216
  # Match a path with a given pattern, using `File#fnmatch`.
@@ -138,32 +138,35 @@ module Build
138
138
  "<State Added:#{@added} Removed:#{@removed} Changed:#{@changed} Missing:#{@missing}>"
139
139
  end
140
140
 
141
- # Are these files dirty with respect to the given inputs?
141
+ # Are these (output) files dirty with respect to the given inputs?
142
142
  def dirty?(inputs)
143
- self.class.dirty?(inputs, self)
144
- end
145
-
146
- def self.dirty?(inputs, outputs)
147
- if outputs.missing?
148
- # puts "Output file missing: #{output_state.missing.inspect}"
143
+ if self.missing?
149
144
  return true
150
145
  end
151
146
 
152
147
  # If there are no inputs or no outputs, we are always clean:
153
- if inputs.empty? or outputs.empty?
148
+ if inputs.empty? or self.empty?
154
149
  return false
155
150
  end
156
151
 
157
- oldest_output_time = outputs.oldest_time
152
+ oldest_output_time = self.oldest_time
158
153
  newest_input_time = inputs.newest_time
159
154
 
160
155
  if newest_input_time and oldest_output_time
161
156
  # We are dirty if any inputs are newer (bigger) than any outputs:
162
- return newest_input_time > oldest_output_time
157
+ if newest_input_time > oldest_output_time
158
+ return true
159
+ else
160
+ return false
161
+ end
163
162
  end
164
163
 
165
164
  return true
166
165
  end
166
+
167
+ def self.dirty?(inputs, outputs)
168
+ outputs.dirty?(inputs)
169
+ end
167
170
  end
168
171
  end
169
172
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Build
22
22
  module Files
23
- VERSION = "1.4.1"
23
+ VERSION = "1.4.2"
24
24
  end
25
25
  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.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-04 00:00:00.000000000 Z
11
+ date: 2019-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb-inotify