mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Support linked Rails in benchmark.rb.
This commit is contained in:
parent
d7986bb7bc
commit
deac7a70a1
3 changed files with 15 additions and 13 deletions
|
@ -12,6 +12,7 @@ END
|
|||
end
|
||||
|
||||
require File.dirname(__FILE__) + '/../lib/haml'
|
||||
require File.dirname(__FILE__) + '/linked_rails'
|
||||
%w[sass rubygems erb erubis markaby active_support action_controller
|
||||
action_view haml/template].each(&method(:require))
|
||||
|
||||
|
|
12
test/linked_rails.rb
Normal file
12
test/linked_rails.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
# allows testing with edge Rails by creating a test/rails symlink
|
||||
linked_rails = File.dirname(__FILE__) + '/rails'
|
||||
|
||||
if File.exists?(linked_rails) && !$:.include?(linked_rails + '/activesupport/lib')
|
||||
puts "[ using linked Rails ]"
|
||||
$:.unshift linked_rails + '/activesupport/lib'
|
||||
$:.unshift linked_rails + '/actionpack/lib'
|
||||
else
|
||||
require 'rubygems'
|
||||
end
|
||||
require 'action_controller'
|
||||
require 'action_view'
|
|
@ -1,16 +1,5 @@
|
|||
lib_dir = File.dirname(__FILE__) + '/../lib'
|
||||
# allows testing with edge Rails by creating a test/rails symlink
|
||||
linked_rails = File.dirname(__FILE__) + '/rails'
|
||||
|
||||
if File.exists?(linked_rails) && !$:.include?(linked_rails + '/activesupport/lib')
|
||||
puts "[ using linked Rails ]"
|
||||
$:.unshift linked_rails + '/activesupport/lib'
|
||||
$:.unshift linked_rails + '/actionpack/lib'
|
||||
else
|
||||
require 'rubygems'
|
||||
end
|
||||
require 'action_controller'
|
||||
require 'action_view'
|
||||
require File.dirname(__FILE__) + '/linked_rails'
|
||||
|
||||
require 'test/unit'
|
||||
$:.unshift lib_dir unless $:.include?(lib_dir)
|
||||
|
@ -21,4 +10,4 @@ require 'sass'
|
|||
unless defined? RAILS_ROOT
|
||||
RAILS_ROOT = '.'
|
||||
MERB_ENV = RAILS_ENV = 'testing'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue