File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def require_more
1414 more_load_paths . each do |load_path |
1515 path = File . join ( load_path , load_name )
1616 if File . exist? ( path )
17- return require_dependency path
17+ return require path
1818 end
1919 end
2020
Original file line number Diff line number Diff line change 1+ def require_more
2+ required_file_path = caller [ 0 ] . split ( ':' , 2 ) . first
3+ load_name = nil
4+ load_path_index = $LOAD_PATH. each_with_index do |load_path , ix |
5+ scanned = required_file_path . scan ( /(#{ load_path } )#{ File ::SEPARATOR } (.*)/ ) . first
6+ next false unless scanned
7+ load_name = scanned [ 1 ]
8+ break ix
9+ end
10+
11+ return false unless load_path_index
12+
13+ more_load_paths = $LOAD_PATH. drop ( load_path_index + 1 )
14+ more_load_paths . each do |load_path |
15+ path = File . join ( load_path , load_name )
16+ if File . exist? ( path )
17+ loaded = require ( path )
18+ loaded = load ( path ) unless loaded
19+ return loaded
20+ end
21+ end
22+
23+ raise LoadError , "cannot require more -- #{ load_name } "
24+ end
Original file line number Diff line number Diff line change 11module Coaster
2- VERSION = '1.4.26 '
2+ VERSION = '1.4.27 '
33end
You can’t perform that action at this time.
0 commit comments