tide 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/tide.rb +2 -6
  3. data/tide.gemspec +2 -2
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
data/lib/tide.rb CHANGED
@@ -7,17 +7,13 @@ class Tide
7
7
  POST_URL = 'http://www.waterlevels.gc.ca/cgi-bin/tide-shc.cgi'
8
8
  TIDE_REGEX = /#\sDate;Time;Height<br>(.*)<br><\/p><\/td>/
9
9
  STATION_REGEX = /#\sStation\s:\s(.*)\s\(\d+\).*/
10
- INIT_DEFAULTS = { :station => 610, :timezone => 'AST', :date => Time.now }
11
-
12
- attr_reader :location
13
10
 
14
11
  # Create new tide table.
15
12
  def initialize(options = {})
16
- options = INIT_DEFAULTS.merge(options)
13
+ options = { :station => 610, :timezone => 'AST', :date => Time.now }.merge(options)
17
14
  @station = options[:station]
18
15
  @timezone = options[:timezone]
19
16
  @date = options[:date]
20
- @location = data.match(STATION_REGEX)[1]
21
17
  end
22
18
 
23
19
  # Shortcut for station lookup
@@ -68,7 +64,7 @@ private
68
64
 
69
65
  # Formats tide data as html table.
70
66
  def format_html
71
- formatted = "<table summary=\"Tide tables for #{location} with columns for time of day and tide height (in meters).\">\n\t<thead>\n\t\t<tr><th scope=\"col\">Time</th><th scope=\"col\">Height</th></tr>\n\t</thead>\n"
67
+ formatted = "<table summary=\"Tide tables with columns for time of day and tide height (in meters).\">\n\t<thead>\n\t\t<tr><th scope=\"col\">Time</th><th scope=\"col\">Height</th></tr>\n\t</thead>\n"
72
68
  last_date = nil
73
69
  to_csv.each_line do |row|
74
70
  row = row.chomp.split(',')
data/tide.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{tide}
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
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-11}
12
+ s.date = %q{2011-06-14}
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.4
5
+ version: 0.1.5
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-11 00:00:00 Z
13
+ date: 2011-06-14 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: 2932636755587203885
93
+ hash: -2265542199782359357
94
94
  segments:
95
95
  - 0
96
96
  version: "0"