weather_fetcher 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 270dcf5030313ef8855cb98e01873a13a110004c
4
- data.tar.gz: d4a32c91a82362b69e1e318f39e34730f392c8ce
3
+ metadata.gz: 3667f7b49205868dcd39db647197ddec0517d4a2
4
+ data.tar.gz: 03de40feb2699f5894e3fb5db7c57bad39107912
5
5
  SHA512:
6
- metadata.gz: b8f33ac89ec4949b7041f8df0cfe9f0f7ff9591ebc8195664c6ad150f130b30afea4d6c81d5436f8630f4e46219349ff3d96d11c5406f7b0aeb54ce88c9a21da
7
- data.tar.gz: f47cc17506b562bb5cf8d4afc1ead3f69e64a27319bca37e83d29e085a9d4805c52316ac2c52b77809d3ef4dcb1e6ecb2b203e7559b7d90f68984fd715cedc0f
6
+ metadata.gz: 381cabb43fbb0165d390f7b9c42f96494a573a57504c8da00468c25f078d904e2a5bf6e935505f37579c81032670f7de22b6cb14a96a42c3f381a8b32d0d3c65
7
+ data.tar.gz: b3d173d670ca30a6c1d746f784720d0dd9339af297f9e819a02f144a3053d292807ac12e2226a296bb3666e1ae56e5879cc44bdb160fd69e66b6ef8216b0acaf
data/README.rdoc CHANGED
@@ -41,7 +41,14 @@ Please check spec/fetcher_spec.rb for code sample, and spec/fixtures/main.yml fo
41
41
  * Interia.pl
42
42
  * WorldWeatherOnline (free api key required)
43
43
  * and 4 metar providers
44
-
44
+
45
+
46
+ == TODO
47
+
48
+ * http://api.yr.no/weatherapi/documentation
49
+ * http://dataapi.wxc.com/pointrequest.html
50
+ * http://www.wunderground.com/weather/api/
51
+
45
52
  == Contributing to weather_fetcher
46
53
 
47
54
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -2,6 +2,8 @@
2
2
 
3
3
  require 'json'
4
4
 
5
+ # http://openweathermap.org/
6
+
5
7
  module WeatherFetcher
6
8
  class Provider::OpenWeatherMap < HtmlBasedProvider
7
9
  def self.provider_name
@@ -46,16 +46,25 @@ module WeatherFetcher
46
46
  end
47
47
 
48
48
  # Fetch everything from definitions (defs)
49
- def fetch
49
+ def fetch(ignore_errors: true)
50
50
  a = Array.new
51
51
  defs.each do |d|
52
- p = fetch_and_process_single(d)
53
- p = [] if p.nil?
54
- p.each do |pw|
55
- pw.just_fetched!
56
- pw.next_within!(self.class.weather_updated_every)
52
+ begin
53
+ p = fetch_and_process_single(d)
54
+ p = [] if p.nil?
55
+ p.each do |pw|
56
+ pw.just_fetched!
57
+ pw.next_within!(self.class.weather_updated_every)
58
+ end
59
+
60
+ rescue => e
61
+ if ignore_errors
62
+ puts e.inspect
63
+ puts e.backtrace
64
+ else
65
+ raise e
66
+ end
57
67
  end
58
-
59
68
  a += p unless p.nil?
60
69
  end
61
70
  # add to result array
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weather_fetcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksander Kwiatkowski