open_weather_client-caching-redis 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea7de144664235d8bd066079bc886780416b93ec08bc04d6ea1cbc2d28dcaf28
|
4
|
+
data.tar.gz: c7a104bd16c00428c2fac043aa7108c94d6c170c0209d12bfd611a25de991359
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0506bfb66ce850534b50187b8abead97289ff8dd153159b623a6e54eece9f638ccc76504f78f90eb2f2115523cb05e09476bd6c3b2baf67eb1878dbc5e3bfbf
|
7
|
+
data.tar.gz: 0365b25b0a9f705d886771da1f5ddc0eb4fb2085ca1e3ea3e070a61fca07be4e89c2295a9f860499325344bfb24f79d18939b388604acb0b773f5993c9dd9ef3
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -11,7 +11,7 @@ This gem provides the redis caching method for [OpenWeatherClient](https://githu
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
gem 'open_weather_client'
|
14
|
+
gem 'open_weather_client-caching-redis'
|
15
15
|
```
|
16
16
|
|
17
17
|
And then execute:
|
@@ -28,6 +28,9 @@ Configure `OpenWeatherClient` to use redis caching.
|
|
28
28
|
The redis connection can be configured through rails credentials or by manually setting the parameters in configuration.
|
29
29
|
|
30
30
|
```ruby
|
31
|
+
require 'open_weather_client-caching-redis/caching/redis'
|
32
|
+
require 'open_weather_client'
|
33
|
+
|
31
34
|
# OpenWeatherClient initializer
|
32
35
|
OpenWeatherClient.configure do |config|
|
33
36
|
config.caching = OpenWeatherClient::Caching::Redis
|
@@ -35,10 +38,10 @@ OpenWeatherClient.configure do |config|
|
|
35
38
|
config.ttl = 14
|
36
39
|
|
37
40
|
# redis connection configuration
|
38
|
-
config.db = 0
|
39
|
-
config.host = 'localhost'
|
40
|
-
config.password = '123456'
|
41
|
-
config.port = 6379
|
41
|
+
config.db = 0 # default
|
42
|
+
config.host = 'localhost' # default
|
43
|
+
config.password = '123456' # default: nil
|
44
|
+
config.port = 6379 # default
|
42
45
|
end
|
43
46
|
```
|
44
47
|
|
@@ -56,10 +59,12 @@ open_weather_client:
|
|
56
59
|
```
|
57
60
|
|
58
61
|
After configuration of the credentials you can load the settings in your initializer with `#load_from_rails_configuration`.
|
62
|
+
Raises KeyError if redis caching is used but credentials are not set.
|
59
63
|
|
60
64
|
```ruby
|
61
65
|
# OpenWeatherClient initializer
|
62
66
|
OpenWeatherClient.configure do |config|
|
67
|
+
config.caching = OpenWeatherClient::Caching::Redis
|
63
68
|
config.load_from_rails_credentials
|
64
69
|
end
|
65
70
|
```
|
@@ -22,6 +22,9 @@ module OpenWeatherClient
|
|
22
22
|
def initialize
|
23
23
|
old_initialize
|
24
24
|
|
25
|
+
self.db = 0
|
26
|
+
self.host = 'localhost'
|
27
|
+
self.port = 6379
|
25
28
|
self.ttl = 7
|
26
29
|
end
|
27
30
|
|
@@ -30,7 +33,9 @@ module OpenWeatherClient
|
|
30
33
|
def load_from_rails_credentials
|
31
34
|
old_load
|
32
35
|
|
33
|
-
settings = Rails.application.credentials.open_weather_client
|
36
|
+
settings = Rails.application.credentials.open_weather_client![:redis]
|
37
|
+
raise KeyError unless settings
|
38
|
+
|
34
39
|
self.host = settings[:host]
|
35
40
|
self.port = settings[:port]
|
36
41
|
self.db = settings[:db]
|
@@ -5,7 +5,7 @@ require_relative 'lib/open_weather_client-caching-redis/caching/redis/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'open_weather_client-caching-redis'
|
7
7
|
spec.version = OpenWeatherClient::Caching::Redis::VERSION
|
8
|
-
spec.required_ruby_version = '>=
|
8
|
+
spec.required_ruby_version = '>= 2.6.0'
|
9
9
|
spec.authors = ['Lucas Keune']
|
10
10
|
spec.email = ['lucas.keune@qurasoft.de']
|
11
11
|
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ['lib']
|
31
31
|
|
32
|
-
spec.add_dependency 'open_weather_client', '>= 0.1.
|
32
|
+
spec.add_dependency 'open_weather_client', '>= 0.1.5'
|
33
33
|
spec.add_dependency 'redis', '>= 4.5.0'
|
34
34
|
|
35
35
|
spec.add_development_dependency 'bundler', '>= 1.17'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open_weather_client-caching-redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Keune
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: open_weather_client
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1.
|
19
|
+
version: 0.1.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1.
|
26
|
+
version: 0.1.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: redis
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,14 +141,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
141
|
requirements:
|
142
142
|
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
144
|
+
version: 2.6.0
|
145
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
147
|
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
|
-
rubygems_version: 3.4.
|
151
|
+
rubygems_version: 3.4.7
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Redis caching for OpenWeatherClient
|