forecast 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/forecast/version.rb +1 -1
- data/lib/forecast.rb +11 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmVhOTY5N2E5MTc3N2Y5NzBlZGIxNGQ5NWJiYjE2MjAwOTM1NWJhNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjFiMjJiMzIwMjQyNzQxNmI5NWNjMWUzYWU1NzExNzVjZGNhNmJkOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDBmNjUwYjgzZjQxNjVmNjhhZGZjMGJlOTA3MGUzODZhZWM1OTM3OTQ0ZTYx
|
10
|
+
OTI0OGJjODA1MTIxNjVlYjgxNDEyZThmZmM4Mzc5NzdhYWRlZTExYTMzNTc5
|
11
|
+
MzdjNzc2ZmViOTAwY2Q0ODFkZWY0YTdhN2RlMWJjMWUwN2JiMDg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTJhODdhMTI3OTU2Yzk4ZTY4MjAxNDAxYTRlZDE5ODA4ZTRkZDhlM2JjNTNk
|
14
|
+
ZmNiNzIxODA0YjlmOTQ3YWE2MzNlMTU5NDQwYjFmYWZiOGY3ODM3NTAwYzM0
|
15
|
+
MjAyN2FjM2UwMTk3MTg0NjYwZTMwZWY4ZGRiMDA0MDI3NDY5MWM=
|
data/lib/forecast/version.rb
CHANGED
data/lib/forecast.rb
CHANGED
@@ -66,17 +66,25 @@ class Forecast
|
|
66
66
|
|
67
67
|
def cache
|
68
68
|
cache = Forecast.config.cache
|
69
|
-
if @cache == nil && ( cache != nil || (!!cache == cache) && cache )
|
69
|
+
if @cache == nil && ( cache != nil || (!!cache == cache) && cache == true )
|
70
70
|
if !!cache == cache
|
71
71
|
Forecast.config.cache = {
|
72
72
|
expire: 5,
|
73
73
|
prefix: :forecast,
|
74
74
|
host: "127.0.0.1",
|
75
|
-
port: "6379"
|
75
|
+
port: "6379",
|
76
|
+
url: nil
|
76
77
|
}
|
77
78
|
end
|
79
|
+
cache_config = Forecast.config.cache
|
78
80
|
begin
|
79
|
-
|
81
|
+
if cache_config['url'] != nil
|
82
|
+
redis_url = cache_config['url']
|
83
|
+
uri = URI.parse(redis_url)
|
84
|
+
@cache = Redis.new(host: uri.host, port: uri.port, password: uri.password)
|
85
|
+
else
|
86
|
+
@cache = Redis.new(host: cache_config['host'], port: cache_config['port'])
|
87
|
+
end
|
80
88
|
@cache.ping
|
81
89
|
rescue
|
82
90
|
puts "error connecting to redis"
|