weatherzone 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
File without changes
@@ -21,5 +21,5 @@ require 'weatherzone/helpers/date_parser'
21
21
  require 'weatherzone/helpers/units'
22
22
 
23
23
  module Weatherzone
24
- VERSION = '0.8.5'
24
+ VERSION = '0.8.6'
25
25
  end
@@ -18,14 +18,14 @@ module Weatherzone
18
18
  methods.each do |method_name|
19
19
  has_attribute :tz, :on_elements => methods
20
20
  define_method "#{method_name}_utc" do
21
- tz = TZInfo::Timezone.get("Australia/#{send("#{method_name}_tz")}")
22
- if value = instance_variable_get("@#{method_name}")
21
+ if (tz_identifier = send("#{method_name}_tz")) && (value = instance_variable_get("@#{method_name}"))
22
+ tz = TZInfo::Timezone.get("Australia/#{tz_identifier}")
23
23
  tz.local_to_utc(Time.parse(value))
24
24
  end
25
25
  end
26
26
  define_method method_name do
27
- if value = send("#{method_name}_utc")
28
- tz = TZInfo::Timezone.get("Australia/#{send("#{method_name}_tz")}")
27
+ if (tz_identifier = send("#{method_name}_tz")) && (value = send("#{method_name}_utc"))
28
+ tz = TZInfo::Timezone.get("Australia/#{tz_identifier}")
29
29
  tz.utc_to_local value
30
30
  end
31
31
  end
@@ -36,4 +36,4 @@ module Weatherzone
36
36
  end
37
37
  end
38
38
  end
39
- end
39
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weatherzone
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
5
- prerelease: false
4
+ hash: 51
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 5
10
- version: 0.8.5
9
+ - 6
10
+ version: 0.8.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ben Askins
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-05 00:00:00 +10:00
19
- default_executable:
18
+ date: 2011-08-17 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: hoe
@@ -123,7 +122,6 @@ files:
123
122
  - test/test_value_and_unit_helpers.rb
124
123
  - test/test_warning.rb
125
124
  - test/test_weather.rb
126
- has_rdoc: true
127
125
  homepage: http://github.com/benaskins/weatherzone/
128
126
  licenses: []
129
127
 
@@ -154,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
152
  requirements: []
155
153
 
156
154
  rubyforge_project: weatherzone
157
- rubygems_version: 1.3.7
155
+ rubygems_version: 1.8.5
158
156
  signing_key:
159
157
  specification_version: 3
160
158
  summary: Ruby client for the weatherzone webservice.