rateless_bot 0.4.2 → 0.4.3
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/rateless_bot/plugins/weather.rb +14 -4
- data/lib/rateless_bot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 947154256dead747995dbd6f3c3f00594e3a77ae
|
4
|
+
data.tar.gz: 31e22f6d1d104048f663063f8947d36514f4fada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 374d74681954857c597f590ee0ae1479d59da1ce9118ab595567452ba8104f4781880a936209254bd68ef7e50eb4619d55cc8b1bd0ce78043b5cb2a8918a1b64
|
7
|
+
data.tar.gz: 9e0ac4530ecf6861def1576f171b72c4314fecfa4efbf4dd80b0067d79edd58396b17304dc317e6da899b78bcfaae1da9aabc8ac6df393a94964b9d8372d5088
|
data/Gemfile.lock
CHANGED
@@ -32,7 +32,7 @@ private
|
|
32
32
|
elsif current_weather['cod'] != 200 # number is not a string; report bug
|
33
33
|
return "Error: response code #{current_weather['cod']}"
|
34
34
|
end
|
35
|
-
|
35
|
+
p current_weather
|
36
36
|
city = current_weather['name']
|
37
37
|
country = ISO3166::Country.new(current_weather['sys']['country']).name
|
38
38
|
humidity = current_weather['main']['humidity']
|
@@ -41,13 +41,23 @@ private
|
|
41
41
|
wind_speed_mps = current_weather['wind']['speed']
|
42
42
|
wind_speed_mph = (wind_speed_mps * 0.000621371 * 60**2).round(2)
|
43
43
|
wind_direction_degrees = current_weather['wind']['deg']
|
44
|
-
|
44
|
+
|
45
|
+
if !wind_direction_degrees.nil?
|
46
|
+
cardinal_wind_direction = degrees_to_cardinal(wind_direction_degrees)
|
47
|
+
end
|
48
|
+
|
45
49
|
weather_description = current_weather['weather'][0]['description']
|
46
50
|
|
47
51
|
s = "Weather for #{city} (#{country}): "
|
48
52
|
s += "#{temp_celsius}°C (#{temp_fahrenheit}°F); #{humidity}% humidity; "
|
49
|
-
s += "#{wind_speed_mps}m/s (#{wind_speed_mph}mph) winds
|
50
|
-
|
53
|
+
s += "#{wind_speed_mps}m/s (#{wind_speed_mph}mph) winds"
|
54
|
+
|
55
|
+
if wind_direction_degrees.nil?
|
56
|
+
s += '; '
|
57
|
+
else
|
58
|
+
s += " blowing #{cardinal_wind_direction} (#{wind_direction_degrees}°); "
|
59
|
+
end
|
60
|
+
|
51
61
|
s += "#{weather_description}"
|
52
62
|
end
|
53
63
|
|
data/lib/rateless_bot/version.rb
CHANGED