lakes 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 284c161f9520fee6464865b5aecd7a7b8ad49ddb
4
- data.tar.gz: a25c5d113356e2292105924d89c5b66455ebd199
3
+ metadata.gz: c93fdbed9e13716ece122e66258c8b39cb4c6c92
4
+ data.tar.gz: 105ecf2053e825ff3d012620754c0f1b509b62c8
5
5
  SHA512:
6
- metadata.gz: f4cddf5e3572ab95fab6dba25f9ba507f4f19992d21fac391d64c4a0049091345c6e536f244542d2d84afa3312705d9d74742f929a092e133f67d6629988b353
7
- data.tar.gz: 21801e976315764a15ef7e938150e848b7c48083a9397205f02e4fa95a410f9472c5d2853d458abe0ac8df04598bf7df30531a016fb143c86cdaac7686cb3693
6
+ metadata.gz: ea80d45796d0b5d9f354798619278e8539b127fb405c4fe761eb0ea0cedd168ca40d72379a6b1ad3183a04193fa51308c87e2f3f1a3802525c6b8298277a0808
7
+ data.tar.gz: bf88e6243e61ff780820dfc8e094b5753c787ff570061b37a17a510d43238f6ea2f95bc2ccc529ecb21c1bd1e36b7733d8f55209f579d5540d7e86ee43a47ef7
data/lib/lakes.rb CHANGED
@@ -4,5 +4,5 @@ require 'lakes/texas/water_conditions_parser'
4
4
  require 'lakes/texas/water_data_parser'
5
5
  require 'lakes/texas/fishing_report_parser'
6
6
  module Lakes
7
- VERSION = '0.2.2'.freeze
7
+ VERSION = '0.2.3'.freeze
8
8
  end
data/lib/lakes/texas.rb CHANGED
@@ -215,12 +215,10 @@ module Lakes
215
215
 
216
216
  content = http_get(lake_data[:current_fishing_report_uri])
217
217
  report_parser = FishingReportParser.new(content)
218
- current_fishing_report_doc = Nokogiri::HTML(content)
219
- current_fishing_report_dl = current_fishing_report_doc.at('div.row.report div.container dl')
220
-
221
- date = cleanup_data(current_fishing_report_dl.at('dt span.title').text)
222
- report = cleanup_data(current_fishing_report_dl.xpath('dd').text)
223
- {date: date, report: report}
218
+ {
219
+ date: report_parser.date,
220
+ report: report_parser.report
221
+ }
224
222
  end
225
223
 
226
224
  lake_data[:current_fishing_report] = fishing_report
@@ -11,6 +11,9 @@ module Lakes
11
11
 
12
12
  def initialize(text)
13
13
  @raw_text = text
14
+ @raw_date = nil
15
+ @date = nil
16
+ @report = nil
14
17
  parse
15
18
  end
16
19
 
@@ -22,6 +25,8 @@ module Lakes
22
25
  date_text = current_fishing_report_dl.at('dt span.title').try(:text)
23
26
  @raw_date = cleanup_data(date_text) unless date_text.nil?
24
27
 
28
+ @date = Date.parse(@raw_date) rescue nil
29
+
25
30
  report_text = current_fishing_report_dl.xpath('dd').try(:text)
26
31
  @report = cleanup_data(report_text) unless report_text.nil?
27
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lakes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Sherman