aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/examples/performance.rb
diff options
context:
space:
mode:
authorRizwan Reza <rizwanreza@gmail.com>2010-06-14 13:13:13 +0430
committerRizwan Reza <rizwanreza@gmail.com>2010-06-14 13:13:13 +0430
commitbf7429041e64ee0f347764a4579c8c1d14d5b391 (patch)
treee52044f40d8ea2310aef97790b5374ac8b8558a4 /activerecord/examples/performance.rb
parent4b05de19aaebcbe20941e8b13aaed2060759ed1c (diff)
parentc125116013d4b4222f507cfbd1da5ae90bd225d9 (diff)
downloadrails-bf7429041e64ee0f347764a4579c8c1d14d5b391.tar.gz
rails-bf7429041e64ee0f347764a4579c8c1d14d5b391.tar.bz2
rails-bf7429041e64ee0f347764a4579c8c1d14d5b391.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activerecord/examples/performance.rb')
-rwxr-xr-xactiverecord/examples/performance.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/examples/performance.rb b/activerecord/examples/performance.rb
index 53acd62f47..f69576b240 100755
--- a/activerecord/examples/performance.rb
+++ b/activerecord/examples/performance.rb
@@ -1,18 +1,18 @@
#!/usr/bin/env ruby -KU
TIMES = (ENV['N'] || 10000).to_i
-
require 'rubygems'
+
gem 'addressable', '~>2.0'
gem 'faker', '~>0.3.1'
gem 'rbench', '~>0.2.3'
+
require 'addressable/uri'
require 'faker'
require 'rbench'
-__DIR__ = File.dirname(__FILE__)
-$:.unshift "#{__DIR__}/../lib"
-require 'active_record'
+require File.expand_path("../../../load_paths", __FILE__)
+require "active_record"
conn = { :adapter => 'mysql',
:database => 'activerecord_unittest',
@@ -55,7 +55,7 @@ class Exhibit < ActiveRecord::Base
def self.feel(exhibits) exhibits.each { |e| e.feel } end
end
-sqlfile = "#{__DIR__}/performance.sql"
+sqlfile = File.expand_path("../performance.sql", __FILE__)
if File.exists?(sqlfile)
mysql_bin = %w[mysql mysql5].select { |bin| `which #{bin}`.length > 0 }