yahoo_weatherman 0.7 → 0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -212,9 +212,8 @@ module Weatherman
212
212
  end
213
213
 
214
214
  def translate_days!(attributes)
215
- days_translations = language_translations['forecasts']['days']
216
- day = attributes['day']
217
- if day
215
+ if day = attributes['day']
216
+ days_translations = language_translations['forecasts']['days']
218
217
  attributes['day'] = days_translations[day]
219
218
  end
220
219
  end
@@ -10,11 +10,11 @@ require 'yahoo_weatherman/response'
10
10
 
11
11
  module Weatherman
12
12
 
13
- VERSION = '0.7'
13
+ VERSION = '0.8'
14
14
 
15
15
  URI = 'http://weather.yahooapis.com/forecastrss'
16
16
 
17
- I18N_YAML_DIR = File.expand_path(File.dirname(__FILE__) + '/../i18n/')
17
+ I18N_YAML_DIR = File.expand_path(File.join([File.dirname(__FILE__), '..', 'i18n']))
18
18
 
19
19
  # = Client
20
20
  #
@@ -63,5 +63,4 @@ module Weatherman
63
63
  open(url) { |stream| stream.read }
64
64
  end
65
65
  end
66
-
67
66
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- path = File.expand_path(File.dirname(__FILE__) + "/../lib/")
1
+ path = File.expand_path(File.join([File.dirname(__FILE__), "..", "lib"]))
2
2
  $LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
3
3
 
4
4
  require 'rubygems'
@@ -7,15 +7,30 @@ require 'yahoo_weatherman'
7
7
  require 'spec'
8
8
 
9
9
  def celsius_fixture
10
- filepath = File.expand_path(File.dirname(__FILE__) + "/files/belo_horizonte_c.rss")
10
+ filepath = File.expand_path(File.join([File.dirname(__FILE__), "files", "belo_horizonte_c.rss"]))
11
11
  File.read filepath
12
12
  end
13
13
 
14
14
  def fahrenheight_fixture
15
- filepath = File.expand_path(File.dirname(__FILE__) + "/files/belo_horizonte_f.rss")
15
+ filepath = File.expand_path(File.join([File.dirname(__FILE__), "files", "belo_horizonte_f.rss"]))
16
16
  File.read filepath
17
17
  end
18
18
 
19
19
  FakeWeb.allow_net_connect = false
20
20
  FakeWeb.register_uri(:get, "http://weather.yahooapis.com/forecastrss?w=455821&u=c", :body => celsius_fixture)
21
21
  FakeWeb.register_uri(:get, "http://weather.yahooapis.com/forecastrss?w=455821&u=f", :body => fahrenheight_fixture)
22
+
23
+ module YAML
24
+ class << self
25
+
26
+ alias original_load load
27
+ def load(ignored_arg)
28
+ original_load(test_translation_file_stream)
29
+ end
30
+
31
+ def test_translation_file_stream
32
+ File.read(File.join([File.dirname(__FILE__), 'files', 'test_i18n.yml']))
33
+ end
34
+
35
+ end
36
+ end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "yahoo_weatherman"
3
- gem.version = "0.7"
3
+ gem.version = "0.8"
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,7 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahoo_weatherman
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.7"
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 8
8
+ version: "0.8"
5
9
  platform: ruby
6
10
  authors:
7
11
  - Dalto Curvelano Junior
@@ -9,7 +13,7 @@ autorequire:
9
13
  bindir: bin
10
14
  cert_chain: []
11
15
 
12
- date: 2010-03-31 00:00:00 -03:00
16
+ date: 2010-04-21 00:00:00 -03:00
13
17
  default_executable:
14
18
  dependencies: []
15
19
 
@@ -45,18 +49,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
45
49
  requirements:
46
50
  - - ">="
47
51
  - !ruby/object:Gem::Version
52
+ segments:
53
+ - 0
48
54
  version: "0"
49
- version:
50
55
  required_rubygems_version: !ruby/object:Gem::Requirement
51
56
  requirements:
52
57
  - - ">="
53
58
  - !ruby/object:Gem::Version
59
+ segments:
60
+ - 0
54
61
  version: "0"
55
- version:
56
62
  requirements: []
57
63
 
58
64
  rubyforge_project:
59
- rubygems_version: 1.3.5
65
+ rubygems_version: 1.3.6
60
66
  signing_key:
61
67
  specification_version: 3
62
68
  summary: A ruby wrapper to the Yahoo! Weather feed with i18n support.