tide 0.1.3 → 0.1.4

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.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/lib/tide.rb +5 -0
  3. data/test/test_tide.rb +5 -0
  4. data/tide.gemspec +2 -2
  5. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -20,6 +20,11 @@ class Tide
20
20
  @location = data.match(STATION_REGEX)[1]
21
21
  end
22
22
 
23
+ # Shortcut for station lookup
24
+ def self.station(sid)
25
+ new(:station => sid)
26
+ end
27
+
23
28
  # Download raw data
24
29
  def data
25
30
  @data ||= download_tide_data
@@ -36,4 +36,9 @@ class TideTest < Test::Unit::TestCase
36
36
  assert_not_equal tide_ast.to_csv, tide_est.to_csv
37
37
  end
38
38
 
39
+ def test_station_shortcut
40
+ @tide = Tide.station(9)
41
+ assert_match "Garnet Point", @tide.location
42
+ end
43
+
39
44
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{tide}
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Kenzie Campbell}]
12
- s.date = %q{2011-06-09}
12
+ s.date = %q{2011-06-11}
13
13
  s.description = %q{Tide class fetches and returns Canadian tide prediction data from waterlevels.gc.ca. Accepts options for tide station, date and timezone. Defaults to 7 days of tide prediction data (starting from today) for Sydney, Nova Scotia in Atlantic time. Outputs a comma separated list of tides (date, time, height in meters) with Tide.new.to_csv or a formatted html table with Tide.new.to_html.}
14
14
  s.email = %q{kenzie@route19.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: tide
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3
5
+ version: 0.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kenzie Campbell
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-09 00:00:00 Z
13
+ date: 2011-06-11 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
91
  - - ">="
92
92
  - !ruby/object:Gem::Version
93
- hash: -3486769737923497974
93
+ hash: 2932636755587203885
94
94
  segments:
95
95
  - 0
96
96
  version: "0"