tdd 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +2 -2
  3. data/README.md +13 -13
  4. data/bin/tdd +9 -8
  5. data/lib/tdd/version.rb +1 -1
  6. data/tdd.gemspec +2 -1
  7. metadata +7 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 368f3daf06021715572401b871159494120b9318
4
- data.tar.gz: ab3d9e08925f88bc210a6251c5377aa8e5a97231
3
+ metadata.gz: c75190b3ff4348e310389d9fc6e81de95996958f
4
+ data.tar.gz: 0a7e58a0f29d49a73a2e672455f94c7f1db9bdb8
5
5
  SHA512:
6
- metadata.gz: edb70357deb6fea4f7e4674e9ecc54153682461d33c20602bf4b1e3c1342c9591399ddd5d3332fc8ac1ce16c283080b8ae1bf78584ea1bff35a7b3df5f429474
7
- data.tar.gz: f0d008a084a7c111f50b6a62b0f5cc388716786945fe453bdde30bce13e586760a354b9ef35d3ff69ceaf2fee0f4925aa06dbca47802babeefd6200f19b84de0
6
+ metadata.gz: 1da59ee19258a4eedf365b430d554b042540e34dff76daab110f3fa96dfa7fdab51efef40f8403b819e71fd0b677575bdfae35cfce9690e0d6c10b19d79a7837
7
+ data.tar.gz: 53ed028785d03ac7d2d0a2ca4d1453d181c286d91202a8d5f1707fb18e17737451af941e164629b9ff978bf78ab3bc6c39cf85de0795a71e9b9c4edc9965cb7c
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Tyler Montgomery
1
+ Copyright (c) 2012-2017 Tyler Montgomery
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -4,34 +4,34 @@ tdd
4
4
  [![Gem Version](https://badge.fury.io/rb/tdd.png)](http://badge.fury.io/rb/tdd)
5
5
  [![Code Climate](https://codeclimate.com/github/ubermajestix/tdd.png)](https://codeclimate.com/github/ubermajestix/tdd)
6
6
 
7
- ####A simple command line tool for running tests when files change.
8
- #####Yes, it is awesome. :red_circle: :green_heart: :repeat:
7
+ #### A simple command line tool for running tests when files change.
8
+ ##### Yes, it is awesome. :red_circle: :green_heart: :repeat:
9
9
 
10
10
  Examples
11
11
  --------
12
12
 
13
- ###Test::Unit
13
+ ### Test::Unit
14
14
 
15
15
  $ tdd test/unit/some_unit_test.rb
16
16
 
17
- ###RSpec
17
+ ### RSpec
18
18
 
19
19
  $ tdd spec/some_spec.rb
20
20
  # Run all specs
21
21
  $ tdd spec
22
22
 
23
- ###Rake
23
+ ### Rake
24
24
 
25
25
  $ tdd rake test:functional
26
26
  $ tdd rake spec
27
27
 
28
- ###Pass framework specific arguments
28
+ ### Pass framework specific arguments
29
29
  You can pass arguments you would normally pass to `ruby -Itest` or `rspec`, note the double-dash "--".
30
30
 
31
31
  $ tdd -- test/unit/some_unit_test.rb -n /some_test_name/
32
32
  $ tdd -- spec/some_spec.rb:42 --fail-fast
33
33
 
34
- ###Globs by default
34
+ ### Globs by default
35
35
  By default, tdd will search for similarly named files to your test to watch. tdd will look for `some_unit.rb`
36
36
  in your project and watch it for changes, along with the test file.
37
37
 
@@ -42,7 +42,7 @@ in your project and watch it for changes, along with the test file.
42
42
  /Users/ubermajestix/some_project/lib/modules/plugins/stuff/some_unit.rb
43
43
  /Users/ubermajestix/some_project/test/unit/some_unit_test.rb
44
44
 
45
- ###All of the files
45
+ ### All of the files
46
46
  Run tdd in the "all" mode to watch all files in app, lib, config, test, and spec
47
47
  directories, if they exist. The double-dash "--" seperates tdd's modes from the testing command.
48
48
 
@@ -50,23 +50,23 @@ directories, if they exist. The double-dash "--" seperates tdd's modes from the
50
50
  Running: ruby -Itest test/unit/some_unit_test.rb
51
51
  Watching 3417 files in app/ lib/ config/ test/ spec/
52
52
 
53
- ###Some of the files
53
+ ### Some of the files
54
54
  You can specify which files to watch, again, note the double-dash "--"
55
55
  separating the files to watch from the test file and options):
56
56
 
57
57
  $ tdd lib/some_unit.rb config/setup.rb -- test/unit/some_unit_test.rb -n/some_test_name/
58
- ###Wildcard the files
58
+ ### Wildcard the files
59
59
  You can use wildcards in any of the watched filepaths:
60
60
 
61
61
  $ tdd lib/other_class.rb app/models/*class.rb -- test/unit/some_class_test.rb -n/some_test_name/
62
62
 
63
- ###Respects gitignore
63
+ ### Respects gitignore
64
64
  By default tdd ignores any files ignored by git, either through the local .gitignore
65
65
  file or the global ~/.gitignore_global . You can turn this off by passing --gitignore=false:
66
66
 
67
67
  $ tdd --gitignore=false some_file.rb -- test/unit/some_unit.rb -n/some_test_name/
68
68
 
69
- ###Weird Rails specific mode
69
+ ### Weird Rails specific mode
70
70
  In a Rails project you can ask tdd to watch view and controller files
71
71
  related to a functional or controller test:
72
72
 
@@ -75,7 +75,7 @@ related to a functional or controller test:
75
75
  will watch all view files in app/views/users, the users_controller and the
76
76
  test file for changes.
77
77
 
78
- ###Now with more Growl
78
+ ### Now with more Growl
79
79
  Supports Growl notifs. To enable, pass in --growl like so:
80
80
 
81
81
  $ tdd controller --growl -- spec/controllers/users_controller_spec.rb
data/bin/tdd CHANGED
@@ -240,7 +240,6 @@ In Growl's preferences you can enable/disable both 'passed' and 'failed' notifs.
240
240
  nil
241
241
  end
242
242
  end
243
- fsevent = FSEvent.new
244
243
 
245
244
  n = '0'
246
245
  line = '#' * 42
@@ -248,14 +247,16 @@ In Growl's preferences you can enable/disable both 'passed' and 'failed' notifs.
248
247
 
249
248
  tdd = proc do |files|
250
249
  puts line
251
- say("# starting test run #{ n } @ #{ Time.now.strftime('%H:%M:%S') } - #{ @command }", :color => :magenta)
250
+ start_time = Time.now
251
+ say("# Starting test run #{ n } @ #{ Time.now.strftime('%H:%M:%S') } - #{ @command }", :color => :magenta)
252
252
  say("# #{files.size > 1 ? 'files' : 'file'} changed: #{files.join(', ')}", :color => :magenta) if files && files.any?
253
253
  puts
254
254
  begin
255
255
  tests_results = system(@command, :out => $stdout, :err => :out)
256
256
  tests_pass = $?.success?
257
257
  exit_status = $?.exitstatus
258
- say("# finished test run #{ n } @ #{ Time.now.strftime('%H:%M:%S') } - #{ exit_status }", :color => :yellow)
258
+ took = Time.now - start_time
259
+ say("# Finished test run #{ n } @ #{ Time.now.strftime('%H:%M:%S') } Took: #{took}s - Exit Status: #{ exit_status }", :color => :yellow)
259
260
  rescue Interrupt
260
261
  puts
261
262
  say("# stopping tests - ctl-c again to exit tdd", :color => :red)
@@ -274,18 +275,19 @@ In Growl's preferences you can enable/disable both 'passed' and 'failed' notifs.
274
275
 
275
276
  tdd.call
276
277
 
277
- fsevent.watch(directories) do |*args|
278
+ fsevent = FSEvent.new
279
+ fsevent.watch(directories) do |changed_directories, event_meta|
278
280
  entries_changed = []
279
281
  unless $running
280
282
  $running = true
281
- args.flatten.each do |dir|
283
+ # Recurse through all the files in the directory that changed and look
284
+ # for files that have been modified.
285
+ changed_directories.flatten.each do |dir|
282
286
  glob = File.join(dir, '**/**')
283
287
  entries = Dir.glob(glob)
284
-
285
288
  entries.each do |entry|
286
289
  entry = File.expand_path(entry)
287
290
  next unless stats.has_key?(entry)
288
-
289
291
  begin
290
292
  stats[entry] ||= File.stat(entry)
291
293
  before = stats[entry]
@@ -309,7 +311,6 @@ In Growl's preferences you can enable/disable both 'passed' and 'failed' notifs.
309
311
  end
310
312
  $running = false
311
313
  end
312
-
313
314
  fsevent.run
314
315
  end
315
316
  }
@@ -1,3 +1,3 @@
1
1
  module Tdd
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
@@ -14,9 +14,10 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "tdd"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Tdd::VERSION
17
+ gem.license = 'MIT'
17
18
 
18
19
 
19
20
  gem.add_runtime_dependency "main", "~> 5.0"
20
- gem.add_runtime_dependency "rb-fsevent", "~> 0.9"
21
+ gem.add_runtime_dependency "rb-fsevent", "~> 0.10"
21
22
  gem.add_runtime_dependency "ruby_gntp"
22
23
  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.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Montgomery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-02 00:00:00.000000000 Z
11
+ date: 2017-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: main
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.9'
33
+ version: '0.10'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.9'
40
+ version: '0.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ruby_gntp
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,7 +72,8 @@ files:
72
72
  - lib/tdd/version.rb
73
73
  - tdd.gemspec
74
74
  homepage: ''
75
- licenses: []
75
+ licenses:
76
+ - MIT
76
77
  metadata: {}
77
78
  post_install_message:
78
79
  rdoc_options: []
@@ -90,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
91
  version: '0'
91
92
  requirements: []
92
93
  rubyforge_project:
93
- rubygems_version: 2.2.2
94
+ rubygems_version: 2.6.11
94
95
  signing_key:
95
96
  specification_version: 4
96
97
  summary: ''