brynary / rack-bug

Debugging toolbar for Rack applications implemented as middleware
MIT License
1.08k stars 104 forks source link

Digest::SHA1 is needed but not required #2

Closed jlecour closed 14 years ago

jlecour commented 15 years ago

Hi,

I can see tha Rack::Bug is using Digest::SHA1 but it's never explicitly required. On some of my apps, it's not required by any other plugin/gem so it's not loaded and I get this :

Status: 500 Internal Server Error uninitialized constant Digest::SHA1

jlecour commented 15 years ago

I've just added the require in the main lib and it's working :

diff --git a/vendor/plugins/rack-bug/lib/rack/bug.rb b/vendor/plugins/rack-bug/lib/rack/bug.rb
index ea36ebe..24128d6 100644
--- a/vendor/plugins/rack-bug/lib/rack/bug.rb
+++ b/vendor/plugins/rack-bug/lib/rack/bug.rb
@@ -1,4 +1,5 @@
 require "rack"
+require "digest/sha1"

 module Rack::Bug
   require "rack/bug/toolbar"