File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change 2
2
# Use bundler to load dependencies
3
3
#
4
4
5
- gemfile_base = ::File . expand_path ( ::File . join ( ::File . dirname ( __FILE__ ) , ".." ) )
6
- if File . readable? ( ::File . join ( gemfile_base , "Gemfile.local" ) )
7
- ENV [ 'BUNDLE_GEMFILE' ] ||= ::File . join ( gemfile_base , "Gemfile.local" )
8
- else
9
- ENV [ 'BUNDLE_GEMFILE' ] ||= ::File . join ( gemfile_base , "Gemfile" )
5
+ GEMFILE_EXTENSIONS = [
6
+ '.local' ,
7
+ ''
8
+ ]
9
+
10
+ unless ENV [ 'BUNDLE_GEMFILE' ]
11
+ require 'pathname'
12
+
13
+ msfenv_real_pathname = Pathname . new ( __FILE__ ) . realpath
14
+ root = msfenv_real_pathname . parent . parent
15
+
16
+ GEMFILE_EXTENSIONS . each do |extension |
17
+ extension_pathname = root . join ( "Gemfile#{ extension } " )
18
+
19
+ if extension_pathname . readable?
20
+ ENV [ 'BUNDLE_GEMFILE' ] = extension_pathname . to_path
21
+ break
22
+ end
23
+ end
10
24
end
11
25
12
26
begin
You can’t perform that action at this time.
0 commit comments