weather_fetcher 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.11
1
+ 0.0.12
@@ -51,24 +51,30 @@ module WeatherFetcher
51
51
  current_time = Time.create_time_from_string_12_utc(nil, current["observation_time"])
52
52
 
53
53
  h = process_node(current)
54
- h.merge(
54
+ hc = h.clone.merge(
55
55
  {
56
+ :wwo_type => :current,
56
57
  :time_created => Time.now,
57
58
  :time_from => current_time - 3600,
58
59
  :time_to => current_time
59
60
  }
60
61
  )
61
- weather_archives << h
62
+ weather_archives << hc
62
63
 
63
64
  # prediction
64
65
  predictions = result["data"]["weather"]
65
66
  predictions.each do |p|
66
67
  h = process_node(p)
67
- h[:pressure] = nil
68
+
69
+ # is always 0
70
+ [:pressure, :cloud_cover, :humidity, :visibility].each do |k|
71
+ h.delete(k)
72
+ end
68
73
 
69
74
  # create 2 records using tempMinC and tempMaxC
70
- hl = h.merge(
75
+ hl = h.clone.merge(
71
76
  {
77
+ :wwo_type => :prediction_temp_low,
72
78
  :time_created => Time.now,
73
79
  :time_from => Time.create_time_from_string(p["date"], "0:00") - 4 * 3600,
74
80
  :time_to => Time.create_time_from_string(p["date"], "0:00") + 8 * 3600,
@@ -78,8 +84,10 @@ module WeatherFetcher
78
84
  weather_archives << hl
79
85
 
80
86
  # and high
81
- hh = h.merge(
87
+ hh = h.clone.merge(
82
88
  {
89
+ :wwo_type => :prediction_temp_high,
90
+ :time_created => Time.now,
83
91
  :time_from => Time.create_time_from_string(p["date"], "0:00") + 8 * 3600,
84
92
  :time_to => Time.create_time_from_string(p["date"], "0:00") + 20 * 3600,
85
93
  :temperature => p["tempMaxC"].to_i
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.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-09-15 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simple_metar_parser
16
- requirement: &18084900 !ruby/object:Gem::Requirement
16
+ requirement: &24600500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.0.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *18084900
24
+ version_requirements: *24600500
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &18070260 !ruby/object:Gem::Requirement
27
+ requirement: &24591560 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.3.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *18070260
35
+ version_requirements: *24591560
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &18069780 !ruby/object:Gem::Requirement
38
+ requirement: &24591080 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *18069780
46
+ version_requirements: *24591080
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jeweler
49
- requirement: &18069280 !ruby/object:Gem::Requirement
49
+ requirement: &24590580 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.6.4
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *18069280
57
+ version_requirements: *24590580
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: simplecov
60
- requirement: &18068740 !ruby/object:Gem::Requirement
60
+ requirement: &24590060 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *18068740
68
+ version_requirements: *24590060
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rdoc
71
- requirement: &18068240 !ruby/object:Gem::Requirement
71
+ requirement: &24589560 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *18068240
79
+ version_requirements: *24589560
80
80
  description: Fetch weather from various Polish websites and via other gems. At the
81
81
  moment it is only polish portal Onet.pl but more providers will come soon.
82
82
  email: bobikx@poczta.fm
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  segments:
128
128
  - 0
129
- hash: 3802347963225655031
129
+ hash: -2317311865113955722
130
130
  required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  none: false
132
132
  requirements: