jbarnette-lather 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.markdown CHANGED
@@ -71,12 +71,12 @@ optional. See Lather's `Rakefile` for a working example.
71
71
 
72
72
  ## Hacking
73
73
 
74
- `rake lather` will watch `lib` and `test` and re-run the tests when
74
+ `rake test:lather` will watch `lib` and `test` and re-run the tests when
75
75
  something changes. If you're looking for something to work on, chew on
76
76
  these:
77
77
 
78
78
  * A way to get at the list of changed files in a `-r` command and
79
- the Rake task.
79
+ the Rake tasks.
80
80
 
81
81
  * Some default exclude (like backup/editor files, `.svn`, `.git`)
82
82
  patterns, and an easy way to add new ones.
@@ -1,3 +1,3 @@
1
1
  module Lather
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -63,10 +63,25 @@ module Rake
63
63
  yield self if block_given?
64
64
 
65
65
  desc "Run the tests"
66
- task(:test) { testify FileList[@tests] }
66
+ task :test, [:tests] do |task, args|
67
67
 
68
- namespace :test do
68
+ tests = if args.tests.nil? || args.tests.empty?
69
+ FileList[@tests]
70
+ else
71
+ args.tests
72
+ end
73
+
74
+ cmd = @flags.dup
75
+ cmd << "-I#{@libs.join(':')}"
76
+ cmd << "-e 'ARGV.each { |f| load f }'"
69
77
 
78
+ cmd.concat tests.collect { |f| "'#{f}'" }.sort_by { rand }
79
+ cmd.concat @extras
80
+
81
+ RakeFileUtils.verbose(@verbose) { ruby cmd.join(" ") }
82
+ end
83
+
84
+ namespace :test do
70
85
  desc "Test, rinse, repeat"
71
86
  task :lather do
72
87
  watcher = Lather::Watcher.new @files, @tests, @options do |changed|
@@ -80,10 +95,18 @@ module Rake
80
95
  tests.concat all_tests.
81
96
  select { |t| basenames.any? { |b| t =~ /#{b}/ } }
82
97
 
98
+ task = Rake::Task[:test]
99
+
83
100
  begin
84
- testify tests.empty? ? all_tests : tests.uniq
101
+ task.invoke tests.uniq
85
102
  rescue StandardError => e
86
103
  raise e unless e.to_s =~ /^Command failed/
104
+ ensure
105
+
106
+ # FIXME: walk the whole tree
107
+
108
+ task.reenable
109
+ task.prerequisites.each { |p| Rake::Task[p].reenable }
87
110
  end
88
111
  end
89
112
 
@@ -91,18 +114,5 @@ module Rake
91
114
  end
92
115
  end
93
116
  end
94
-
95
- private
96
-
97
- def testify tests
98
- cmd = @flags.dup
99
- cmd << "-I#{@libs.join(':')}"
100
- cmd << "-e 'ARGV.each { |f| load f }'"
101
-
102
- cmd.concat tests.collect { |f| "'#{f}'" }.sort_by { rand }
103
- cmd.concat @extras
104
-
105
- RakeFileUtils.verbose(@verbose) { ruby cmd.join(" ") }
106
- end
107
117
  end
108
118
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbarnette-lather
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Barnette