lita-memegen 1.0.0 → 1.0.1

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: 6f0ae8bb57da2a679da02e4291af8d75ca63f146
4
- data.tar.gz: f5703a90776620a3bfdea6ed961da85bd1f6a106
3
+ metadata.gz: aa0919ce1d56a987b4fc48d80ad5c3efc283ae77
4
+ data.tar.gz: 58558173486a6776e5943c12a24637de27fa85b5
5
5
  SHA512:
6
- metadata.gz: 9d4bb05f16d0d39391d0e88aa8ab4d0f829fa11279c3c4421fd4de6018de8026276e0be59a0314b2af9926196eae8e9c45a4f53d00b0584f464736ba3c928dc0
7
- data.tar.gz: c1f993dac97d474d678c86d7fbd1c375a31bb2faaed870b653af574039d0c7e6924ba81d4f0594f75fff0bf915116074fbd1cdbbe08293e4475470ff9b0b8101
6
+ metadata.gz: de40f01cc101bdccb68dc7605bc515c9100210840bec778223e73655d3c8e2770d729524377239aec4a4cda9a9dc6e27f2373d88c2a39a0462d4c69415090c79
7
+ data.tar.gz: 34caed9e92332780d9c653f91d9e5fca17376fa3454fef4100f06aed83462529e7cf598bd9bbe5c5f9f73b839a9af6e10210001d2e751780409bd4795e84f87c
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Code Climate](https://codeclimate.com/github/webdestroya/lita-memegen.png)](https://codeclimate.com/github/webdestroya/lita-memegen)
5
5
  [![Coverage Status](https://coveralls.io/repos/webdestroya/lita-memegen/badge.png)](https://coveralls.io/r/webdestroya/lita-memegen)
6
6
 
7
- **lita-memegen** is a handler for [Lita](https://github.com/jimmycuadra/lita) that generates meme images using memegenerator.net.
7
+ **lita-memegen** is a handler for [Lita](https://github.com/jimmycuadra/lita) that generates meme images using memegenerator.net. This is based on the hubot memegenerator script.
8
8
 
9
9
  ## Installation
10
10
 
@@ -20,6 +20,10 @@ You will need to register an account on memegenerator.net and provide the userna
20
20
 
21
21
  ```
22
22
  Lita.configure do |config|
23
+
24
+ # This requires that all memes be sent as commands. If this is false, the bot will listen in the channel
25
+ config.handlers.memegen.command_only = true
26
+
23
27
  config.handlers.memegen.username = 'username'
24
28
  config.handlers.memegen.password = 'password'
25
29
  end
@@ -27,7 +31,27 @@ end
27
31
 
28
32
  ## Usage
29
33
 
30
- TODO
34
+ * `Y U NO <text>` - Generates the Y U NO GUY with the bottom caption of <text>
35
+ * `I don't always <something> but when i do <text>` - Generates The Most Interesting man in * `<text> ORLY?` - Generates the ORLY? owl with the top caption of <text>
36
+ * `<text> (SUCCESS|NAILED IT)` - Generates success kid with the top caption of <text>
37
+ * `<text> ALL the <things>` - Generates ALL THE THINGS
38
+ * `<text> TOO DAMN <high>` - Generates THE RENT IS TOO DAMN HIGH guy
39
+ * `good news everyone! <news>` - Generates Professor Farnsworth
40
+ * `khanify <text>` - TEEEEEEEEEEEEEEEEEXT!
41
+ * `Not sure if <text> or <text>` - Generates Futurama Fry
42
+ * `Yo dawg <text> so <text>` - Generates Yo Dawg
43
+ * `ALL YOUR <text> ARE BELONG TO US` - Generates Zero Wing with the caption of <text>
44
+ * `if <text>, <word that can start a question> <text>?` - Generates Philosoraptor
45
+ * `<text> FUCK YOU` - Angry Linus
46
+ * `(Oh|You) <text> (Please|Tell) <text>` - Willy Wonka
47
+ * `<text> you're gonna have a bad time` - Bad Time Ski Instructor
48
+ * `one does not simply <text>` - Lord of the Rings Boromir
49
+ * `it looks like (you|you're) <text>` - Generates Clippy
50
+ * `AM I THE ONLY ONE AROUND HERE <text>` - The Big Lebowski
51
+ * `<text> NOT IMPRESSED` - Generates McKayla Maroney
52
+ * `PREPARE YOURSELF <text>` - Generates GoT
53
+ * `WHAT IF I TOLD YOU <text>` - Generates Morpheus
54
+ * `<text> BETTER DRINK MY OWN PISS` - Generates Bear Grylls
31
55
 
32
56
  ## License
33
57
 
@@ -5,30 +5,31 @@ module Lita
5
5
  class Memegen < Handler
6
6
 
7
7
  def self.default_config(config)
8
+ config.command_only = true
8
9
  config.username = nil
9
10
  config.password = nil
10
11
  end
11
12
 
12
- route %r{(!meme )?(Y U NO) (.+)}i, :meme_y_u_no, command: false
13
- route %r{(!meme )?(I DON'?T ALWAYS .*) (BUT WHEN I DO,? .*)}i, :meme_i_dont_always, command: false
14
- route %r{(!meme )?(.*)(O\s?RLY\??.*)}i, :meme_orly, command: false
15
- route %r{(!meme )?(.*)(SUCCESS|NAILED IT.*)}i, :meme_success, command: false
16
- route %r{(!meme )?(.*) (ALL the .*)}i, :meme_all_the, command: false
17
- route %r{(!meme )?(.*) (\w+\sTOO DAMN .*)}i, :meme_too_damn, command: false
18
- route %r{(!meme )?(GOOD NEWS EVERYONE[,.!]?) (.*)}i, :meme_good_news, command: false
19
- route %r{(!meme )?(NOT SURE IF .*) (OR .*)}i, :meme_not_sure_if, command: false
20
- route %r{(!meme )?(YO DAWG .*) (SO .*)}i, :meme_yo_dawg, command: false
21
- route %r{(!meme )?(ALL YOUR .*) (ARE BELONG TO US)}i, :meme_are_belong, command: false
22
- route %r{(!meme )?(.*) (FUCK YOU)}i, :meme_fuck_you, command: false
23
- route %r{(!meme )?(.*) (You'?re gonna have a bad time)}i, :meme_bad_time, command: false
24
- route %r{(!meme )?(one does not simply) (.*)}i, :meme_simply, command: false
25
- route %r{(!meme )?(grumpy cat) (.*),(.*)}i, :meme_grumpy_cat, command: false
26
- route %r{(!meme )?(it looks like you're|it looks like you) (.*)}i, :meme_looks_like, command: false
27
- route %r{(!meme )?(AM I THE ONLY ONE AROUND HERE) (.*)}i, :meme_am_i_only, command: false
28
- route %r{(!meme)?(.*)(NOT IMPRESSED*)}i, :meme_not_impressed, command: false
29
- route %r{(!meme)?(PREPARE YOURSELF) (.*)}i, :meme_prepare_yourself, command: false
30
- route %r{(!meme)?(WHAT IF I TOLD YOU) (.*)}i, :meme_what_if_i, command: false
31
- route %r{(!meme)?(.*) (BETTER DRINK MY OWN PISS)}i, :meme_better_drink, command: false
13
+ route %r{(Y U NO) (.+)}i, :meme_y_u_no
14
+ route %r{(I DON'?T ALWAYS .*) (BUT WHEN I DO,? .*)}i, :meme_i_dont_always
15
+ route %r{(.*)(O\s?RLY\??.*)}i, :meme_orly
16
+ route %r{(.*)(SUCCESS|NAILED IT.*)}i, :meme_success
17
+ route %r{(.*) (ALL the .*)}i, :meme_all_the
18
+ route %r{(.*) (\w+\sTOO DAMN .*)}i, :meme_too_damn
19
+ route %r{(GOOD NEWS EVERYONE[,.!]?) (.*)}i, :meme_good_news
20
+ route %r{(NOT SURE IF .*) (OR .*)}i, :meme_not_sure_if
21
+ route %r{(YO DAWG .*) (SO .*)}i, :meme_yo_dawg
22
+ route %r{(ALL YOUR .*) (ARE BELONG TO US)}i, :meme_are_belong
23
+ route %r{(.*) (FUCK YOU)}i, :meme_fuck_you
24
+ route %r{(.*) (You'?re gonna have a bad time)}i, :meme_bad_time
25
+ route %r{(one does not simply) (.*)}i, :meme_simply
26
+ route %r{(grumpy cat) (.*),(.*)}i, :meme_grumpy_cat
27
+ route %r{(it looks like you're|it looks like you) (.*)}i, :meme_looks_like
28
+ route %r{(AM I THE ONLY ONE AROUND HERE) (.*)}i, :meme_am_i_only
29
+ route %r{(.*)(NOT IMPRESSED*)}i, :meme_not_impressed
30
+ route %r{(PREPARE YOURSELF) (.*)}i, :meme_prepare_yourself
31
+ route %r{(WHAT IF I TOLD YOU) (.*)}i, :meme_what_if_i
32
+ route %r{(.*) (BETTER DRINK MY OWN PISS)}i, :meme_better_drink
32
33
 
33
34
 
34
35
  def meme_y_u_no(response)
@@ -115,8 +116,11 @@ module Lita
115
116
  private
116
117
 
117
118
  def generate_meme(response, generator_id, image_id)
118
- line1 = response.matches[0][1]
119
- line2 = response.matches[0][2]
119
+
120
+ return if Lita.config.handlers.memegen.command_only && !response.message.command?
121
+
122
+ line1 = response.matches[0][0]
123
+ line2 = response.matches[0][1]
120
124
  return if Lita.config.handlers.memegen.username.nil? || Lita.config.handlers.memegen.password.nil?
121
125
 
122
126
  http_resp = http.get(
data/lita-memegen.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-memegen"
3
- spec.version = "1.0.0"
3
+ spec.version = "1.0.1"
4
4
  spec.authors = ["Mitch Dempsey"]
5
5
  spec.email = ["mitch@mitchdempsey.com"]
6
6
  spec.description = %q{A Lita handler for generating meme images.}
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Lita::Handlers::Memegen, lita_handler: true do
4
- it { routes_command("Y U NO BLAH").to(:y_u_no) }
4
+ it { routes_command("Y U NO BLAH").to(:meme_y_u_no) }
5
5
 
6
6
  it "sets the username and password to nil by default" do
7
7
  expect(Lita.config.handlers.memegen.username).to be_nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-memegen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitch Dempsey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2013-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita