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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Njg4ZDc4NzYyNGY2NTZhYjUzYWQxY2U0YWI4MjNiNzk2YzM2ZDlkMA==
4
+ MmVhOTY5N2E5MTc3N2Y5NzBlZGIxNGQ5NWJiYjE2MjAwOTM1NWJhNA==
5
5
  data.tar.gz: !binary |-
6
- NzU1ZjUwMWI5ZTlhN2NhYWY3ZDlhZWU5MTBhN2RjNzhlYWI3ZTFhNQ==
6
+ ZjFiMjJiMzIwMjQyNzQxNmI5NWNjMWUzYWU1NzExNzVjZGNhNmJkOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTMzMDA4ODBiMTJiZjU3MTY1NjYxOGNmNDE4OTc5MTQ2ZjM4YjEyNmYzZDk2
10
- M2YzNDM2ZWJhOTY3YjEwMmNlNTVmYTZmMzBmZDQwYWFmMTc1NTFjNTRiMTgx
11
- NjgxZGYzNjBkODg2ZTA1ZDA3MzVkMmZjYWZhZmNjYTc5YjFiNzQ=
9
+ ZDBmNjUwYjgzZjQxNjVmNjhhZGZjMGJlOTA3MGUzODZhZWM1OTM3OTQ0ZTYx
10
+ OTI0OGJjODA1MTIxNjVlYjgxNDEyZThmZmM4Mzc5NzdhYWRlZTExYTMzNTc5
11
+ MzdjNzc2ZmViOTAwY2Q0ODFkZWY0YTdhN2RlMWJjMWUwN2JiMDg=
12
12
  data.tar.gz: !binary |-
13
- Y2MxYjg0ZWI3NjY0YjRiNTAxYjk2NDNhNDA4MjAyZGI0NTA1YmVkZDUwY2Q3
14
- YWQ5NjFjMzI1OTU2ZTQ1MTY1YTA2ZmNmY2VkZTcwMjMxMTQ3MjI2YTc5ZmUw
15
- ZDhlYjAwZjRjM2ZiMTM5YjE1YjQ4MjU4YzZiMzZiOTdjNDdiOTY=
13
+ YTJhODdhMTI3OTU2Yzk4ZTY4MjAxNDAxYTRlZDE5ODA4ZTRkZDhlM2JjNTNk
14
+ ZmNiNzIxODA0YjlmOTQ3YWE2MzNlMTU5NDQwYjFmYWZiOGY3ODM3NTAwYzM0
15
+ MjAyN2FjM2UwMTk3MTg0NjYwZTMwZWY4ZGRiMDA0MDI3NDY5MWM=
@@ -1,3 +1,3 @@
1
1
  class Forecast
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
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
- @cache = Redis.new(host: Forecast.config.cache['host'], port: Forecast.config.cache['port'])
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"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forecast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Nowrotek