lita-espn-fantasy-football 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +18 -0
- data/.travis.yml +16 -0
- data/Gemfile +3 -0
- data/LICENSE +202 -0
- data/README.md +41 -0
- data/Rakefile +6 -0
- data/lib/lita-espn-fantasy-football.rb +12 -0
- data/lib/lita/handlers/espn_fantasy_football.rb +134 -0
- data/lita-espn-fantasy-football.gemspec +28 -0
- data/locales/en.yml +4 -0
- data/spec/lita/handlers/espn_fantasy_football_spec.rb +4 -0
- data/spec/spec_helper.rb +14 -0
- data/templates/.gitkeep +0 -0
- metadata +202 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YjU1NTI0YTQwMDFiZDc5NmM2YmFhZTQwYTVhZjE0ZTExZjMwMWM1NA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YWU1MGUxMGJlMWM2MzlkNjA1YzJhNzRiYjE0MWE0MGEwMjViMTFiNA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
Y2Q0OGUzY2QxOTA0MmQ2ZGQxNDFkNjU4ZThiYjMxNjNlZTFhOGFhMjc2MWIz
|
10
|
+
MjI1NDFmZjBlZmQ4MTVkYmYzYTg4YzM0NGU4ZTYxOGNjNmQ3NWI5NzlmMWMy
|
11
|
+
OWFlYTQyNGE2ODM1NGFiYzM3NDg1ZjNiY2ExMGRiNjliNGVhMWM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NzFlNTIxZTQ2ZDI4YzA5MTJhMmZmN2M3YTM5ZWVkNGE4YzgzYjhmYjdlOTIw
|
14
|
+
YTY2MjYwNDBiMWE1ODU2MTNjZDU3MDFhMThlNGNjZTk2NjRlYzlkZGUzMGM2
|
15
|
+
MzIwZThlNTA5MGYwNDdjMTI2MjVhNjZiYjM5YTYxOTMwNTY4MTM=
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.0.0
|
4
|
+
script: bundle exec rake
|
5
|
+
before_install:
|
6
|
+
- gem update --system
|
7
|
+
services:
|
8
|
+
- redis-server
|
9
|
+
deploy:
|
10
|
+
provider: rubygems
|
11
|
+
api_key:
|
12
|
+
secure: OaQ6BdoABson4OoBWWoACf23/3caU+3ZxazgG/GECR81+OHnAW+jZ6axJEQLih+e0UjfOm9GzsJMWhGQwBEqpqZsNLqiIVmc0qNMx1bnPOvldjFiwHqTYg6atMPIwm8TcmwuDmL/1MwWn0t88KRSXEj60EMgKLE18pqRZoUFDT5fCbgYyMJ5i8BLjzHDwEz1Jj2Izax5MZnzw7tqMWjDNkvo30+7+Rf8RKmouduCKu6kR9+YfDpFS0VRJyp49SJ1rix4oy4ZltNHs7x4wH0ZgGkrzbPrGb/qXcz8NxlOzui5Ys5BKbS3RgmSc1a1K9KM/sb3pG6RtoV/LiHPKIWwsGLBCzB+2Tur2cmBOEX/sps8dUVOShh7oqzxMASpT+jQ8FNajWKVn7J+SXF0VKRu9kXYBX4wYTXPm9sKpKmB0hLtXyQrEbU8VZE1ySDYmuiz37zvyUlsS8E+aMm5aWv3uKcFvky+WdD1es6vCEOXaV6sI9NDFdkHprHs5s+an9zcWET/4f1V+o2ZKZHvFjbN7RczDtTOW9+A+zYIoP5HKCxNjCDXqHXiwpL+clsSdsDOOZmk695QMJslcnNStGN6IT3yNhslTG3qFjYNXcpxRq3yPq3DQFyWeDqriW190s1HSRhLVmKkCYArX4Wi1gSaR0RRH2sGtcZfuxJmHVmbnKc=
|
13
|
+
gem: lita-espn-fantasy-football
|
14
|
+
on:
|
15
|
+
tags: true
|
16
|
+
repo: kevinreedy/lita-espn-fantasy-football
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright {yyyy} {name of copyright owner}
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
202
|
+
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# lita-espn-fantasy-football
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/kevinreedy/lita-espn-fantasy-football.png?branch=master)](https://travis-ci.org/kevinreedy/lita-espn-fantasy-football)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/kevinreedy/lita-espn-fantasy-football/badge.png)](https://coveralls.io/r/kevinreedy/lita-espn-fantasy-football)
|
5
|
+
|
6
|
+
This handler is used to scrape data from ESPN's Fantasy Football Site. Right now, it is very limited, so PRs are very welcome!
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add lita-espn-fantasy-football to your Lita instance's Gemfile:
|
11
|
+
|
12
|
+
``` ruby
|
13
|
+
gem "lita-espn-fantasy-football"
|
14
|
+
```
|
15
|
+
|
16
|
+
## Configuration
|
17
|
+
|
18
|
+
Set your `league_id`, and optionally `season_id` (defaults to 2015)
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
Lita.configure do |config|
|
22
|
+
config.handlers.espn_fantasy_football.league_id = "123456"
|
23
|
+
config.handlers.espn_fantasy_football.season_id = "2015"
|
24
|
+
end
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
### Searching for a Player
|
30
|
+
|
31
|
+
```
|
32
|
+
Lita: player manning
|
33
|
+
|
34
|
+
+------------------+------+----------+-------+------------+------+
|
35
|
+
| player | team | position | owner | projection | note |
|
36
|
+
+------------------+------+----------+-------+------------+------+
|
37
|
+
| Peyton Manning | Den | QB | RG3 | 17 | |
|
38
|
+
| Eli Manning | NYG | QB | CALI | 17 | |
|
39
|
+
| Mario Manningham | NYG | WR | FA | -- | |
|
40
|
+
+------------------+------+----------+-------+------------+------+
|
41
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require "lita"
|
2
|
+
|
3
|
+
Lita.load_locales Dir[File.expand_path(
|
4
|
+
File.join("..", "..", "locales", "*.yml"), __FILE__
|
5
|
+
)]
|
6
|
+
|
7
|
+
require "lita/handlers/espn_fantasy_football"
|
8
|
+
|
9
|
+
Lita::Handlers::EspnFantasyFootball.template_root File.expand_path(
|
10
|
+
File.join("..", "..", "templates"),
|
11
|
+
__FILE__
|
12
|
+
)
|
@@ -0,0 +1,134 @@
|
|
1
|
+
require "nokogiri"
|
2
|
+
require "terminal-table"
|
3
|
+
|
4
|
+
module Lita
|
5
|
+
module Handlers
|
6
|
+
class EspnFantasyFootball < Handler
|
7
|
+
# configs
|
8
|
+
config :league_id, required: true
|
9
|
+
config :season_id, required: true, default: "2015"
|
10
|
+
|
11
|
+
# routes
|
12
|
+
route(/^player\s+(.+)/, :command_player, command: true, help: {
|
13
|
+
"player PLAYER NAME" => "Replies information about this football player"
|
14
|
+
})
|
15
|
+
|
16
|
+
# chat controllers
|
17
|
+
def command_player(response)
|
18
|
+
player = response.matches.first.first
|
19
|
+
Lita.logger.debug("#{ response.user.name } asked about player #{ player }")
|
20
|
+
|
21
|
+
results = espn_player_search(player)
|
22
|
+
|
23
|
+
if results["rows"].any?
|
24
|
+
response.reply(format_results(results))
|
25
|
+
else
|
26
|
+
response.reply("No results found for '#{ player }'")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# constants
|
31
|
+
ESPN_POSITION_MAP = {
|
32
|
+
"qb" => 0,
|
33
|
+
"rb" => 2,
|
34
|
+
"wr" => 4,
|
35
|
+
"te" => 6,
|
36
|
+
"flex" => 23,
|
37
|
+
"d" => 16,
|
38
|
+
"k" => 17
|
39
|
+
}
|
40
|
+
|
41
|
+
ESPN_STATUS_MAP = {
|
42
|
+
"ir" => "injured",
|
43
|
+
"o" => "out",
|
44
|
+
"p" => "probable",
|
45
|
+
"q" => "questionable",
|
46
|
+
"sspd" => "suspended"
|
47
|
+
}
|
48
|
+
|
49
|
+
# helper methods
|
50
|
+
def get_troll_response
|
51
|
+
responses = [
|
52
|
+
"Your request was bad and you should feel bad.",
|
53
|
+
"Stop wasting my time with your bullshit.",
|
54
|
+
"Was that even English?"
|
55
|
+
].sample
|
56
|
+
end
|
57
|
+
|
58
|
+
def espn_player_search(query, position="")
|
59
|
+
resp = {
|
60
|
+
"headers" => [
|
61
|
+
"player",
|
62
|
+
"team",
|
63
|
+
"position",
|
64
|
+
"owner",
|
65
|
+
"projection",
|
66
|
+
"note"
|
67
|
+
],
|
68
|
+
"rows" => [],
|
69
|
+
}
|
70
|
+
|
71
|
+
url = "http://games.espn.go.com/ffl/freeagency?leagueId=#{ config.league_id }&seasonId=#{ config.season_id }&avail=-1&search=#{ query }"
|
72
|
+
|
73
|
+
if position && ESPN_POSITION_MAP[position]
|
74
|
+
url += "&position=#{ ESPN_POSITION_MAP[position] }&slotCategoryId=2"
|
75
|
+
end
|
76
|
+
|
77
|
+
Lita.logger.debug("Searching for player at #{ url }")
|
78
|
+
|
79
|
+
page = Nokogiri::HTML(open(url))
|
80
|
+
players = page.css("table.playerTableTable.tableBody tr.pncPlayerRow")
|
81
|
+
|
82
|
+
players.each do |p|
|
83
|
+
bio_cell = p.css("td.playertablePlayerName")
|
84
|
+
|
85
|
+
# skip blank cells
|
86
|
+
next unless bio_cell
|
87
|
+
|
88
|
+
# extract info
|
89
|
+
name, bio = bio_cell.text.split(", ")
|
90
|
+
chunks = bio.split(/[[:space:]]+/)
|
91
|
+
|
92
|
+
if chunks.length < 2
|
93
|
+
Lita.logger.warn("Got a weird cell for player query #{ query }")
|
94
|
+
next
|
95
|
+
end
|
96
|
+
|
97
|
+
team, position, note = chunks
|
98
|
+
note.downcase! if note
|
99
|
+
|
100
|
+
if note
|
101
|
+
if ESPN_STATUS_MAP.include?(note)
|
102
|
+
note = ESPN_STATUS_MAP[note]
|
103
|
+
else
|
104
|
+
Lita.logger.warn("Status #{ note } missing from status map")
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
owner = p.css("td")[2].text
|
109
|
+
proj = p.css("td")[13].text
|
110
|
+
|
111
|
+
resp["rows"] << {
|
112
|
+
"player" => name,
|
113
|
+
"team" => team,
|
114
|
+
"position" => position,
|
115
|
+
"owner" => owner,
|
116
|
+
"projection" => proj,
|
117
|
+
"note" => note
|
118
|
+
}
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
resp
|
123
|
+
end
|
124
|
+
|
125
|
+
def format_results(raw)
|
126
|
+
rows = raw["rows"].map{|r| r.map{ |k,v| v}}
|
127
|
+
table = Terminal::Table.new(:headings => raw["headers"], :rows => rows)
|
128
|
+
"```\n#{ table }\n```"
|
129
|
+
end
|
130
|
+
|
131
|
+
Lita.register_handler(self)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Gem::Specification.new do |spec|
|
2
|
+
spec.name = "lita-espn-fantasy-football"
|
3
|
+
spec.version = "0.1.0"
|
4
|
+
spec.authors = ["Kevin Reedy", "Miles Evenson"]
|
5
|
+
spec.email = ["kevinreedy@gmail.com", "miles.evenson@gmail.com"]
|
6
|
+
spec.description = "Lita handler for ESPN Fantasy Football"
|
7
|
+
spec.summary = "Lita handler for ESPN Fantasy Football"
|
8
|
+
spec.homepage = "https://github.com/kevinreedy/lita-espn-fantasy-football"
|
9
|
+
spec.license = "Apache License, v2.0"
|
10
|
+
spec.metadata = { "lita_plugin_type" => "handler" }
|
11
|
+
|
12
|
+
spec.files = `git ls-files`.split($/)
|
13
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
14
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
15
|
+
spec.require_paths = ["lib"]
|
16
|
+
|
17
|
+
spec.add_runtime_dependency "lita", ">= 4.6"
|
18
|
+
spec.add_runtime_dependency "nokogiri", ">= 1.6"
|
19
|
+
spec.add_runtime_dependency "terminal-table", ">= 1.5"
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "pry-byebug"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "rack-test"
|
25
|
+
spec.add_development_dependency "rspec", ">= 3.0.0"
|
26
|
+
spec.add_development_dependency "simplecov"
|
27
|
+
spec.add_development_dependency "coveralls"
|
28
|
+
end
|
data/locales/en.yml
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require "simplecov"
|
2
|
+
require "coveralls"
|
3
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
4
|
+
SimpleCov::Formatter::HTMLFormatter,
|
5
|
+
Coveralls::SimpleCov::Formatter
|
6
|
+
]
|
7
|
+
SimpleCov.start { add_filter "/spec/" }
|
8
|
+
|
9
|
+
require "lita-espn-fantasy-football"
|
10
|
+
require "lita/rspec"
|
11
|
+
|
12
|
+
# A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
|
13
|
+
# was generated with Lita 4, the compatibility mode should be left disabled.
|
14
|
+
Lita.version_3_compatibility_mode = false
|
data/templates/.gitkeep
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lita-espn-fantasy-football
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kevin Reedy
|
8
|
+
- Miles Evenson
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: lita
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ! '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '4.6'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ! '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '4.6'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: nokogiri
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ! '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.6'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.6'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: terminal-table
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '1.5'
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '1.5'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: bundler
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.3'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.3'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: pry-byebug
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ! '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rake
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ! '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ! '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: rack-test
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rspec
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 3.0.0
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 3.0.0
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: simplecov
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ! '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ! '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: coveralls
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ! '>='
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ! '>='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
description: Lita handler for ESPN Fantasy Football
|
155
|
+
email:
|
156
|
+
- kevinreedy@gmail.com
|
157
|
+
- miles.evenson@gmail.com
|
158
|
+
executables: []
|
159
|
+
extensions: []
|
160
|
+
extra_rdoc_files: []
|
161
|
+
files:
|
162
|
+
- .gitignore
|
163
|
+
- .travis.yml
|
164
|
+
- Gemfile
|
165
|
+
- LICENSE
|
166
|
+
- README.md
|
167
|
+
- Rakefile
|
168
|
+
- lib/lita-espn-fantasy-football.rb
|
169
|
+
- lib/lita/handlers/espn_fantasy_football.rb
|
170
|
+
- lita-espn-fantasy-football.gemspec
|
171
|
+
- locales/en.yml
|
172
|
+
- spec/lita/handlers/espn_fantasy_football_spec.rb
|
173
|
+
- spec/spec_helper.rb
|
174
|
+
- templates/.gitkeep
|
175
|
+
homepage: https://github.com/kevinreedy/lita-espn-fantasy-football
|
176
|
+
licenses:
|
177
|
+
- Apache License, v2.0
|
178
|
+
metadata:
|
179
|
+
lita_plugin_type: handler
|
180
|
+
post_install_message:
|
181
|
+
rdoc_options: []
|
182
|
+
require_paths:
|
183
|
+
- lib
|
184
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
186
|
+
- - ! '>='
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
189
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - ! '>='
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: '0'
|
194
|
+
requirements: []
|
195
|
+
rubyforge_project:
|
196
|
+
rubygems_version: 2.4.5
|
197
|
+
signing_key:
|
198
|
+
specification_version: 4
|
199
|
+
summary: Lita handler for ESPN Fantasy Football
|
200
|
+
test_files:
|
201
|
+
- spec/lita/handlers/espn_fantasy_football_spec.rb
|
202
|
+
- spec/spec_helper.rb
|