easy_weather 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afc8caa0258342ad30f9fbe0cec0d004ba1e40d23884814b7884bd7fa78409a0
4
- data.tar.gz: 2a790cd66d2a9d43bbb635abe56a2a74309d55c35401086d7f5ac65db16da795
3
+ metadata.gz: 970434a818853929fc42f85dee9d6d4ba48899314927d3e228d9a2a50a478669
4
+ data.tar.gz: 1eadc9ef27e71b416f5385980581af53cf642f99f1a4dd44b8dae0e1967bb7b8
5
5
  SHA512:
6
- metadata.gz: '04468f04eb407e618dcfd6f6ec46f8422fefe4db7bb5dcde84bde5e8eb0b31385cf747a98082b1d92fdf8682ffc19564ccf1746dde0009a4911928b716b157a4'
7
- data.tar.gz: 5013a67e8bc600f16ad938d70dfdf8ad5160d5af03b38b6cb55ff4d53f6669164337d7ac19d76ec8bb2aea8d5ac4db11874840f18a60ec8ff54581567b961545
6
+ metadata.gz: 74cd19009ce5c45726396d0458ad28d812550eb74fd6b95fe8b14b628fda4935b15ed8db610946de895d70f1e03b5637c42ce26b8b475ed41693dc8077cb21c4
7
+ data.tar.gz: 40fca591c20037fe9fde417e35a7fa0dd7d40bfe9d8951b21a58defc1568dbe2a0b11a1373f570cb613a08578fa9a321253d34f3bc05a76808cf13deaf54017a
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasyWeather
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
@@ -2,6 +2,7 @@ require 'json'
2
2
  require 'httparty'
3
3
 
4
4
  class Weather
5
+ BASE_URL = "https://api.openweathermap.org/data/2.5/"
5
6
  attr_accessor :data, :forecast
6
7
 
7
8
  def initialize(city)
@@ -47,7 +48,7 @@ class Weather
47
48
 
48
49
  def get_general_data(city)
49
50
  response =
50
- HTTParty.get("https://api.openweathermap.org/data/2.5/weather?q=#{city}
51
+ HTTParty.get("#{BASE_URL}weather?q=#{city}
51
52
  &units=metric&APPID=#{ENV["EASY_WEATHER"]}")
52
53
 
53
54
  JSON.parse(response.body)
@@ -55,7 +56,7 @@ class Weather
55
56
 
56
57
  def get_forecast_data(days, city)
57
58
  response =
58
- HTTParty.get("https://api.openweathermap.org/data/2.5/forecast?q=#{city}
59
+ HTTParty.get("#{BASE_URL}forecast?q=#{city}
59
60
  &units=metric&cnt=#{days}&appid=#{ENV["EASY_WEATHER"]}")
60
61
 
61
62
  JSON.parse(response.body)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_weather
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Tinoco
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-12 00:00:00.000000000 Z
11
+ date: 2021-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty