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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aebba6a2dfc4213a324f65e209f2bcb3e4790d7cb8096f5622e5e50731ba48a0
4
- data.tar.gz: c26eea3c3a8ae9413ca6c94c9fa57f25c75b03503f919e80fad7b320d90246ec
3
+ metadata.gz: 02a8cf12c9c8e11bd58b612f0a4cabfed6fcbaa89b0c4671b6bec3b45fa9fad7
4
+ data.tar.gz: c0ff3ea5a27edf08750775ff1e596420d233774755731a993c3262bc8094e876
5
5
  SHA512:
6
- metadata.gz: dc62521745c173721db291bc86f9ab9d58695f746d0145ccb727b1b3bec2df79843fbe078dda718b17169560a61cb4c036bc2644c69514e9d67b6503f50d40bd
7
- data.tar.gz: 6040e42d9e90d06fcad49335ebe29eeaac8594e0e33d05662c54dde0ae8576903d9be986003f7639358db6f69a1494065b1e177fdda466e4a4582331f4709fa9
6
+ metadata.gz: c654dd71e142f317e4404023567b70838180666c126463efca1303152a8c3ffe617aaa5e9f3817da1316e2a8f2d059cad27fc27da9c60fc1aba3b4642d943016
7
+ data.tar.gz: 1d4815336c89bae37c21c4fc42c38790356a19a8d184ef67f3c98aabfce71f5650bdb4d2b206e5484921b812a68847f33373de8208a70ce744413a25cae6205a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- weather_gem_kg (0.29.0)
4
+ weather_gem_kg (0.30.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -3,8 +3,8 @@ require_relative '../config'
3
3
  module WeatherGemKg
4
4
  module Clients
5
5
  class Apixu
6
- API_KEY = WeatherGemKg.configuration.api_key_apixu
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.configuration.api_key_dark
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
- class << self
21
- attr_accessor :configuration
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
- def self.configure
29
- yield(configuration) if block_given?
30
- end
5
+ class << self
6
+ attr_accessor :api_key_apixu, :api_key_dark
7
+ end
31
8
 
32
- class Configuration
33
- attr_accessor :api_key_apixu, :api_key_dark
9
+ def self.configure(&config_block)
10
+ config_block.call config
11
+ end
34
12
 
35
- def initialize
36
- @api_key_apixu = nil
37
- @api_key_dark = nil
13
+ def self.config
14
+ @config ||= Config.new
38
15
  end
39
16
  end
40
17
  end
@@ -1,3 +1,3 @@
1
1
  module WeatherGemKg
2
- VERSION = "0.30.0"
2
+ VERSION = "0.31.0"
3
3
  end
@@ -4,6 +4,7 @@ require "weather_gem_kg/generator"
4
4
  require "weather_gem_kg/config"
5
5
 
6
6
  module WeatherGemKg
7
+ extend Configuration
7
8
  end
8
9
 
9
10
  # weather1 = WeatherGemKg::Generator.new('Bishkek', 1, WeatherGemKg::Clients::Apixu.new)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weather_gem_kg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0
4
+ version: 0.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edilbek