lita-butt 0.1.0 → 0.1.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: b9693359ea62f8b42c348b26a8458dc418acf68e
4
- data.tar.gz: 6d7bd440167d4dccaeab98f62f2adc78083e7493
3
+ metadata.gz: 567f3ea8c7f992c3c9b1cf53cc14a4904c6dbd9c
4
+ data.tar.gz: a62ece66162d1723eb5c9020e6655ea87065e551
5
5
  SHA512:
6
- metadata.gz: 2764f6a3d43a0f08861d1c11788e89c92df02a66453412cd6d822a206a418304d971ce9e23c51e5ee38f145e6b591bd5ce958f0a927161c328a85db988a0c12c
7
- data.tar.gz: bd943fb1e74d9086a1b62bbcf7d860d53c530f31e092783474c08974901e2d3e295965b666ad0f088ea3e4a1a0ce648d925449abc84eec7aa025c03e653cdfd7
6
+ metadata.gz: dc5ae23ae64e98c379f06df097b8be0e2e4660643af0632562b7ffbb7c7a3a7ab0dec65aeb7fb73bd99c4fc8d6901d40455ec2d50a06bfc45ec984784c3a9df6
7
+ data.tar.gz: 05f65f2b1d3c37d893d1badbf1edd58cbdd959b0eddb0e3a4078cf0910ebe4c4cde93b6d36e50cd9d6514cbec125b466cd02e9198868b37db135c54a162303b4
@@ -4,3 +4,5 @@ Metrics/LineLength:
4
4
  Style/FileName:
5
5
  Exclude:
6
6
  - 'lib/lita-butt.rb'
7
+ Style/FrozenStringLiteralComment:
8
+ Enabled: false
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  [![Build Status](https://travis-ci.org/nickpegg/lita-butt.svg?branch=master)](https://travis-ci.org/nickpegg/lita-butt)
2
+ [![CircleCI](https://circleci.com/gh/nickpegg/lita-butt.svg?style=svg)](https://circleci.com/gh/nickpegg/lita-butt)
2
3
  [![Coverage Status](https://coveralls.io/repos/github/nickpegg/lita-butt/badge.svg?branch=master)](https://coveralls.io/github/nickpegg/lita-butt?branch=master)
3
4
 
4
5
  # lita-butt
@@ -0,0 +1,10 @@
1
+ machine:
2
+ ruby:
3
+ version: 2.3.1
4
+ services:
5
+ - redis
6
+
7
+ test:
8
+ override:
9
+ - bundle exec rake rubocop
10
+ - bundle exec rake spec
@@ -3,13 +3,20 @@ module Lita
3
3
  # s/chatbot/chatbutt/
4
4
  class Butt < Handler
5
5
  # insert handler code here
6
- route(/^b(u*)tt/, :butt, help: { 'butt' => '(_)_)' })
6
+ route(/^b(u*)tt(s?)/, :butt, help: { 'butt' => '(_)_)' })
7
7
 
8
8
  def butt(response)
9
9
  groups = response.matches.first
10
10
  width = groups.first.size
11
11
 
12
- response.reply "(#{'_' * width})#{'_' * width})"
12
+ bottom = '_' * width
13
+ butt = "(#{bottom})#{bottom})"
14
+
15
+ if groups.last == 's'
16
+ response.reply [butt, butt].join ' '
17
+ else
18
+ response.reply butt
19
+ end
13
20
  end
14
21
 
15
22
  Lita.register_handler(self)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-butt'
3
- spec.version = '0.1.0'
3
+ spec.version = '0.1.1'
4
4
  spec.authors = ['Nick Pegg']
5
5
  spec.email = ['git@nickpegg.com']
6
6
  spec.description = 'Lita Handler to print ASCII butts'
@@ -8,12 +8,12 @@ describe Lita::Handlers::Butt, lita_handler: true do
8
8
  it { is_expected.to route('buuuuuutt').to(:butt) }
9
9
 
10
10
  describe '#butt' do
11
- it 'replied with a butt' do
11
+ it 'replies with a butt' do
12
12
  send_message 'butt'
13
13
  expect(replies.last).to eq '(_)_)'
14
14
  end
15
15
 
16
- it 'replied with a big ol butt' do
16
+ it 'replies with a big ol butt' do
17
17
  send_message 'buuuuuuuuuutt'
18
18
  expect(replies.last).to eq '(__________)__________)'
19
19
  end
@@ -22,5 +22,15 @@ describe Lita::Handlers::Butt, lita_handler: true do
22
22
  send_message 'btt'
23
23
  expect(replies.last).to eq '())'
24
24
  end
25
+
26
+ it 'replies with multiple butts' do
27
+ send_message 'butts'
28
+ expect(replies.last).to eq '(_)_) (_)_)'
29
+ end
30
+
31
+ it 'replies with multiple big butts' do
32
+ send_message 'buuuuutts'
33
+ expect(replies.last).to eq '(_____)_____) (_____)_____)'
34
+ end
25
35
  end
26
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-butt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Pegg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-09 00:00:00.000000000 Z
11
+ date: 2016-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -149,6 +149,7 @@ files:
149
149
  - Gemfile
150
150
  - README.md
151
151
  - Rakefile
152
+ - circle.yml
152
153
  - lib/lita-butt.rb
153
154
  - lib/lita/handlers/butt.rb
154
155
  - lita-butt.gemspec
@@ -175,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
176
  version: '0'
176
177
  requirements: []
177
178
  rubyforge_project:
178
- rubygems_version: 2.4.5
179
+ rubygems_version: 2.5.1
179
180
  signing_key:
180
181
  specification_version: 4
181
182
  summary: Lita Handler to print ASCII butts. Inspired by some silliness in Yelp's chatbot