Created
May 14, 2014 01:04
-
-
Save hsbt/8385215b09080fb318d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'logger' | |
class RakeExcecuter < Logger::Application | |
def initialize(tasklist = []) | |
super | |
@tasklist = tasklist | |
end | |
private | |
def run | |
@tasklist.each do |task| | |
log(Logger::DEBUG, "#{task} start") | |
# Rake::Task[task].invoke | |
p task | |
log(Logger::DEBUG, "#{task} end") | |
end | |
end | |
end | |
RakeExcecuter.new(%w(db:migrate db:seed)).start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
% ruby sample.rb
I, [2014-05-14T09:54:58.024921 #26901] INFO -- ["db:migrate", "db:seed"]: Start of ["db:migrate", "db:seed"].
D, [2014-05-14T09:54:58.024996 #26901] DEBUG -- ["db:migrate", "db:seed"]: db:migrate start
"db:migrate"
D, [2014-05-14T09:54:58.025031 #26901] DEBUG -- ["db:migrate", "db:seed"]: db:migrate end
D, [2014-05-14T09:54:58.025068 #26901] DEBUG -- ["db:migrate", "db:seed"]: db:seed start
"db:seed"
D, [2014-05-14T09:54:58.025094 #26901] DEBUG -- ["db:migrate", "db:seed"]: db:seed end
I, [2014-05-14T09:54:58.025119 #26901] INFO -- ["db:migrate", "db:seed"]: End of ["db:migrate", "db:seed"]. (status: ["db:migrate", "db:seed"])