yahoo_weatherman 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  module Weatherman
2
3
  class I18N
3
4
  I18N_YAML_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'i18n'))
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  module Weatherman
2
3
  # == Image
3
4
  #
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  module Weatherman
2
3
 
3
4
  # = Response
@@ -51,8 +52,8 @@ module Weatherman
51
52
  # forecast['day'] => "Sat"
52
53
  #
53
54
  def forecasts
55
+ convertions = [[:date, :to_date], [:low, :to_i], [:high, :to_i], [:code, :to_i], :day, :text]
54
56
  item_attribute('yweather:forecast').collect do |forecast|
55
- convertions = [[:date, :to_date], [:low, :to_i], [:high, :to_i], [:code, :to_i], :day, :text]
56
57
  translate! do_convertions(forecast, *convertions)
57
58
  end
58
59
  end
@@ -102,7 +103,8 @@ module Weatherman
102
103
  # atmosphere['rising'] => "0"
103
104
  #
104
105
  def atmosphere
105
- attribute('yweather:atmosphere')
106
+ atm = attribute('yweather:atmosphere')
107
+ do_convertions(atm, [:humidity, :to_f], [:visibility, :to_f], [:pressure, :to_f], [:rising, :to_f])
106
108
  end
107
109
 
108
110
  #
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  path = File.expand_path(File.dirname(__FILE__))
2
3
  $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
3
4
 
@@ -13,7 +14,7 @@ require 'yahoo_weatherman/response'
13
14
 
14
15
  module Weatherman
15
16
 
16
- VERSION = '1.0.3'
17
+ VERSION = '1.1.1'
17
18
 
18
19
  URI = 'http://weather.yahooapis.com/forecastrss'
19
20
 
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Weatherman::I18N do
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Weatherman::Response do
@@ -37,10 +38,10 @@ describe Weatherman::Response do
37
38
  end
38
39
 
39
40
  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"
41
+ @response.atmosphere['humidity'].should == 62
42
+ @response.atmosphere['visibility'].should == 9.99
43
+ @response.atmosphere['pressure'].should == 982.05
44
+ @response.atmosphere['rising'].should be_zero
44
45
  end
45
46
 
46
47
  it 'should get the next 2 forecasts' do
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "yahoo_weatherman"
3
- gem.version = "1.1.0"
3
+ gem.version = "1.1.1"
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,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahoo_weatherman
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
4
  prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 1
9
- - 0
10
- version: 1.1.0
8
+ - 1
9
+ version: 1.1.1
11
10
  platform: ruby
12
11
  authors:
13
12
  - Dalto Curvelano Junior
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-08-03 00:00:00 -03:00
17
+ date: 2010-09-18 00:00:00 -03:00
19
18
  default_executable:
20
19
  dependencies: []
21
20
 
@@ -54,7 +53,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
53
  requirements:
55
54
  - - ">="
56
55
  - !ruby/object:Gem::Version
57
- hash: 3
58
56
  segments:
59
57
  - 0
60
58
  version: "0"
@@ -63,7 +61,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
61
  requirements:
64
62
  - - ">="
65
63
  - !ruby/object:Gem::Version
66
- hash: 3
67
64
  segments:
68
65
  - 0
69
66
  version: "0"