build-files 0.3.2 → 0.3.3

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: 2e83395d241b8365a554f4f56d3c6a79019e4912
4
- data.tar.gz: 02c1657d7907c8a9955b1d329cb343cd5946a1af
3
+ metadata.gz: 3809d8bed57d7862f74c35cda9b396784537f26e
4
+ data.tar.gz: 1a0551a1f94d10ef77f3daf7ef23c71ed7640a74
5
5
  SHA512:
6
- metadata.gz: ce8ea60d34378a7bd007479e5ec7b005819d5484421adfc14bae08331eca00b5e62c6eee56ad8828d8547b4c06339c9d644ff46f94e0f77fd481e664b354cdf3
7
- data.tar.gz: 84980ca0c4bfc21caf219355276ff44463c665b0d0e4802603d92a583ba9288513a03e9bc3877e1d6b9e2a2bd86799e8c3d5405019e2326e6324e91340ca8824
6
+ metadata.gz: d2cf244dd15dddc8d0f9649efb3cbf82ff6b1b10687d593d3dbe6656c549c802934139906895c6f508f36cd29095157984c0eb70837fa8a58218866ce7fb756c
7
+ data.tar.gz: ade83990959c59d889dc1e77489b115536e262499036d36be0db7dd3479f7260df3e8a3d6f9029086e4319612a738a9f2d0d871b5d226e54716158fab4729565
@@ -179,6 +179,8 @@ module Build
179
179
  catch(:interrupt) do
180
180
  while true
181
181
  notifier.watch monitor.roots do |directories|
182
+ directories.collect!{|directory| File.expand_path(directory)}
183
+
182
184
  monitor.update(directories)
183
185
 
184
186
  yield
@@ -75,6 +75,9 @@ module Build
75
75
  # Effectively dirname and basename:
76
76
  @root, _, @relative_path = full_path.rpartition(File::SEPARATOR)
77
77
  end
78
+
79
+ # This improves the cost of hash/eql? slightly but the root cannot be deconstructed if it was an instance of Path.
80
+ # @root = @root.to_s
78
81
  end
79
82
 
80
83
  def components
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Build
22
22
  module Files
23
- VERSION = "0.3.2"
23
+ VERSION = "0.3.3"
24
24
  end
25
25
  end
@@ -51,10 +51,14 @@ module Build::Files::MonitorSpec
51
51
  changed = state.added.include? path
52
52
  end
53
53
 
54
+ touched = false
55
+
54
56
  thread = Thread.new do
55
- sleep 1.0
57
+ sleep 0.1
56
58
 
57
59
  path.touch
60
+
61
+ touched = true
58
62
  end
59
63
 
60
64
  triggered = 0
@@ -62,13 +66,13 @@ module Build::Files::MonitorSpec
62
66
  monitor.run do
63
67
  triggered += 1
64
68
 
65
- throw :interrupt
69
+ throw :interrupt if touched
66
70
  end
67
71
 
68
72
  thread.join
69
73
 
70
74
  expect(changed).to be true
71
- expect(triggered).to be == 1
75
+ expect(triggered).to be >= 1
72
76
  end
73
77
  end
74
78
  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.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-19 00:00:00.000000000 Z
11
+ date: 2015-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler