weatherfor 0.2.1 → 0.2.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: 883f424e335c37d98240e90f31c7a6d771421baed9868d5ee3d530c20ba8d569
4
- data.tar.gz: 2a75af9ca384fbdd288f7bc66df31d7d44b02ccb912080ae7f02666b2b84e128
3
+ metadata.gz: 4a3a7da1e14cacc4b0a0e2650017fa6fc252e98e5b14e5e5eece2327ca0a1650
4
+ data.tar.gz: 77cac703ed39dd4b07dfc6e77c7a4ef22eed49794bbb57620682a54d503a1975
5
5
  SHA512:
6
- metadata.gz: d65b683e7082546daf93dac8fa29cfbda910f5e235c47f8eaaf84ce97a411413434e01533ca13d11ccc2f0e9ba6188aa6ff3dfd249e7d8088f0d7488cb37e8a2
7
- data.tar.gz: c6447a0288856b2ff03c66fd7cdbe0a140ac82f048669f51ae01c6038845acf91d32d01ca321a7a06852adc3851a948093584a578bd06ac90e31b2fee29cf543
6
+ metadata.gz: dfeaf90ece59194dc2e30ab5cb7204d58c790eff94afcb3b9a883fce8123a6977005fb826c3f01bac8765670d345962b81d9b080925ed052f5055df79bf08107
7
+ data.tar.gz: e1130670918e4f173748e5de0feaa372db9788005db92111482d88452c6a437a3d80b1f35eebba33c4259cf437f258082279ed91ba41b03068162192211291fd
data/.rubocop.yml CHANGED
@@ -5,7 +5,3 @@ AllCops:
5
5
  Metrics/BlockLength:
6
6
  Exclude:
7
7
  - 'spec/**/*.rb'
8
-
9
- Layout/LineLength:
10
- Exclude:
11
- - 'spec/**/*.rb'
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Weatherfor
2
2
 
3
+ [![Ruby Gem](https://github.com/k41n3w/weatherfor/actions/workflows/gem-push.yml/badge.svg)](https://github.com/k41n3w/weatherfor/actions/workflows/gem-push.yml)
4
+
3
5
  Welcome to Weatherfor gem!
4
6
 
5
7
  The purpose of this Gem is to make API requests to OpenWeatherAPI to query meteorological data to process the average temperature for the next five days.
@@ -36,15 +38,10 @@ Methodo to consult average temperature in days:
36
38
  req.weather_in_days
37
39
  ```
38
40
 
39
- Method to consult the raw data:
40
- ```ruby
41
- req.list
42
- ```
41
+ This will bring a message like that:
42
+
43
+ 34°C e nublado em <cidade> em 12/12. Média para os próximos dias: 32°C em 13/12, 25°C em 14/12, 29°C em 15/12, 33°C em 16/12 e 28°C em 16/12.
43
44
 
44
- Method to consult the city request data:
45
- ```ruby
46
- req.list
47
- ```
48
45
  ## Development
49
46
 
50
47
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/lib/weatherfor.rb CHANGED
@@ -32,7 +32,7 @@ module Weatherfor
32
32
 
33
33
  def avg_temp_in_days
34
34
  @arr = []
35
- @obj['list'].group_by { |item| Time.at(item['dt']).strftime('%m-%d-%Y') }.each do |date, data|
35
+ obj['list'].group_by { |item| Time.at(item['dt']).strftime('%m-%d-%Y') }.each do |date, data|
36
36
  avg_temp = data.sum { |info| info['main']['temp'] }
37
37
  avg_temp /= data.count
38
38
  @arr << { avg_temp: avg_temp, date: date }
@@ -40,15 +40,15 @@ module Weatherfor
40
40
  end
41
41
 
42
42
  def today_avg_temp
43
- @obj['list'][0]['main']['temp'].round
43
+ obj['list'][0]['main']['temp'].round
44
44
  end
45
45
 
46
46
  def city_name
47
- @obj['city']['name']
47
+ obj['city']['name']
48
48
  end
49
49
 
50
50
  def current_temp_desc
51
- @obj['list'][0]['weather'][0]['description']
51
+ obj['list'][0]['weather'][0]['description']
52
52
  end
53
53
 
54
54
  def current_date
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Weatherfor
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weatherfor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caio Ramos