weather_gem_kg 0.30.0 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/weather_gem_kg/clients/apixu.rb +2 -2
- data/lib/weather_gem_kg/clients/dark_sky.rb +1 -1
- data/lib/weather_gem_kg/config.rb +10 -33
- data/lib/weather_gem_kg/version.rb +1 -1
- data/lib/weather_gem_kg.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02a8cf12c9c8e11bd58b612f0a4cabfed6fcbaa89b0c4671b6bec3b45fa9fad7
|
4
|
+
data.tar.gz: c0ff3ea5a27edf08750775ff1e596420d233774755731a993c3262bc8094e876
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c654dd71e142f317e4404023567b70838180666c126463efca1303152a8c3ffe617aaa5e9f3817da1316e2a8f2d059cad27fc27da9c60fc1aba3b4642d943016
|
7
|
+
data.tar.gz: 1d4815336c89bae37c21c4fc42c38790356a19a8d184ef67f3c98aabfce71f5650bdb4d2b206e5484921b812a68847f33373de8208a70ce744413a25cae6205a
|
data/Gemfile.lock
CHANGED
@@ -3,8 +3,8 @@ require_relative '../config'
|
|
3
3
|
module WeatherGemKg
|
4
4
|
module Clients
|
5
5
|
class Apixu
|
6
|
-
API_KEY = WeatherGemKg.
|
7
|
-
|
6
|
+
API_KEY = WeatherGemKg::Configuration.config.api_key_apixu
|
7
|
+
|
8
8
|
def initialize
|
9
9
|
@base_url = "http://api.apixu.com/v1/forecast.json?key=#{API_KEY}"
|
10
10
|
end
|
@@ -4,7 +4,7 @@ require_relative '../config'
|
|
4
4
|
module WeatherGemKg
|
5
5
|
module Clients
|
6
6
|
class DarkSky
|
7
|
-
API_KEY = WeatherGemKg.
|
7
|
+
API_KEY = WeatherGemKg::Configuration.config.api_key_dark
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
@base_url = "https://api.darksky.net/forecast/#{API_KEY}"
|
@@ -1,40 +1,17 @@
|
|
1
|
-
# module WeatherGemKg
|
2
|
-
# module Configuration
|
3
|
-
# Config = Struct.new :api_key_apixu, :api_key_dark
|
4
|
-
#
|
5
|
-
# class << self
|
6
|
-
# attr_accessor :api_key_apixu, :api_key_dark
|
7
|
-
# end
|
8
|
-
#
|
9
|
-
# def self.configure(&config_block)
|
10
|
-
# config_block.call config
|
11
|
-
# end
|
12
|
-
#
|
13
|
-
# def self.config
|
14
|
-
# @config ||= Config.new
|
15
|
-
# end
|
16
|
-
# end
|
17
|
-
# end
|
18
|
-
|
19
1
|
module WeatherGemKg
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.configuration
|
25
|
-
@configuration ||= Configuration.new
|
26
|
-
end
|
2
|
+
module Configuration
|
3
|
+
Config = Struct.new :api_key_apixu, :api_key_dark
|
27
4
|
|
28
|
-
|
29
|
-
|
30
|
-
|
5
|
+
class << self
|
6
|
+
attr_accessor :api_key_apixu, :api_key_dark
|
7
|
+
end
|
31
8
|
|
32
|
-
|
33
|
-
|
9
|
+
def self.configure(&config_block)
|
10
|
+
config_block.call config
|
11
|
+
end
|
34
12
|
|
35
|
-
def
|
36
|
-
@
|
37
|
-
@api_key_dark = nil
|
13
|
+
def self.config
|
14
|
+
@config ||= Config.new
|
38
15
|
end
|
39
16
|
end
|
40
17
|
end
|
data/lib/weather_gem_kg.rb
CHANGED