lita-tweet 0.3.0 → 0.4.0
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.travis.yml +2 -3
- data/Gemfile +14 -0
- data/Guardfile +14 -0
- data/README.md +16 -3
- data/bin/guard +17 -0
- data/bin/rake +17 -0
- data/bin/rspec +17 -0
- data/lib/lita/handlers/tweet.rb +117 -17
- data/lib/lita/handlers/tweet/account.rb +8 -4
- data/lib/lita/handlers/tweet/data.rb +49 -3
- data/lita-tweet.gemspec +1 -7
- data/spec/lita/handlers/tweet_spec.rb +59 -0
- data/spec/spec_helper.rb +10 -6
- metadata +12 -88
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 263cf1dd5488823347205ebf4056792676e7e3e4
|
4
|
+
data.tar.gz: 84a43ad8a14e1f04ae2d8bc76b41497be2b09e91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6a3960e01053b68c3fb483f7b7ec6e7e7e0adb4fc8b35051cd924b7c5661172b3b6292f293f08fc0a6f6e9cabb8b8b296f1d577c055011e7dbf78cc865194ec
|
7
|
+
data.tar.gz: 14c659282690525c55dce342dab2f9bc3512619f77e6707dd2805ef64abc44f115b4c7e7c0a973e3c37837acfc8d1a5b85eca6ccc1232df8661926b2b164b27d
|
data/.gitignore
CHANGED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,3 +1,17 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
3
|
gemspec
|
4
|
+
|
5
|
+
group :development do
|
6
|
+
gem "coveralls", require: false
|
7
|
+
gem "guard-rspec"
|
8
|
+
gem "pry-byebug"
|
9
|
+
gem "rack-test"
|
10
|
+
gem "rake"
|
11
|
+
gem "rspec", "~> 3.4"
|
12
|
+
gem "simplecov"
|
13
|
+
gem "webmock"
|
14
|
+
end
|
15
|
+
|
16
|
+
# This fixes `already initialized constant` warnings while running commands
|
17
|
+
begin; require "rb-readline"; rescue LoadError; end
|
data/Guardfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
guard :rspec, cmd: "bin/rspec" do
|
2
|
+
require "guard/rspec/dsl"
|
3
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
4
|
+
|
5
|
+
# RSpec files
|
6
|
+
rspec = dsl.rspec
|
7
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
8
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
9
|
+
watch(rspec.spec_files)
|
10
|
+
|
11
|
+
# Ruby files
|
12
|
+
ruby = dsl.ruby
|
13
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
14
|
+
end
|
data/README.md
CHANGED
@@ -5,18 +5,31 @@
|
|
5
5
|
|
6
6
|
Allows the Lita chat bot to tweet on command.
|
7
7
|
|
8
|
+
|
8
9
|
## Installation
|
9
10
|
|
10
11
|
Add lita-tweet to your Lita instance's Gemfile:
|
11
12
|
|
12
|
-
```
|
13
|
+
```ruby
|
13
14
|
gem "lita-tweet"
|
14
15
|
```
|
15
16
|
|
16
17
|
## Configuration
|
17
18
|
|
18
|
-
|
19
|
+
To make this plugin work, you'll need to set at least `TWITTER\_CONSUMER\_KEY` and `TWITTER\_CONSUMER\_SECRET`. If you want to host the bot at a specific URL, rather than the default `0.0.0.0:1234` type address, you'll also need to set `SERVER\_URL` so that the bot knows where to send users and Twitter auth callbacks.
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require "lita-tweet" if ENV.has_key?("TWITTER_CONSUMER_KEY")
|
23
|
+
|
24
|
+
Lita.configure do |config|
|
25
|
+
if ENV.has_key?("TWITTER_CONSUMER_KEY")
|
26
|
+
config.handlers.tweet.http_url = ENV["SERVER_URL"]
|
27
|
+
config.handlers.tweet.consumer_key = ENV.fetch("TWITTER_CONSUMER_KEY")
|
28
|
+
config.handlers.tweet.consumer_secret = ENV.fetch("TWITTER_CONSUMER_SECRET")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
```
|
19
32
|
|
20
33
|
## Usage
|
21
34
|
|
22
|
-
|
35
|
+
To authorize an account for tweeting, use the command `twitter accounts add` and follow the instructions. To tweet, use the command `tweet some text that should go in the tweet`. To delete the last tweet, use the command `untweet`. For a complete list of commands, including how to map specific twitter accounts to specific chat channels, see the output from the command `help`.
|
data/bin/guard
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'guard' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("guard", "guard")
|
data/bin/rake
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'rake' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("rake", "rake")
|
data/bin/rspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'rspec' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/lib/lita/handlers/tweet.rb
CHANGED
@@ -15,12 +15,16 @@ module Lita
|
|
15
15
|
restrict_to: :tweeters, help: {
|
16
16
|
"twitter accounts" => "List accounts that can be tweeted from.",
|
17
17
|
"twitter accounts add" => "Authorize a new account for tweeting.",
|
18
|
-
"twitter accounts remove NAME" => "Remove the twitter account NAME"
|
18
|
+
"twitter accounts remove NAME" => "Remove the twitter account NAME."
|
19
19
|
}
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
route %r{^twitter default}, :default, command: true, restrict_to: :tweeters,
|
21
|
+
help: { "twitter default ACCOUNT" => "Set the default account to tweet from." }
|
22
|
+
route %r{^twitter map}, :map, command: true, restrict_to: :tweeters, help: {
|
23
|
+
"twitter map" => "List account to channel mappings.",
|
24
|
+
"twitter map NAME ACCOUNT" => "Tweet as ACCOUNT when told to tweet from NAME.",
|
25
|
+
}
|
26
|
+
route %r{^twitter unmap}, :unmap, command: true, restrict_to: :tweeters,
|
27
|
+
help: { "twitter unmap NAME" => "Tweet as the default twitter account when told to tweet in channel CHANNEL." }
|
24
28
|
|
25
29
|
TWITTER_AUTH_URL = "/twitter/auth"
|
26
30
|
TWITTER_AUTH_CALLBACK_URL = "/twitter/callback"
|
@@ -33,17 +37,17 @@ module Lita
|
|
33
37
|
return response.reply("I need something to tweet!")
|
34
38
|
end
|
35
39
|
|
36
|
-
account = account_for(response)
|
37
|
-
return response.
|
40
|
+
account = account_for(response.message.source)
|
41
|
+
return response.reply(no_accounts_message) if account.nil?
|
38
42
|
|
39
43
|
tweet = account.tweet(text)
|
40
44
|
twitter_data.set_last_tweet(account.username, tweet.id)
|
41
|
-
response.reply(tweet.url)
|
45
|
+
response.reply(tweet.url.to_s)
|
42
46
|
end
|
43
47
|
|
44
48
|
def untweet(response)
|
45
|
-
account = account_for(response)
|
46
|
-
return response.
|
49
|
+
account = account_for(response.message.source)
|
50
|
+
return response.reply(no_accounts_message) if account.nil?
|
47
51
|
|
48
52
|
if account.untweet
|
49
53
|
response.reply("Removed last tweet.")
|
@@ -63,9 +67,27 @@ module Lita
|
|
63
67
|
end
|
64
68
|
end
|
65
69
|
|
66
|
-
|
67
|
-
|
68
|
-
|
70
|
+
def map(response)
|
71
|
+
name, account = response.args[1..2]
|
72
|
+
account.gsub!(/^@/, '') if account
|
73
|
+
|
74
|
+
if name
|
75
|
+
response.reply(set_map(name, account))
|
76
|
+
else
|
77
|
+
response.reply(list_map)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def default(response)
|
82
|
+
account = response.args[1]
|
83
|
+
account.gsub!(/^@/, '') if account
|
84
|
+
response.reply(set_default_map(account))
|
85
|
+
end
|
86
|
+
|
87
|
+
def unmap(response)
|
88
|
+
name = response.args[1]
|
89
|
+
response.reply(clear_map(name))
|
90
|
+
end
|
69
91
|
|
70
92
|
def twitter_auth(request, response)
|
71
93
|
callback_url = TWITTER_AUTH_CALLBACK_URL
|
@@ -81,6 +103,10 @@ module Lita
|
|
81
103
|
response.body << "Done! You can now tweet from @#{account.username}."
|
82
104
|
end
|
83
105
|
|
106
|
+
def twitter_data
|
107
|
+
@twitter_data ||= Data.new(redis, config, robot)
|
108
|
+
end
|
109
|
+
|
84
110
|
private
|
85
111
|
|
86
112
|
def list_accounts
|
@@ -103,12 +129,86 @@ module Lita
|
|
103
129
|
twitter_data.remove_account(name)
|
104
130
|
"Removed @#{name}."
|
105
131
|
end
|
106
|
-
|
107
|
-
|
132
|
+
|
133
|
+
def valid_name?(name)
|
134
|
+
%w[@ #].include?(name[0])
|
108
135
|
end
|
109
136
|
|
110
|
-
def
|
111
|
-
@
|
137
|
+
def invalid_name
|
138
|
+
"Names for mapping need to be @username (for DMs) or #channel!"
|
139
|
+
end
|
140
|
+
|
141
|
+
def list_map
|
142
|
+
return "No accounts are configured." unless default_account
|
143
|
+
|
144
|
+
channels = twitter_data.channel_map
|
145
|
+
if channels.empty?
|
146
|
+
"All channels will tweet as @#{default_account.username}"
|
147
|
+
else
|
148
|
+
"Channel twitter accounts:\n" +
|
149
|
+
channels.map{|c,u| " - #{c} will tweet as @#{u}" }.join("\n") +
|
150
|
+
"\n - all other channels will tweet as @#{default_account.username}"
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
def set_default_map(username)
|
155
|
+
if username.nil?
|
156
|
+
"You need to provide an account to set as the default!"
|
157
|
+
elsif twitter_data.set_default(username)
|
158
|
+
"Done. The default account is now @#{username}."
|
159
|
+
else
|
160
|
+
"I can't tweet as @#{username}, so it can't be the default."
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
def set_map(channel, username)
|
165
|
+
if !valid_name?(channel)
|
166
|
+
invalid_name
|
167
|
+
elsif username.nil?
|
168
|
+
"Provide an account name to set as the default!"
|
169
|
+
elsif twitter_data.set_channel_map(channel, username)
|
170
|
+
"From now on, tweets from #{channel} will use the twitter account @#{username}."
|
171
|
+
else
|
172
|
+
"I can't tweet as @#{username}, so it can't be mapped."
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
def clear_map(channel)
|
177
|
+
return invalid_name unless valid_name?(channel)
|
178
|
+
|
179
|
+
twitter_data.clear_channel_map(channel)
|
180
|
+
|
181
|
+
if default_account
|
182
|
+
"Tweets from #{channel} will come from the default account, @#{default_account.username}."
|
183
|
+
else
|
184
|
+
no_accounts_message
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def account_for(source)
|
189
|
+
channel_name = sender_for(source)
|
190
|
+
twitter_data.get_channel_account(channel_name) || default_account
|
191
|
+
end
|
192
|
+
|
193
|
+
def default_account
|
194
|
+
twitter_data.default_account
|
195
|
+
end
|
196
|
+
|
197
|
+
def no_accounts_message
|
198
|
+
"No accounts are configured for tweeting."
|
199
|
+
end
|
200
|
+
|
201
|
+
def sender_for(source)
|
202
|
+
if source.private_message
|
203
|
+
handle = source.user.metadata["mention_name"] || source.user.name
|
204
|
+
handle ? "@#{handle}" : nil
|
205
|
+
else
|
206
|
+
# lita-slack has a bug where source.room_object.name is wrong,
|
207
|
+
# and to get the correct name you have to find the room again
|
208
|
+
# https://github.com/litaio/lita-slack/issues/44
|
209
|
+
name = Lita::Room.find_by_id(source.room).name
|
210
|
+
name ? "##{name}" : nil
|
211
|
+
end
|
112
212
|
end
|
113
213
|
|
114
214
|
Lita.register_handler(self)
|
@@ -6,10 +6,6 @@ module Lita
|
|
6
6
|
class Tweet < Handler
|
7
7
|
|
8
8
|
Account = KeywordStruct.new(:username, :token, :secret, :config, :last_tweet) do
|
9
|
-
def username
|
10
|
-
@username ||= client.user.screen_name
|
11
|
-
end
|
12
|
-
|
13
9
|
def tweet(text)
|
14
10
|
client.update(text)
|
15
11
|
end
|
@@ -18,9 +14,17 @@ module Lita
|
|
18
14
|
last_tweet ? client.destroy_status(last_tweet) : false
|
19
15
|
end
|
20
16
|
|
17
|
+
def lookup_username!
|
18
|
+
client.user.screen_name.tap do |username|
|
19
|
+
self.username = username
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
21
23
|
private
|
22
24
|
|
23
25
|
def client
|
26
|
+
return nil unless config && token && secret
|
27
|
+
|
24
28
|
@client ||= ::Twitter::REST::Client.new do |c|
|
25
29
|
c.consumer_key = config.consumer_key
|
26
30
|
c.consumer_secret = config.consumer_secret
|
@@ -9,16 +9,26 @@ module Lita
|
|
9
9
|
redis.smembers("twitter_accounts")
|
10
10
|
end
|
11
11
|
|
12
|
+
def default_account
|
13
|
+
account(redis.get("default_username"))
|
14
|
+
end
|
15
|
+
|
12
16
|
def account(username)
|
17
|
+
return nil if username.nil?
|
18
|
+
|
13
19
|
hash = redis.hgetall("twitter_accounts:#{username}")
|
20
|
+
return nil if hash.empty?
|
21
|
+
|
14
22
|
data = hash.each_with_object({}){|(k,v),h| h[k.to_sym] = v }
|
15
23
|
Account.new(**data.merge(config: config))
|
16
24
|
end
|
17
25
|
|
18
|
-
def add_account(token, secret)
|
19
|
-
account = Account.new(token: token, secret: secret,
|
20
|
-
|
26
|
+
def add_account(token, secret, username = nil)
|
27
|
+
account = Account.new(token: token, secret: secret,
|
28
|
+
config: config, username: username)
|
29
|
+
username ||= account.lookup_username!
|
21
30
|
|
31
|
+
redis.setnx("default_username", username)
|
22
32
|
redis.sadd("twitter_accounts", username)
|
23
33
|
redis.hmset("twitter_accounts:#{username}",
|
24
34
|
"username", username,
|
@@ -32,6 +42,11 @@ module Lita
|
|
32
42
|
def remove_account(username)
|
33
43
|
redis.del("twitter_accounts:#{username}")
|
34
44
|
redis.srem("twitter_accounts", username)
|
45
|
+
|
46
|
+
if redis.get("default_username") == username
|
47
|
+
next_username = usernames.first
|
48
|
+
redis.set("default_username", next_username)
|
49
|
+
end
|
35
50
|
end
|
36
51
|
|
37
52
|
def set_last_tweet(username, tweet_id)
|
@@ -42,6 +57,37 @@ module Lita
|
|
42
57
|
redis.hget("twitter_accounts:#{username}", "last_tweet")
|
43
58
|
end
|
44
59
|
|
60
|
+
def channel_map
|
61
|
+
redis.smembers("channels").map do |name|
|
62
|
+
[name, get_channel_map(name)]
|
63
|
+
end.to_h
|
64
|
+
end
|
65
|
+
|
66
|
+
def get_channel_account(channel)
|
67
|
+
return nil unless channel
|
68
|
+
account(get_channel_map(channel))
|
69
|
+
end
|
70
|
+
|
71
|
+
def get_channel_map(channel)
|
72
|
+
redis.get("channels:#{channel}")
|
73
|
+
end
|
74
|
+
|
75
|
+
def set_channel_map(channel, username)
|
76
|
+
return false unless usernames.include?(username)
|
77
|
+
redis.sadd("channels", channel)
|
78
|
+
redis.set("channels:#{channel}", username)
|
79
|
+
end
|
80
|
+
|
81
|
+
def clear_channel_map(channel)
|
82
|
+
redis.del("channels:#{channel}")
|
83
|
+
redis.srem("channels", channel)
|
84
|
+
end
|
85
|
+
|
86
|
+
def set_default(username)
|
87
|
+
return false unless usernames.include?(username)
|
88
|
+
redis.set("default_username", username)
|
89
|
+
end
|
90
|
+
|
45
91
|
def create_request_token(callback_path)
|
46
92
|
request_token = consumer.get_request_token(
|
47
93
|
oauth_callback: bot_uri(callback_path).to_s)
|
data/lita-tweet.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-tweet"
|
3
|
-
spec.version = "0.
|
3
|
+
spec.version = "0.4.0"
|
4
4
|
spec.authors = ["Andre Arko"]
|
5
5
|
spec.email = ["andre@arko.net"]
|
6
6
|
spec.description = "Tweeting for Lita"
|
@@ -19,10 +19,4 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.add_runtime_dependency "oauth", "~> 0.5.1"
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.12"
|
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
22
|
end
|
@@ -1,4 +1,63 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Lita::Handlers::Tweet, lita_handler: true do
|
4
|
+
# Chat routes
|
5
|
+
{
|
6
|
+
"tweet some text" => :tweet,
|
7
|
+
"untweet" => :untweet,
|
8
|
+
"twitter accounts" => :accounts,
|
9
|
+
"twitter accounts add" => :accounts,
|
10
|
+
"twitter accounts remove foo" => :accounts,
|
11
|
+
"twitter default foo" => :default,
|
12
|
+
"twitter map" => :map,
|
13
|
+
"twitter map foo" => :map,
|
14
|
+
"twitter unmap foo" => :unmap
|
15
|
+
}.each do |command, method|
|
16
|
+
it { is_expected.to route_command(command).
|
17
|
+
with_authorization_for(:tweeters).
|
18
|
+
to(method) }
|
19
|
+
end
|
20
|
+
|
21
|
+
# HTTP routes
|
22
|
+
{
|
23
|
+
"/twitter/auth" => :twitter_auth,
|
24
|
+
"/twitter/callback" => :twitter_auth_callback
|
25
|
+
}.each do |route, method|
|
26
|
+
it { is_expected.to route_http(:get, route).to(method) }
|
27
|
+
end
|
28
|
+
|
29
|
+
before(:each) do
|
30
|
+
Lita::Authorization.new(registry.config).add_user_to_group!(source.user, :tweeters)
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "#tweet" do
|
34
|
+
context "without an authorized account" do
|
35
|
+
it "should complain" do
|
36
|
+
send_command("tweet some text")
|
37
|
+
expect(replies).to include(/no accounts/i)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context "with an authorized account" do
|
42
|
+
before do
|
43
|
+
subject.twitter_data.add_account("token", "secret", "handle")
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should send a tweet" do
|
47
|
+
stub_request(:post, "https://api.twitter.com/1.1/statuses/update.json").
|
48
|
+
with(body: {status: "some text"}).to_return(status: 200, body: %q[{
|
49
|
+
"created_at": "Sun Aug 14 01:53:54 +0000 2016",
|
50
|
+
"id": 12345,
|
51
|
+
"text": "some text",
|
52
|
+
"user": {
|
53
|
+
"id": 123,
|
54
|
+
"screen_name": "handle",
|
55
|
+
"created_at": "Wed Nov 04 17:18:22 +0000 2009"
|
56
|
+
}
|
57
|
+
}])
|
58
|
+
send_command("tweet some text")
|
59
|
+
expect(replies).to include("https://twitter.com/handle/status/12345")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
4
63
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,14 +1,18 @@
|
|
1
|
-
require "simplecov"
|
2
1
|
require "coveralls"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
]
|
7
|
-
SimpleCov.start { add_filter "/spec/" }
|
2
|
+
require "simplecov"
|
3
|
+
SimpleCov.add_filter("/.bundle/")
|
4
|
+
Coveralls.wear!
|
8
5
|
|
9
6
|
require "lita-tweet"
|
10
7
|
require "lita/rspec"
|
8
|
+
require "webmock/rspec"
|
11
9
|
|
12
10
|
# A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
|
13
11
|
# was generated with Lita 4, the compatibility mode should be left disabled.
|
14
12
|
Lita.version_3_compatibility_mode = false
|
13
|
+
|
14
|
+
RSpec.configure do |config|
|
15
|
+
config.example_status_persistence_file_path = ".rspec_examples"
|
16
|
+
config.filter_run focus: true
|
17
|
+
config.run_all_when_everything_filtered = true
|
18
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-tweet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andre Arko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -66,103 +66,27 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.12'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: pry-byebug
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rake
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rack-test
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rspec
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 3.0.0
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 3.0.0
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: simplecov
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: coveralls
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
69
|
description: Tweeting for Lita
|
154
70
|
email:
|
155
71
|
- andre@arko.net
|
156
|
-
executables:
|
72
|
+
executables:
|
73
|
+
- guard
|
74
|
+
- rake
|
75
|
+
- rspec
|
157
76
|
extensions: []
|
158
77
|
extra_rdoc_files: []
|
159
78
|
files:
|
160
79
|
- ".gitignore"
|
80
|
+
- ".rspec"
|
161
81
|
- ".travis.yml"
|
162
82
|
- Gemfile
|
83
|
+
- Guardfile
|
163
84
|
- LICENSE
|
164
85
|
- README.md
|
165
86
|
- Rakefile
|
87
|
+
- bin/guard
|
88
|
+
- bin/rake
|
89
|
+
- bin/rspec
|
166
90
|
- lib/keyword_struct.rb
|
167
91
|
- lib/lita-tweet.rb
|
168
92
|
- lib/lita/handlers/tweet.rb
|
@@ -194,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
118
|
version: '0'
|
195
119
|
requirements: []
|
196
120
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.
|
121
|
+
rubygems_version: 2.5.1
|
198
122
|
signing_key:
|
199
123
|
specification_version: 4
|
200
124
|
summary: Allows the Lita chat bot to tweet on command
|