weatherzone 0.8.0 → 0.8.1

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.
data/lib/weatherzone.rb CHANGED
@@ -22,5 +22,5 @@ require 'weatherzone/helpers/date_parser'
22
22
  require 'weatherzone/helpers/units'
23
23
 
24
24
  module Weatherzone
25
- VERSION = '0.8.0'
25
+ VERSION = '0.8.1'
26
26
  end
@@ -90,13 +90,13 @@ module Weatherzone
90
90
  def find_districts_by_state(connection, state, options={})
91
91
  options = options.dup
92
92
  options.merge!(:params => "&lt=dist&state=#{state}")
93
- find(connection, options).countries.first.locations
93
+ options[:url_only] ? find(connection, options) : find(connection, options).countries.first.locations
94
94
  end
95
95
 
96
96
  def find_radars_by_state(connection, state, options={})
97
97
  options = options.dup
98
98
  options.merge!(:params => "&lt=radar&links=1&ra=1&state=#{state}")
99
- find(connection, options).countries.first.locations
99
+ options[:url_only] ? find(connection, options) : find(connection, options).countries.first.locations
100
100
  end
101
101
 
102
102
  def find_by_radar_code(connection, radar_code, options={})
@@ -29,6 +29,9 @@ class Location < Weatherzone::Resource
29
29
  element :link, :value => :url, :as => :satellite_animator, :with => {:type => "satellite animator"}
30
30
  element :link, :value => :url, :as => :satellite_still, :with => {:type => "satellite still"}
31
31
 
32
+ element :related_location, :value => :code, :as => :district_code, :with => {:type => "DIST"}
33
+ element :related_location, :value => :name, :as => :district_name, :with => {:type => "DIST"}
34
+
32
35
  # override base ruby Object#type
33
36
  attr_reader :type
34
37
 
@@ -67,4 +67,9 @@ class TestLocation < Test::Unit::TestCase
67
67
  assert @location.buoy_observations.any?
68
68
  end
69
69
 
70
+ def test_should_have_related_district
71
+ assert_equal "N00", @location.district_code
72
+ assert_equal "Sydney", @location.district_name
73
+ end
74
+
70
75
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 8
8
- - 0
9
- version: 0.8.0
8
+ - 1
9
+ version: 0.8.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ben Askins
@@ -14,23 +14,51 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-10 00:00:00 +10:00
17
+ date: 2010-05-11 00:00:00 +10:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: hoe
21
+ name: rubyforge
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  segments:
28
- - 1
29
- - 8
28
+ - 2
30
29
  - 0
31
- version: 1.8.0
30
+ - 3
31
+ version: 2.0.3
32
32
  type: :development
33
33
  version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: gemcutter
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ - 5
44
+ - 0
45
+ version: 0.5.0
46
+ type: :development
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: hoe
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 2
57
+ - 5
58
+ - 0
59
+ version: 2.5.0
60
+ type: :development
61
+ version_requirements: *id003
34
62
  description: Ruby client for the weatherzone webservice.
35
63
  email:
36
64
  - ben.askins@gmail.com