@@ -33,7 +33,7 @@ module PrototypeHelper
33
33
begin
34
34
`git --version`
35
35
return true
36
- rescue Error => e
36
+ rescue Error
37
37
return false
38
38
end
39
39
end
@@ -43,7 +43,7 @@ module PrototypeHelper
43
43
puts "\n Prototype requires Git in order to load its dependencies."
44
44
puts "\n Make sure you've got Git installed and in your path."
45
45
puts "\n For more information, visit:\n \n "
46
- puts " http://book. git-scm.com/2_installing_git.html "
46
+ puts " http://git-scm.com/book/en/v2/Getting-Started-Installing-Git "
47
47
exit
48
48
end
49
49
106
106
def self . require_package ( name )
107
107
begin
108
108
require name
109
- rescue LoadError => e
109
+ rescue LoadError
110
110
puts "You need the #{ name } package. Try installing it with:\n "
111
111
puts " $ gem install #{ name } "
112
112
exit
147
147
when :coderay
148
148
begin
149
149
require 'coderay'
150
- rescue LoadError => e
150
+ rescue LoadError
151
151
if verbose
152
152
puts "\n You asked to use CodeRay, but I can't find the 'coderay' gem. Just run:\n \n "
153
153
puts " $ gem install coderay"
@@ -212,13 +212,15 @@ EOF
212
212
213
213
def self . require_submodule ( name , path )
214
214
begin
215
- require path
215
+ full_path = File . join ( PrototypeHelper ::ROOT_DIR , 'vendor' , path , 'lib' , path )
216
+ # We need to require the explicit version in the submodule.
217
+ require full_path
216
218
rescue LoadError => e
217
219
# Wait until we notice that a submodule is missing before we bother the
218
220
# user about installing git. (Maybe they brought all the files over
219
221
# from a different machine.)
220
222
missing_file = e . message . sub ( 'no such file to load -- ' , '' ) . sub ( 'cannot load such file -- ' , '' )
221
- if missing_file == path
223
+ if missing_file == full_path
222
224
# Missing a git submodule.
223
225
retry if get_submodule ( name , path )
224
226
else
@@ -293,10 +295,6 @@ namespace :test do
293
295
UnitTests . run!
294
296
end
295
297
296
- task :require do
297
- PrototypeHelper . require_package ( 'sinatra' )
298
- end
299
-
300
298
desc "Opens the test suite in several different browsers. (Does not start or stop the server; you should do that separately.)"
301
299
task :run => [ :require ] do
302
300
browsers , tests , grep = ENV [ 'BROWSERS' ] , ENV [ 'TESTS' ] , ENV [ 'GREP' ]
0 commit comments