yahoo_weatherman 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -92,6 +92,19 @@ module Weatherman
92
92
  attribute('yweather:astronomy')
93
93
  end
94
94
 
95
+ #
96
+ # Atmosphere :
97
+ #
98
+ # atmosphere = response.atmosphere
99
+ # atmosphere['humidity'] => "62"
100
+ # atmosphere['visibility'] => "9.99"
101
+ # atmosphere['pressure'] => "982.05"
102
+ # atmosphere['rising'] => "0"
103
+ #
104
+ def atmosphere
105
+ attribute('yweather:atmosphere')
106
+ end
107
+
95
108
  #
96
109
  # Latitude:
97
110
  #
@@ -119,7 +132,7 @@ module Weatherman
119
132
  # image['link'] => "http://weather.yahoo.com"
120
133
  #
121
134
  def image
122
- image = Weatherman::Image.new(attribute 'image')
135
+ image = Weatherman::Image.new(attribute('image'))
123
136
  do_convertions(image, [:width, :to_i], [:height, :to_i], :title, :link, :url)
124
137
  end
125
138
 
@@ -150,7 +163,7 @@ module Weatherman
150
163
  private
151
164
  def attribute(attr, root = @document_root)
152
165
  elements = root.xpath(attr)
153
- elements.one? ? elements.first : elements
166
+ elements.size == 1 ? elements.first : elements
154
167
  end
155
168
 
156
169
  def item_attribute(attr)
@@ -35,6 +35,13 @@ describe Weatherman::Response do
35
35
  @response.astronomy['sunrise'].should == '5:57 am'
36
36
  @response.astronomy['sunset'].should == '6:13 pm'
37
37
  end
38
+
39
+ it 'should provide atmosphere information' do
40
+ @response.atmosphere['humidity'].should == "62"
41
+ @response.atmosphere['visibility'].should == "9.99"
42
+ @response.atmosphere['pressure'].should == "982.05"
43
+ @response.atmosphere['rising'].should == "0"
44
+ end
38
45
 
39
46
  it 'should get the next 2 forecasts' do
40
47
  first = @response.forecasts.first
@@ -7,7 +7,7 @@ describe Weatherman::Client do
7
7
 
8
8
  it 'should lookup by woeid' do
9
9
  response = @client.lookup_by_woeid 455821
10
- response.should be_instance_of Weatherman::Response
10
+ response.should be_instance_of(Weatherman::Response)
11
11
  end
12
12
 
13
13
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "yahoo_weatherman"
3
- gem.version = "1.0.3"
3
+ gem.version = "1.1.0"
4
4
  gem.authors = ["Dalto Curvelano Junior"]
5
5
  gem.description = "A ruby wrapper to the Yahoo! Weather feed with i18n support."
6
6
  gem.summary = "A ruby wrapper to the Yahoo! Weather feed with i18n support."
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahoo_weatherman
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 19
4
5
  prerelease: false
5
6
  segments:
6
7
  - 1
8
+ - 1
7
9
  - 0
8
- - 3
9
- version: 1.0.3
10
+ version: 1.1.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - Dalto Curvelano Junior
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-05-25 00:00:00 -03:00
18
+ date: 2010-08-03 00:00:00 -03:00
18
19
  default_executable:
19
20
  dependencies: []
20
21
 
@@ -49,23 +50,27 @@ rdoc_options: []
49
50
  require_paths:
50
51
  - lib
51
52
  required_ruby_version: !ruby/object:Gem::Requirement
53
+ none: false
52
54
  requirements:
53
55
  - - ">="
54
56
  - !ruby/object:Gem::Version
57
+ hash: 3
55
58
  segments:
56
59
  - 0
57
60
  version: "0"
58
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
+ none: false
59
63
  requirements:
60
64
  - - ">="
61
65
  - !ruby/object:Gem::Version
66
+ hash: 3
62
67
  segments:
63
68
  - 0
64
69
  version: "0"
65
70
  requirements: []
66
71
 
67
72
  rubyforge_project:
68
- rubygems_version: 1.3.6
73
+ rubygems_version: 1.3.7
69
74
  signing_key:
70
75
  specification_version: 3
71
76
  summary: A ruby wrapper to the Yahoo! Weather feed with i18n support.