weatherbug 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/weatherbug.rb +4 -1
- data/lib/weatherbug/live_observation.rb +1 -1
- data/lib/weatherbug/station.rb +1 -1
- data/lib/weatherbug/version.rb +1 -1
- metadata +3 -20
data/lib/weatherbug.rb
CHANGED
@@ -16,6 +16,9 @@ module WeatherBug
|
|
16
16
|
|
17
17
|
API_URL = 'datafeed.weatherbug.com'
|
18
18
|
|
19
|
+
Error = Class.new(RuntimeError)
|
20
|
+
NoSuchStation = Class.new(Error)
|
21
|
+
|
19
22
|
# Set your application's partner ID
|
20
23
|
def self.partner_id=(partner_id)
|
21
24
|
@partner_id = partner_id
|
@@ -125,7 +128,7 @@ module WeatherBug
|
|
125
128
|
params['RequestType'] = method
|
126
129
|
params['PartnerId'] = @partner_id
|
127
130
|
data = open("http://#{API_URL}/GetXml.aspx?#{params.map { |k, v| "#{k}=#{v}" }.join('&')}")
|
128
|
-
raise
|
131
|
+
raise Error.new("Unexpected exception - empty response") unless data
|
129
132
|
Nokogiri::XML(data)
|
130
133
|
end
|
131
134
|
|
data/lib/weatherbug/station.rb
CHANGED
data/lib/weatherbug/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weatherbug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 13
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 9
|
10
|
-
version: 0.0.9
|
5
|
+
version: 0.0.10
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- John Crepezzi
|
@@ -15,7 +10,7 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-
|
13
|
+
date: 2011-06-19 00:00:00 -04:00
|
19
14
|
default_executable:
|
20
15
|
dependencies:
|
21
16
|
- !ruby/object:Gem::Dependency
|
@@ -26,9 +21,6 @@ dependencies:
|
|
26
21
|
requirements:
|
27
22
|
- - ">="
|
28
23
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 0
|
32
24
|
version: "0"
|
33
25
|
type: :development
|
34
26
|
version_requirements: *id001
|
@@ -40,9 +32,6 @@ dependencies:
|
|
40
32
|
requirements:
|
41
33
|
- - ">="
|
42
34
|
- !ruby/object:Gem::Version
|
43
|
-
hash: 3
|
44
|
-
segments:
|
45
|
-
- 0
|
46
35
|
version: "0"
|
47
36
|
type: :runtime
|
48
37
|
version_requirements: *id002
|
@@ -78,23 +67,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
67
|
requirements:
|
79
68
|
- - ">="
|
80
69
|
- !ruby/object:Gem::Version
|
81
|
-
hash: 3
|
82
|
-
segments:
|
83
|
-
- 0
|
84
70
|
version: "0"
|
85
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
72
|
none: false
|
87
73
|
requirements:
|
88
74
|
- - ">="
|
89
75
|
- !ruby/object:Gem::Version
|
90
|
-
hash: 3
|
91
|
-
segments:
|
92
|
-
- 0
|
93
76
|
version: "0"
|
94
77
|
requirements: []
|
95
78
|
|
96
79
|
rubyforge_project: weatherbug
|
97
|
-
rubygems_version: 1.
|
80
|
+
rubygems_version: 1.6.2
|
98
81
|
signing_key:
|
99
82
|
specification_version: 3
|
100
83
|
summary: Ruby WeatherBug partner API
|