eltiempobcn 0.2.5 → 0.2.7
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 +4 -4
- data/lib/place.rb +4 -3
- 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: d0e5eae540738c5d506081e5cee023b50d343e5885a2a7812367c2fb5a9103d2
|
4
|
+
data.tar.gz: 7edde6d0abd72b4385bd40408afe57d4c8ac49ce9920f9c8b893f9bd77874f6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4a3a738bdbd26b13d53ece214bfe44595fa59fa700a67fa44da99c81dabf6c457b7139f3e1a4bb8c59764e63df0dd92144b98fbce54f236f2131971f4b405d1
|
7
|
+
data.tar.gz: 266f30d1343bb3bd91c2cad98d8457a268c0ec7bbc54e3a635287237ed3356c44c75fa99d60b64af3b307c36f289dcf959957f2fea7ef7b681a8a00e36a83054
|
data/lib/place.rb
CHANGED
@@ -61,11 +61,11 @@ class Place
|
|
61
61
|
def Place.set_temperatures( place, places )
|
62
62
|
place_data = Place.verify_and_get_temperatures( place.to_s, places )
|
63
63
|
|
64
|
-
place = Place.new( place,
|
64
|
+
place = ( Place.new( place,
|
65
65
|
place_data[ :temperaturamaxima ][0],
|
66
66
|
place_data[ :temperaturaminima ][0],
|
67
67
|
( place_data[ :temperaturamaxima ].sum / place_data[ :temperaturamaxima ].length ).round( 2 ),
|
68
|
-
( place_data[ :temperaturaminima ].sum / place_data[ :temperaturaminima ].length ).round( 2 ) )
|
68
|
+
( place_data[ :temperaturaminima ].sum / place_data[ :temperaturaminima ].length ).round( 2 ) ) rescue nil )
|
69
69
|
end
|
70
70
|
|
71
71
|
end
|
@@ -79,8 +79,9 @@ class String
|
|
79
79
|
raise "ElTiempoBCN gem can't handle encoding yet. Please contact the author for more details" unless return_string = I18n.transliterate( self ).tr( " ", "" ).downcase.to_sym
|
80
80
|
return return_string
|
81
81
|
rescue Encoding::CompatibilityError => e
|
82
|
+
raise unless return_string = I18n.transliterate( self.force_encoding( Encoding::UTF_8 ) ).tr( " ", "" ).downcase.to_sym
|
82
83
|
puts e
|
83
|
-
puts e.backtrace.inspect
|
84
|
+
puts e.backtrace.inspect
|
84
85
|
end
|
85
86
|
end
|
86
87
|
end
|