tdd 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/tdd +8 -13
  3. data/lib/tdd/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 979d185e4f0e1fbdc1cf7241b2aeecf4321c77ba
4
- data.tar.gz: dfbcb4ac7bf4bba87e12412f7aa43b9a50d546d7
3
+ metadata.gz: c337dcf125a3795f242b37328ed90725a2a657d0
4
+ data.tar.gz: 7c856ba470d40519c294892f3e688dd9b4bb506f
5
5
  SHA512:
6
- metadata.gz: ce6dd7e7511d0e0d1f3d18a3f3505eb2ac482ec710c5dcd76eecb75abf332907aaa3ae91f928b43c889dd7cfed153592c7fa4168e84be06c2dede2b8b018153a
7
- data.tar.gz: 9b48afc09c722a5d0b805bd6a852f2feaf310d70282ceae300d54efddabeaaf012a8853de7363589e16b311e576546c915919b299eeec69dbdcc462cf8a0465c
6
+ metadata.gz: 1c921d3932a72fec950705e48aa0f089269b8b08bf3eb7eb8fe75cd140afcf1319ce34140e0dfb928ad7cd2fdd7ba4970ec8ecc62154b61dbf1cd71dbc432abb
7
+ data.tar.gz: 959cdfc6dde23e9fc68b6d6a127435b0c2aad458bed0adc35c53b380d9e0afa11fa2e33bfdbbd30f29f227523ad4e02501d1b6ac0c80af53330d7561c5016bad
data/bin/tdd CHANGED
@@ -134,7 +134,6 @@ related to a functional or controller test:
134
134
  end
135
135
  directories.uniq!
136
136
  files.uniq!
137
-
138
137
  stats = {}
139
138
 
140
139
  files.each do |file|
@@ -144,24 +143,20 @@ related to a functional or controller test:
144
143
  nil
145
144
  end
146
145
  end
147
-
148
146
  fsevent = FSEvent.new
149
147
 
150
148
  n = '0'
151
149
  line = '#' * 42
152
150
  $running = false
153
151
 
154
- tdd = proc do |*args|
155
- entry = args.shift
156
- cmd = entry ? @command.gsub(/@/, entry) : @command
152
+ tdd = proc do |files|
157
153
  puts line
158
- say("# starting test run #{ n } @ #{ Time.now.strftime('%H:%M:%S') } - #{ cmd }", :color => :magenta)
159
- # TODO if blink1 installed - change its color to purple until the tests are over
154
+ say("# starting test run #{ n } @ #{ Time.now.strftime('%H:%M:%S') } - #{ @command }", :color => :magenta)
155
+ say("# #{files.size > 1 ? 'files' : 'file'} changed: #{files.join(', ')}", :color => :magenta) if files && files.any?
160
156
  puts
161
- tests_pass = system(cmd)
157
+ tests_pass = system(@command)
162
158
  puts
163
159
  say("# finished test run #{ n } @ #{ Time.now.strftime('%H:%M:%S') } - #{ $?.exitstatus }", :color => :yellow)
164
- # TODO if blink1 installed - change its color to yellow and fade out after 30seconds.
165
160
  if tests_pass
166
161
  system("command -v blink1-tool > /dev/null && blink1-tool -d0 --rgb 0,255,0 --blink 3 > /dev/null &")
167
162
  else
@@ -171,12 +166,12 @@ related to a functional or controller test:
171
166
  n.succ!
172
167
  end
173
168
 
174
- tdd[ false ]
169
+ tdd.call
175
170
 
176
171
  fsevent.watch(directories) do |*args|
172
+ entries_changed = []
177
173
  unless $running
178
174
  $running = true
179
-
180
175
  args.flatten.each do |dir|
181
176
  glob = File.join(dir, '**/**')
182
177
  entries = Dir.glob(glob)
@@ -192,14 +187,14 @@ related to a functional or controller test:
192
187
  rescue
193
188
  next
194
189
  end
195
-
196
190
  unless before.mtime == after.mtime
197
191
  stats[entry] = after
198
- tdd[ entry ]
192
+ entries_changed << entry
199
193
  end
200
194
  end
201
195
  end
202
196
  end
197
+ tdd.call(entries_changed) if entries_changed.any?
203
198
  $running = false
204
199
  end
205
200
 
@@ -1,3 +1,3 @@
1
1
  module Tdd
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Montgomery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-17 00:00:00.000000000 Z
11
+ date: 2013-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: main