Skip to content
Browse files

Refactor Rakefile into separate tasks

  • Loading branch information...
1 parent 801ef95 commit f64777fe7986a5a36667d2a107bdd09ea56855cc @tarcieri tarcieri committed
Showing with 42 additions and 24 deletions.
  1. +2 −24 Rakefile
  2. +13 −0 tasks/benchmarks.rb
  3. +13 −0 tasks/benchmarks.task
  4. +7 −0 tasks/rspec.rb
  5. +7 −0 tasks/rspec.task
View
26 Rakefile
@@ -1,26 +1,4 @@
-require 'rubygems'
-require 'bundler'
-require 'timeout'
-Bundler::GemHelper.install_tasks
-
-require 'rspec/core/rake_task'
-
-RSpec::Core::RakeTask.new
-
-RSpec::Core::RakeTask.new(:rcov) do |task|
- task.rcov = true
-end
-
-desc "Run Celluloid benchmarks"
-task :benchmark do
- begin
- Timeout.timeout(120) do
- load File.expand_path("../benchmarks/objects.rb", __FILE__)
- end
- rescue Exception, Timeout::Error => ex
- puts "ERROR: Couldn't complete benchmark: #{ex.class}: #{ex}"
- exit 1 unless ENV['CI'] # Hax for running benchmarks on Travis
- end
-end
+require "bundler/gem_tasks"
+Dir["tasks/**/*.task"].each { |task| load task }
task :default => %w(spec benchmark)
View
13 tasks/benchmarks.rb
@@ -0,0 +1,13 @@
+require 'timeout'
+
+desc "Run Celluloid benchmarks"
+task :benchmark do
+ begin
+ Timeout.timeout(120) do
+ load File.expand_path("../../benchmarks/objects.rb", __FILE__)
+ end
+ rescue Exception, Timeout::Error => ex
+ puts "ERROR: Couldn't complete benchmark: #{ex.class}: #{ex}"
+ exit 1 unless ENV['CI'] # Hax for running benchmarks on Travis
+ end
+end
View
13 tasks/benchmarks.task
@@ -0,0 +1,13 @@
+require 'timeout'
+
+desc "Run Celluloid benchmarks"
+task :benchmark do
+ begin
+ Timeout.timeout(120) do
+ load File.expand_path("../../benchmarks/objects.rb", __FILE__)
+ end
+ rescue Exception, Timeout::Error => ex
+ puts "ERROR: Couldn't complete benchmark: #{ex.class}: #{ex}"
+ exit 1 unless ENV['CI'] # Hax for running benchmarks on Travis
+ end
+end
View
7 tasks/rspec.rb
@@ -0,0 +1,7 @@
+require 'rspec/core/rake_task'
+
+RSpec::Core::RakeTask.new
+
+RSpec::Core::RakeTask.new(:rcov) do |task|
+ task.rcov = true
+end
View
7 tasks/rspec.task
@@ -0,0 +1,7 @@
+require 'rspec/core/rake_task'
+
+RSpec::Core::RakeTask.new
+
+RSpec::Core::RakeTask.new(:rcov) do |task|
+ task.rcov = true
+end

0 comments on commit f64777f

Please sign in to comment.
Something went wrong with that request. Please try again.