sleepy 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/sleepy.rb +13 -2
  3. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/lib/sleepy.rb CHANGED
@@ -1,4 +1,11 @@
1
- require 'memcached'
1
+ begin
2
+ require 'memcached'
3
+ HAS_MEMCACHE = true
4
+ rescue
5
+ HAS_MEMCACHE = false
6
+ puts "Sleepy with no Memcached"
7
+ end
8
+
2
9
  require 'weary'
3
10
 
4
11
  # This requires Memcached to be running on your system.
@@ -21,7 +28,11 @@ module Weary
21
28
 
22
29
  def perform_sleepily(timeout=60*60*1000, &block)
23
30
  @on_complete = block if block_given?
24
- response = perform_sleepily!(timeout)
31
+ if HAS_MEMCACHE
32
+ response = perform_sleepily!(timeout)
33
+ else
34
+ response = perform
35
+ end
25
36
  response.value
26
37
  end
27
38
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sleepy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - steflewandowski
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-28 00:00:00 +01:00
18
+ date: 2010-08-26 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency