Browse files

Upgrading Require, making migration output pretty

  • Loading branch information...
1 parent 81563fa commit e34de73db9dbf1487ccf05af0c714e8ae4a03edc @winton winton committed Feb 7, 2010
Showing with 11 additions and 7 deletions.
  1. +2 −1 init.rb
  2. +7 −4 lib/acts_as_archive.rb
  3. +2 −2 require.rb
View
3 init.rb
@@ -1 +1,2 @@
-require File.dirname(__FILE__) + "/rails/init"
+require File.dirname(__FILE__) + "/rails/init"
+Require.rails_init!
View
11 lib/acts_as_archive.rb
@@ -6,10 +6,13 @@ module ActsAsArchive
def self.update(*models)
models.each do |klass|
if klass.respond_to?(:acts_as_archive?) && klass.acts_as_archive?
- klass.create_archive_table
- klass.migrate_from_acts_as_paranoid
- klass.create_archive_indexes
- puts 'Success!'
+ time = Benchmark.measure do
+ klass.create_archive_table
+ klass.migrate_from_acts_as_paranoid
+ klass.create_archive_indexes
+ end
+ $stdout.puts "-- ActsAsArchive.update(#{models.join(', ')})"
+ $stdout.puts " -> #{"%.4fs" % time.real}"
end
end
end
View
4 require.rb
@@ -2,9 +2,9 @@
gem 'require'
require 'require'
-Require File.dirname(__FILE__) do
+Require do
gem(:activerecord) { require 'active_record' }
- gem :require, '=0.1.8'
+ gem :require, '=0.2.1'
gem(:rake, '=0.8.7') { require 'rake' }
gem :rspec, '=1.3.0'

0 comments on commit e34de73

Please sign in to comment.