Skip to content

Commit

Permalink
print a timestamp in each commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jugyo committed Feb 2, 2011
1 parent bbf72db commit eb28aaf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rails/sh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ def setup_readline
end

def execute(line)
start = Time.now
if command = Command.find(line)
arg = line.split(/\s+/, 2)[1] rescue nil
command.call(arg)
else
execute_rails_command(line)
end
puts "\e[34m#{Time.now - start}sec\e[0m"
end

def execute_rails_command(line)
Expand Down

0 comments on commit eb28aaf

Please sign in to comment.