fast_rake 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -88,8 +88,8 @@ class FastRake::FastRunner
88
88
  def setup_database(task_name)
89
89
  ENV["TEST_DB_NAME"] = "test_#{task_string(task_name)}"
90
90
  puts "RAILS_ENV is #{ENV["RAILS_ENV"]} and TEST_DB_NAME is #{ENV["TEST_DB_NAME"]}"
91
- Rake::Task["db:create"].reenable
92
- Rake::Task["db:create"].invoke
91
+ Rake::Task["db:recreate"].reenable
92
+ Rake::Task["db:recreate"].invoke
93
93
  Rake::Task["db:test:prepare"].reenable
94
94
  Rake::Task["db:test:prepare"].invoke
95
95
  end
@@ -116,6 +116,13 @@ class FastRake::FastRunner
116
116
  put_w_time "#{YELLOW}Remaining: #{@tasks.join(' ')}#{RESET}"
117
117
  end
118
118
 
119
+ def puts_rerun
120
+ return if @children.length == 0
121
+ child_names = @children.values.collect { |v| v[:name] }
122
+ outstanding = [task[:name], child_names, @tasks].flatten
123
+ put_w_time "#{YELLOW}Rerun with: ['#{outstanding.join(' ')}']#{RESET}"
124
+ end
125
+
119
126
  def wait_for_task_with_timeout(pid, timeout=5)
120
127
  begin
121
128
  Timeout::timeout(timeout) {
@@ -144,7 +151,7 @@ class FastRake::FastRunner
144
151
  else
145
152
  if !@failed
146
153
  put_w_time "#{RED}[#{task[:name]}] Build failed. Output can be found in #{output_path}#{RESET}"
147
- puts_still_running
154
+ puts_rerun
148
155
  @failed=true
149
156
  kill_remaining_children
150
157
  end
@@ -1,6 +1,6 @@
1
1
  module FastRake
2
2
  VERSION_MAJOR = 0
3
3
  VERSION_MINOR = 0
4
- VERSION_PATCH = 4
4
+ VERSION_PATCH = 5
5
5
  VERSION = [VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH].join('.')
6
6
  end
data/lib/fast_rake.rb CHANGED
@@ -2,6 +2,7 @@ require 'fast_rake/version'
2
2
  require 'fast_rake/fast_runner'
3
3
 
4
4
  module FastRake
5
+ extend Rake::DSL
5
6
 
6
7
  def self.fast_runner(setup_tasks, run_tasks)
7
8
  fast_runner_task(:two, 2, setup_tasks, run_tasks)
@@ -10,7 +11,6 @@ module FastRake
10
11
  end
11
12
 
12
13
  def self.fast_runner_task(name, processes, setup_tasks, run_tasks)
13
-
14
14
  desc "Fast test runner for #{processes} cpus"
15
15
  task name, [:list] => setup_tasks do |t, args|
16
16
  tasks_to_run = if !args[:list].nil?
@@ -18,10 +18,8 @@ module FastRake
18
18
  else
19
19
  run_tasks
20
20
  end
21
- #puts %{\n\e[33mTo rerun: ber "fast:#{name}[#{tasks_to_run.join(' ')}]"\033[0m\n\n}
22
21
  FastRunner.new(tasks_to_run, processes).run
23
22
  end
24
23
  end
25
24
 
26
-
27
25
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_rake
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jonathan Ricketson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-07 00:00:00 Z
18
+ date: 2012-09-09 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: gemma
@@ -25,12 +25,12 @@ dependencies:
25
25
  requirements:
26
26
  - - ~>
27
27
  - !ruby/object:Gem::Version
28
- hash: 11
28
+ hash: 7
29
29
  segments:
30
30
  - 2
31
- - 1
31
+ - 2
32
32
  - 0
33
- version: 2.1.0
33
+ version: 2.2.0
34
34
  type: :development
35
35
  version_requirements: *id001
36
36
  description: "\n Runs a small number of setup tasks, followed by a bunch of expensive tasks in parallel.\n This manages the number of running tasks and keeps the visible output to a small and useful amount.\n It was created to make developer pre-commit builds really fast, but still able to cover a lot of tests.\n "
@@ -52,7 +52,7 @@ licenses: []
52
52
  post_install_message:
53
53
  rdoc_options:
54
54
  - --title
55
- - fast_rake-0.0.4 Documentation
55
+ - fast_rake-0.0.5 Documentation
56
56
  require_paths:
57
57
  - lib
58
58
  required_ruby_version: !ruby/object:Gem::Requirement