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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/place.rb +4 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e96ecf6597cf3e0cc65643dfbd8043ca69082a015b8c1a92a0ba203971b96b5a
4
- data.tar.gz: 6370ffdf6ea6727d36fa5b54872b5ba5dd0aef365eaabf6ece5119c70bf562d3
3
+ metadata.gz: d0e5eae540738c5d506081e5cee023b50d343e5885a2a7812367c2fb5a9103d2
4
+ data.tar.gz: 7edde6d0abd72b4385bd40408afe57d4c8ac49ce9920f9c8b893f9bd77874f6b
5
5
  SHA512:
6
- metadata.gz: 920d093061ff3d4a71e12e1b6c9d6824568603d789d896d95d63beae34eefb00f8bd846c5d59b8d6b554dbc1954d30cf42c4ba6f6e34bfd22d2fb33e8c3c2945
7
- data.tar.gz: a9f5fcf7cad5c3763a1a882f67b5a3645dd2b5228b7e3ea03c5f387fab530c0687d096e38bc185e8da9d6b6df620c935c9197e1224b3391979a5b5fefa5ab02b
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eltiempobcn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Jimenez