barometer 0.6.7 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +3 -0
  3. data/LICENSE +1 -1
  4. data/README.rdoc +36 -8
  5. data/Rakefile +7 -28
  6. data/TODO +4 -0
  7. data/VERSION.yml +2 -2
  8. data/barometer.gemspec +20 -193
  9. data/bin/barometer +8 -5
  10. data/lib/barometer.rb +5 -1
  11. data/lib/barometer/data/local_datetime.rb +11 -7
  12. data/lib/barometer/formats.rb +2 -1
  13. data/lib/barometer/formats/coordinates.rb +15 -3
  14. data/lib/barometer/formats/format.rb +18 -0
  15. data/lib/barometer/formats/geocode.rb +12 -5
  16. data/lib/barometer/formats/weather_id.rb +0 -15
  17. data/lib/barometer/formats/woe_id.rb +150 -0
  18. data/lib/barometer/query.rb +20 -4
  19. data/lib/barometer/services.rb +2 -1
  20. data/lib/barometer/weather_services/service.rb +0 -4
  21. data/lib/barometer/weather_services/weather_bug.rb +2 -2
  22. data/lib/barometer/weather_services/yahoo.rb +14 -3
  23. data/lib/barometer/web_services/placemaker.rb +95 -0
  24. data/lib/barometer/web_services/web_service.rb +1 -4
  25. data/spec/barometer_spec.rb +14 -32
  26. data/spec/data/local_datetime_spec.rb +7 -2
  27. data/spec/data/zone_spec.rb +5 -2
  28. data/spec/fakeweb_helper.rb +158 -0
  29. data/spec/fixtures/services/placemaker/T5B4M9.xml +65 -0
  30. data/spec/fixtures/services/placemaker/atlanta.xml +65 -0
  31. data/spec/fixtures/services/placemaker/coords.xml +65 -0
  32. data/spec/fixtures/services/placemaker/ksfo.xml +65 -0
  33. data/spec/fixtures/services/placemaker/new_york.xml +65 -0
  34. data/spec/fixtures/services/placemaker/the_hills.xml +65 -0
  35. data/spec/fixtures/services/placemaker/w615702.xml +46 -0
  36. data/spec/fixtures/services/weather_bug/90210_forecast.xml +1 -1
  37. data/spec/formats/coordinates_spec.rb +16 -0
  38. data/spec/formats/format_spec.rb +9 -0
  39. data/spec/formats/woe_id_spec.rb +215 -0
  40. data/spec/query_spec.rb +38 -0
  41. data/spec/spec_helper.rb +7 -160
  42. data/spec/weather_services/google_spec.rb +0 -8
  43. data/spec/weather_services/services_spec.rb +1 -1
  44. data/spec/weather_services/weather_bug_spec.rb +0 -36
  45. data/spec/weather_services/weather_dot_com_spec.rb +0 -20
  46. data/spec/weather_services/wunderground_spec.rb +0 -30
  47. data/spec/weather_services/yahoo_spec.rb +1 -17
  48. data/spec/web_services/placemaker_spec.rb +46 -0
  49. metadata +136 -18
  50. data/lib/barometer/extensions/httparty.rb +0 -21
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barometer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 7
8
+ - 0
9
+ version: 0.7.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Mark G
@@ -9,42 +14,104 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-10 00:00:00 -07:00
17
+ date: 2010-02-10 00:00:00 -05:00
13
18
  default_executable: barometer
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: httparty
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
20
25
  requirements:
21
26
  - - ">="
22
27
  - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 4
31
+ - 5
23
32
  version: 0.4.5
24
- version:
33
+ type: :runtime
34
+ version_requirements: *id001
25
35
  - !ruby/object:Gem::Dependency
26
36
  name: tzinfo
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
30
40
  requirements:
31
41
  - - ">="
32
42
  - !ruby/object:Gem::Version
43
+ segments:
44
+ - 0
45
+ - 3
46
+ - 14
33
47
  version: 0.3.14
34
- version:
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: nokogiri
52
+ prerelease: false
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ type: :runtime
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
64
+ name: rspec
65
+ prerelease: false
66
+ requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ~>
70
+ - !ruby/object:Gem::Version
71
+ segments:
72
+ - 2
73
+ - 6
74
+ version: "2.6"
75
+ type: :development
76
+ version_requirements: *id004
77
+ - !ruby/object:Gem::Dependency
78
+ name: mocha
79
+ prerelease: false
80
+ requirement: &id005 !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ type: :development
89
+ version_requirements: *id005
90
+ - !ruby/object:Gem::Dependency
91
+ name: fakeweb
92
+ prerelease: false
93
+ requirement: &id006 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ segments:
99
+ - 0
100
+ version: "0"
101
+ type: :development
102
+ version_requirements: *id006
35
103
  description: A multi API consuming weather forecasting superstar.
36
104
  email: barometer@attackcorp.com
37
105
  executables:
38
106
  - barometer
39
107
  extensions: []
40
108
 
41
- extra_rdoc_files:
42
- - LICENSE
43
- - README.rdoc
44
- - TODO
109
+ extra_rdoc_files: []
110
+
45
111
  files:
46
112
  - .document
47
113
  - .gitignore
114
+ - Gemfile
48
115
  - LICENSE
49
116
  - README.rdoc
50
117
  - Rakefile
@@ -66,7 +133,6 @@ files:
66
133
  - lib/barometer/data/temperature.rb
67
134
  - lib/barometer/data/units.rb
68
135
  - lib/barometer/data/zone.rb
69
- - lib/barometer/extensions/httparty.rb
70
136
  - lib/barometer/formats.rb
71
137
  - lib/barometer/formats/coordinates.rb
72
138
  - lib/barometer/formats/format.rb
@@ -75,6 +141,7 @@ files:
75
141
  - lib/barometer/formats/postalcode.rb
76
142
  - lib/barometer/formats/short_zipcode.rb
77
143
  - lib/barometer/formats/weather_id.rb
144
+ - lib/barometer/formats/woe_id.rb
78
145
  - lib/barometer/formats/zipcode.rb
79
146
  - lib/barometer/measurements/measurement.rb
80
147
  - lib/barometer/measurements/result.rb
@@ -93,6 +160,7 @@ files:
93
160
  - lib/barometer/weather_services/wunderground.rb
94
161
  - lib/barometer/weather_services/yahoo.rb
95
162
  - lib/barometer/web_services/geocode.rb
163
+ - lib/barometer/web_services/placemaker.rb
96
164
  - lib/barometer/web_services/timezone.rb
97
165
  - lib/barometer/web_services/weather_id.rb
98
166
  - lib/barometer/web_services/web_service.rb
@@ -121,6 +189,7 @@ files:
121
189
  - spec/data/temperature_spec.rb
122
190
  - spec/data/units_spec.rb
123
191
  - spec/data/zone_spec.rb
192
+ - spec/fakeweb_helper.rb
124
193
  - spec/fixtures/formats/weather_id/90210.xml
125
194
  - spec/fixtures/formats/weather_id/atlanta.xml
126
195
  - spec/fixtures/formats/weather_id/from_USGA0028.xml
@@ -141,6 +210,13 @@ files:
141
210
  - spec/fixtures/geocode/newyork_ny.json
142
211
  - spec/fixtures/geocode/newyork_ny.xml
143
212
  - spec/fixtures/services/google/calgary_ab.xml
213
+ - spec/fixtures/services/placemaker/T5B4M9.xml
214
+ - spec/fixtures/services/placemaker/atlanta.xml
215
+ - spec/fixtures/services/placemaker/coords.xml
216
+ - spec/fixtures/services/placemaker/ksfo.xml
217
+ - spec/fixtures/services/placemaker/new_york.xml
218
+ - spec/fixtures/services/placemaker/the_hills.xml
219
+ - spec/fixtures/services/placemaker/w615702.xml
144
220
  - spec/fixtures/services/weather_bug/90210_current.xml
145
221
  - spec/fixtures/services/weather_bug/90210_forecast.xml
146
222
  - spec/fixtures/services/weather_dot_com/90210.xml
@@ -154,6 +230,7 @@ files:
154
230
  - spec/formats/postalcode_spec.rb
155
231
  - spec/formats/short_zipcode_spec.rb
156
232
  - spec/formats/weather_id_spec.rb
233
+ - spec/formats/woe_id_spec.rb
157
234
  - spec/formats/zipcode_spec.rb
158
235
  - spec/measurements/measurement_spec.rb
159
236
  - spec/measurements/result_array_spec.rb
@@ -168,6 +245,7 @@ files:
168
245
  - spec/weather_services/yahoo_spec.rb
169
246
  - spec/weather_spec.rb
170
247
  - spec/web_services/geocode_spec.rb
248
+ - spec/web_services/placemaker_spec.rb
171
249
  - spec/web_services/web_services_spec.rb
172
250
  has_rdoc: true
173
251
  homepage: http://github.com/attack/barometer
@@ -179,21 +257,25 @@ rdoc_options:
179
257
  require_paths:
180
258
  - lib
181
259
  required_ruby_version: !ruby/object:Gem::Requirement
260
+ none: false
182
261
  requirements:
183
262
  - - ">="
184
263
  - !ruby/object:Gem::Version
264
+ segments:
265
+ - 0
185
266
  version: "0"
186
- version:
187
267
  required_rubygems_version: !ruby/object:Gem::Requirement
268
+ none: false
188
269
  requirements:
189
270
  - - ">="
190
271
  - !ruby/object:Gem::Version
272
+ segments:
273
+ - 0
191
274
  version: "0"
192
- version:
193
275
  requirements: []
194
276
 
195
277
  rubyforge_project:
196
- rubygems_version: 1.3.5
278
+ rubygems_version: 1.3.7
197
279
  signing_key:
198
280
  specification_version: 3
199
281
  summary: A multi API consuming weather forecasting superstar.
@@ -210,6 +292,40 @@ test_files:
210
292
  - spec/data/temperature_spec.rb
211
293
  - spec/data/units_spec.rb
212
294
  - spec/data/zone_spec.rb
295
+ - spec/fakeweb_helper.rb
296
+ - spec/fixtures/formats/weather_id/90210.xml
297
+ - spec/fixtures/formats/weather_id/atlanta.xml
298
+ - spec/fixtures/formats/weather_id/from_USGA0028.xml
299
+ - spec/fixtures/formats/weather_id/ksfo.xml
300
+ - spec/fixtures/formats/weather_id/new_york.xml
301
+ - spec/fixtures/geocode/40_73.json
302
+ - spec/fixtures/geocode/40_73.xml
303
+ - spec/fixtures/geocode/90210.json
304
+ - spec/fixtures/geocode/90210.xml
305
+ - spec/fixtures/geocode/T5B4M9.json
306
+ - spec/fixtures/geocode/T5B4M9.xml
307
+ - spec/fixtures/geocode/atlanta.json
308
+ - spec/fixtures/geocode/atlanta.xml
309
+ - spec/fixtures/geocode/calgary_ab.json
310
+ - spec/fixtures/geocode/calgary_ab.xml
311
+ - spec/fixtures/geocode/ksfo.json
312
+ - spec/fixtures/geocode/ksfo.xml
313
+ - spec/fixtures/geocode/newyork_ny.json
314
+ - spec/fixtures/geocode/newyork_ny.xml
315
+ - spec/fixtures/services/google/calgary_ab.xml
316
+ - spec/fixtures/services/placemaker/T5B4M9.xml
317
+ - spec/fixtures/services/placemaker/atlanta.xml
318
+ - spec/fixtures/services/placemaker/coords.xml
319
+ - spec/fixtures/services/placemaker/ksfo.xml
320
+ - spec/fixtures/services/placemaker/new_york.xml
321
+ - spec/fixtures/services/placemaker/the_hills.xml
322
+ - spec/fixtures/services/placemaker/w615702.xml
323
+ - spec/fixtures/services/weather_bug/90210_current.xml
324
+ - spec/fixtures/services/weather_bug/90210_forecast.xml
325
+ - spec/fixtures/services/weather_dot_com/90210.xml
326
+ - spec/fixtures/services/wunderground/current_calgary_ab.xml
327
+ - spec/fixtures/services/wunderground/forecast_calgary_ab.xml
328
+ - spec/fixtures/services/yahoo/90210.xml
213
329
  - spec/formats/coordinates_spec.rb
214
330
  - spec/formats/format_spec.rb
215
331
  - spec/formats/geocode_spec.rb
@@ -217,6 +333,7 @@ test_files:
217
333
  - spec/formats/postalcode_spec.rb
218
334
  - spec/formats/short_zipcode_spec.rb
219
335
  - spec/formats/weather_id_spec.rb
336
+ - spec/formats/woe_id_spec.rb
220
337
  - spec/formats/zipcode_spec.rb
221
338
  - spec/measurements/measurement_spec.rb
222
339
  - spec/measurements/result_array_spec.rb
@@ -231,4 +348,5 @@ test_files:
231
348
  - spec/weather_services/yahoo_spec.rb
232
349
  - spec/weather_spec.rb
233
350
  - spec/web_services/geocode_spec.rb
351
+ - spec/web_services/placemaker_spec.rb
234
352
  - spec/web_services/web_services_spec.rb
@@ -1,21 +0,0 @@
1
- #
2
- # extends HTTParty by adding configurable timeout support
3
- #
4
- module HTTParty
5
- class Request
6
-
7
- private
8
-
9
- def http
10
- http = Net::HTTP.new(uri.host, uri.port, options[:http_proxyaddr], options[:http_proxyport])
11
- http.use_ssl = (uri.port == 443)
12
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
13
- if options[:timeout] && options[:timeout].is_a?(Integer)
14
- http.open_timeout = options[:timeout]
15
- http.read_timeout = options[:timeout]
16
- end
17
- http
18
- end
19
-
20
- end
21
- end