File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
require 'rubygems' unless defined? Gem
4
4
5
- gem 'activerecord' , ENV [ 'AR_VERSION' ] if ENV [ 'AR_VERSION' ]
5
+ if ENV [ 'RAILS' ] # Use local clone of Rails
6
+ rails_dir = ENV [ 'RAILS' ]
7
+
8
+ activerecord_dir = ::File . join ( rails_dir , 'activerecord' , 'lib' )
9
+ if !::File . exist? ( rails_dir ) && !::File . exist? ( activerecord_dir )
10
+ raise "ENV['RAILS'] set but does not point at a valid rails clone"
11
+ end
12
+ puts "--- Using AR from #{ activerecord_dir } "
13
+
14
+ $LOAD_PATH << ::File . join ( rails_dir , 'activesupport' , 'lib' )
15
+ $LOAD_PATH << ::File . join ( rails_dir , 'activemodel' , 'lib' )
16
+ $LOAD_PATH << activerecord_dir
17
+ elsif ENV [ 'AR_VERSION' ]
18
+ gem 'activerecord' , ENV [ 'AR_VERSION' ]
19
+ end
20
+
6
21
require 'active_record'
7
22
require 'active_record/version'
8
23
12
27
require 'arjdbc'
13
28
ArJdbc ::VERSION
14
29
else
15
- $LOAD_PATH << File . expand_path ( '../lib' , File . dirname ( __FILE__ ) )
30
+ $LOAD_PATH. unshift File . expand_path ( '../lib' , File . dirname ( __FILE__ ) )
16
31
require 'arjdbc'
17
32
"#{ ArJdbc ::VERSION } #{ `git rev-parse HEAD` [ 0 , 8 ] } "
18
33
end
You can’t perform that action at this time.
0 commit comments