lakes 0.2.3 → 0.3.0

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: c93fdbed9e13716ece122e66258c8b39cb4c6c92
4
- data.tar.gz: 105ecf2053e825ff3d012620754c0f1b509b62c8
3
+ metadata.gz: ddf60ed7bd6d47a6785409ffc495729b9a1795b1
4
+ data.tar.gz: 174fa2666b3dd37f5ac1b927be311c98e689c9cb
5
5
  SHA512:
6
- metadata.gz: ea80d45796d0b5d9f354798619278e8539b127fb405c4fe761eb0ea0cedd168ca40d72379a6b1ad3183a04193fa51308c87e2f3f1a3802525c6b8298277a0808
7
- data.tar.gz: bf88e6243e61ff780820dfc8e094b5753c787ff570061b37a17a510d43238f6ea2f95bc2ccc529ecb21c1bd1e36b7733d8f55209f579d5540d7e86ee43a47ef7
6
+ metadata.gz: 61e19171142cc58750df554a91af85ca5bb19b45f46ab9be2b8168cc77a6f80bc80fbe5b08c1fd0986889426fec039f689e6a4c6b078dab3a56889e4fa4474ad
7
+ data.tar.gz: 788dfdfd20867ad8db8d413bfb93bfb045e9eaaa28377b3d1a8f8c098546777a4290ff01b0b939ed2ffce7c83cafd64d54568613e6c0ee5b95b4af5b4b021791
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Shane Sherman
3
+ Copyright (c) 2018 Shane Sherman
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/lakes.gemspec CHANGED
@@ -21,5 +21,6 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.15"
22
22
  spec.add_development_dependency "rake", "~> 12.3"
23
23
  spec.add_development_dependency "minitest", "~> 5.11"
24
+ spec.add_development_dependency "mocha", "~> 1.2"
24
25
  spec.add_dependency 'nokogiri', "~> 1.8"
25
26
  end
@@ -0,0 +1,47 @@
1
+ require 'nokogiri'
2
+ module Lakes
3
+ class Texas
4
+ class ShareALunker
5
+ include Lakes::Helper
6
+ URL = 'https://tpwd.texas.gov/spdest/visitorcenters/tffc/sharelunker/archives/lunkersearch_adv.phtml'
7
+
8
+ def initialize
9
+ @lunker_data = []
10
+ end
11
+
12
+ def list
13
+ return @lunker_data unless @lunker_data.empty?
14
+ content = http_get(URL)
15
+ html_doc = Nokogiri::HTML(content)
16
+
17
+ results = []
18
+ html_doc.search('div#contentwide table tr').each_with_index do |row, index|
19
+ next if index == 0
20
+ data = row.search('th, td').to_a
21
+
22
+ results << {
23
+ id: data[0].text.to_i,
24
+ details_uri: data[0].search('a')[0][:href],
25
+ date_caught: Date.strptime(cleanup_raw_text(data[1].text), '%m/%d/%Y'),
26
+ angler: cleanup_raw_text(data[2].text),
27
+ angler_location: cleanup_raw_text(data[3].text),
28
+ weight: cleanup_raw_text(data[4].text).to_f,
29
+ length: cleanup_raw_text(data[5].text).to_f,
30
+ girth: cleanup_raw_text(data[6].text).to_f,
31
+ type: cleanup_raw_text(data[7].text),
32
+ lake: cleanup_raw_text(data[8].text),
33
+ record: cleanup_raw_text(data[9].text),
34
+ caught_on: cleanup_raw_text(data[10].text),
35
+ day_of_week: cleanup_raw_text(data[11].text),
36
+ moon_phase: cleanup_raw_text(data[12].text),
37
+ spawned: cleanup_raw_text(data[13].text),
38
+ returned_to_lake: cleanup_raw_text(data[14].text),
39
+ status: cleanup_raw_text(data[15].text)
40
+ }
41
+ end
42
+ @lunker_data = results
43
+ return @lunker_data
44
+ end
45
+ end
46
+ end
47
+ end
data/lib/lakes.rb CHANGED
@@ -3,6 +3,7 @@ require 'lakes/texas/lake_characteristics_parser'
3
3
  require 'lakes/texas/water_conditions_parser'
4
4
  require 'lakes/texas/water_data_parser'
5
5
  require 'lakes/texas/fishing_report_parser'
6
+ require 'lakes/texas/share_a_lunker'
6
7
  module Lakes
7
- VERSION = '0.2.3'.freeze
8
+ VERSION = '0.3.0'.freeze
8
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lakes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Sherman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-01 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.11'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mocha
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.2'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: nokogiri
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -88,6 +102,7 @@ files:
88
102
  - lib/lakes/texas.rb
89
103
  - lib/lakes/texas/fishing_report_parser.rb
90
104
  - lib/lakes/texas/lake_characteristics_parser.rb
105
+ - lib/lakes/texas/share_a_lunker.rb
91
106
  - lib/lakes/texas/water_conditions_parser.rb
92
107
  - lib/lakes/texas/water_data_parser.rb
93
108
  - lib/try.rb