Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more informative error messages for gems needed for redis/memcached s…

…tores
  • Loading branch information...
commit 7349707c0ddf8b8883bb8c4dda611a7ed817d67c 1 parent caf50fb
@juliocesar authored
View
4 Gemfile.lock
@@ -19,14 +19,12 @@ GEM
rake (>= 0.8.7)
jsmin (1.0.1)
json_pure (1.4.6)
- memcached (1.0.2)
mime-types (1.16)
nokogiri (1.4.4)
rack (1.2.1)
rack-test (0.5.6)
rack (>= 1.0)
rake (0.8.7)
- redis (2.2.0)
rspec (2.3.0)
rspec-core (~> 2.3.0)
rspec-expectations (~> 2.3.0)
@@ -52,9 +50,7 @@ PLATFORMS
DEPENDENCIES
capybara (= 0.4.0)
jsmin (= 1.0.1)
- memcached (= 1.0.2)
nokogiri (= 1.4.4)
rack (= 1.2.1)
- redis
rspec (= 2.3.0)
steak (= 1.0.0)
View
6 lib/rack/pagespeed/store/memcached.rb
@@ -1,4 +1,8 @@
-require 'memcached' # wanted to use Dalli, but it just ain't working here right now
+begin
+ require 'memcached' # wanted to use Dalli, but it just ain't working here right now
+rescue LoadError
+ raise LoadError, ":memcached store requires the memcached gem to be installed."
+end
class Rack::PageSpeed::Store::Memcached
def initialize address_port = nil
View
6 lib/rack/pagespeed/store/redis.rb
@@ -1,4 +1,8 @@
-require 'redis'
+begin
+ require 'redis'
+rescue LoadError
+ raise LoadError, ":redis store requires the redis gem to be installed."
+end
class Rack::PageSpeed::Store::Redis
def initialize address_port = nil

0 comments on commit 7349707

Please sign in to comment.
Something went wrong with that request. Please try again.