lita-ship-to-pastebin 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/extensions/ship_to_pastebin.rb +5 -4
- data/lib/lita/handlers/bigtext.rb +3 -1
- data/lita-ship-to-pastebin.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6a20037881235c21425d08044541369bf28bf8b
|
4
|
+
data.tar.gz: c5748075f25055583774317d4c45e3c7fd690d2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9372830f2b002fa668988f2354b23e26c83314d6e856a71e6277c3b4d8f6ac13748e09de21120911055e9b19e2bb2539a1bba2cf0227f8f801d156d9c7d904c2
|
7
|
+
data.tar.gz: 35269e80361ef19574bf0f727993c7957241de56a027a66e147036f5c92364c0de3241b5e67b9a1b758dca06a7d4d14e12fe31aea73f0cca262576799849b2b8
|
@@ -3,15 +3,16 @@ require 'faraday'
|
|
3
3
|
module Lita
|
4
4
|
module Extensions
|
5
5
|
class ShipToPastebin
|
6
|
-
|
7
|
-
|
6
|
+
API_KEY_DEFAULT = 'd88582e90ba06b60569dc55ab5b678ce'
|
7
|
+
|
8
|
+
PASTEBIN_URL = 'https://pastebin.com/api/api_post.php'.freeze
|
8
9
|
|
9
10
|
PasteBinError = Class.new(StandardError)
|
10
11
|
|
11
|
-
def save_to_pastebin(message, title: "Lita's Wall of Text")
|
12
|
+
def save_to_pastebin(message, title: "Lita's Wall of Text", api_key: API_KEY_DEFAULT )
|
12
13
|
begin
|
13
14
|
result = Faraday.post PASTEBIN_URL, {
|
14
|
-
api_dev_key:
|
15
|
+
api_dev_key: api_key,
|
15
16
|
api_paste_name: title,
|
16
17
|
api_paste_code: message,
|
17
18
|
api_option: 'paste'
|
@@ -3,6 +3,8 @@ require 'lita-ship-to-pastebin'
|
|
3
3
|
module Lita
|
4
4
|
module Handlers
|
5
5
|
class Bigtext < Handler
|
6
|
+
config :pastebin_api_key, default: 'd88582e90ba06b60569dc55ab5b678ce'
|
7
|
+
|
6
8
|
Lita.register_handler(self)
|
7
9
|
|
8
10
|
# START:snip
|
@@ -18,7 +20,7 @@ module Lita
|
|
18
20
|
end
|
19
21
|
|
20
22
|
def snip_text(text)
|
21
|
-
Lita::Extensions::ShipToPastebin.new.save_to_pastebin(text)
|
23
|
+
Lita::Extensions::ShipToPastebin.new.save_to_pastebin(text, api_key: config.pastebin_api_key)
|
22
24
|
end
|
23
25
|
|
24
26
|
def longtext
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-ship-to-pastebin'
|
3
|
-
spec.version = '0.1.
|
3
|
+
spec.version = '0.1.5'
|
4
4
|
spec.authors = ['Daniel J. Pritchett']
|
5
5
|
spec.email = ['dpritchett@gmail.com']
|
6
6
|
spec.description = 'Expose helper method to pastebin-ify any input text'
|