lita-onewheel-karma 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/lib/lita/handlers/onewheel_karma.rb +3 -1
- data/lita-onewheel-karma.gemspec +2 -1
- data/spec/lita/handlers/onewheel_karma_spec.rb +32 -18
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c57ec019e5ea0134ddc405c3109a77ef30ca90d
|
4
|
+
data.tar.gz: d40bc0c2d609fba433aa2e133e346a64c5fcf347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f45198697fb79a8d19448fa492ce2a059d5b66be936dc8e1e415aa8bb8ec41ce2916097a0aa2d3de0291bed03c63555dd8ded32c8312886078a6ae5b0bd54fa9
|
7
|
+
data.tar.gz: d4cd7a5f7e88ac4f3204add087e00aad931a3b425115124cde01f94d4aa3273a8132694f4aa99ad956ddd11523b1db3a197d26e7d63bacd4a59e72ed8eb7e971
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/onewheelskyward/lita-onewheel-karma.png?branch=master)](https://travis-ci.org/onewheelskyward/lita-onewheel-karma)
|
4
4
|
[![Coverage Status](https://coveralls.io/repos/onewheelskyward/lita-onewheel-karma/badge.png)](https://coveralls.io/r/onewheelskyward/lita-onewheel-karma)
|
5
|
+
[![Documentation Status](https://readthedocs.org/projects/lita-onewheel-karma/badge/?version=latest)](https://readthedocs.org/projects/lita-onewheel-karma/?badge=latest)
|
5
6
|
|
6
7
|
Karma should be opinionated, and unlimited.
|
7
8
|
|
@@ -21,11 +22,11 @@ n/a at this moment. I might customize messaging at some point.
|
|
21
22
|
|
22
23
|
Here are a few of the ways you can add/remove/multiply karma:
|
23
24
|
|
24
|
-
nick++
|
25
|
-
nick--
|
26
|
-
nick+=\d+
|
27
|
-
nick-=\d+
|
28
|
-
nick*=\d+
|
25
|
+
* nick++
|
26
|
+
* nick--
|
27
|
+
* nick+=\d+
|
28
|
+
* nick-=\d+
|
29
|
+
* nick*=\d+
|
29
30
|
|
30
31
|
and negative karma will be expressed with poo emoji and perhaps roman numerals.
|
31
32
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'roman-numerals'
|
2
|
+
|
1
3
|
module Lita
|
2
4
|
module Handlers
|
3
5
|
class OnewheelKarma < Handler
|
@@ -49,7 +51,7 @@ module Lita
|
|
49
51
|
if karma >= 0
|
50
52
|
"#{karma_object} has #{karma} karma!"
|
51
53
|
else
|
52
|
-
"#{karma_object} has
|
54
|
+
"#{karma_object} has #{RomanNumerals.to_roman(karma * -1)}💩 karma!"
|
53
55
|
end
|
54
56
|
end
|
55
57
|
|
data/lita-onewheel-karma.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-karma'
|
3
|
-
spec.version = '0.0.
|
3
|
+
spec.version = '0.0.1'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = 'Karma with a maths-focused twist.'
|
@@ -15,6 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.require_paths = ['lib']
|
16
16
|
|
17
17
|
spec.add_runtime_dependency 'lita', '~> 4.4'
|
18
|
+
spec.add_runtime_dependency 'roman-numerals', '~> 0.3'
|
18
19
|
|
19
20
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
20
21
|
# spec.add_development_dependency 'pry-byebug' # I go inline.
|
@@ -1,22 +1,28 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Lita::Handlers::OnewheelKarma, lita_handler: true do
|
4
|
-
|
4
|
+
def get_negative(num)
|
5
|
+
"a has #{RomanNumerals.to_roman(num)}💩 karma!"
|
6
|
+
end
|
7
|
+
|
8
|
+
def get_positive(num)
|
9
|
+
"a has #{num} karma!"
|
10
|
+
end
|
5
11
|
|
6
12
|
it 'will add one karma' do
|
7
13
|
send_message 'a++'
|
8
|
-
expect(replies.last).to eq
|
14
|
+
expect(replies.last).to eq get_positive(1)
|
9
15
|
end
|
10
16
|
|
11
17
|
it 'will add two karma' do
|
12
18
|
send_message 'a++'
|
13
19
|
send_message 'a++'
|
14
|
-
expect(replies.last).to eq
|
20
|
+
expect(replies.last).to eq get_positive(2)
|
15
21
|
end
|
16
22
|
|
17
23
|
it 'will remove one karma' do
|
18
24
|
send_message 'a--'
|
19
|
-
expect(replies.last).to eq
|
25
|
+
expect(replies.last).to eq get_negative(1)
|
20
26
|
end
|
21
27
|
|
22
28
|
it 'will remove lotsa karma' do
|
@@ -26,13 +32,13 @@ describe Lita::Handlers::OnewheelKarma, lita_handler: true do
|
|
26
32
|
send_message 'a--'
|
27
33
|
send_message 'a--'
|
28
34
|
send_message 'a--'
|
29
|
-
expect(replies.last).to eq
|
35
|
+
expect(replies.last).to eq get_negative(6)
|
30
36
|
end
|
31
37
|
|
32
38
|
it 'will multiply one karma' do
|
33
39
|
send_message 'a++'
|
34
40
|
send_message 'a*=2'
|
35
|
-
expect(replies.last).to eq
|
41
|
+
expect(replies.last).to eq get_positive(2)
|
36
42
|
end
|
37
43
|
|
38
44
|
it 'will multiply many karma' do
|
@@ -42,7 +48,7 @@ describe Lita::Handlers::OnewheelKarma, lita_handler: true do
|
|
42
48
|
send_message 'a++'
|
43
49
|
send_message 'a++'
|
44
50
|
send_message 'a*=5'
|
45
|
-
expect(replies.last).to eq
|
51
|
+
expect(replies.last).to eq get_positive(25)
|
46
52
|
end
|
47
53
|
|
48
54
|
it 'will multiply many negative karma' do
|
@@ -53,47 +59,47 @@ describe Lita::Handlers::OnewheelKarma, lita_handler: true do
|
|
53
59
|
send_message 'a--'
|
54
60
|
send_message 'a*=5'
|
55
61
|
# -25
|
56
|
-
expect(replies.last).to eq
|
62
|
+
expect(replies.last).to eq get_negative(25)
|
57
63
|
end
|
58
64
|
|
59
65
|
it 'will add arbitrary karma' do
|
60
66
|
send_message 'a+=9'
|
61
|
-
expect(replies.last).to eq
|
67
|
+
expect(replies.last).to eq get_positive(9)
|
62
68
|
end
|
63
69
|
|
64
70
|
it 'will add negative arbitrary karma' do
|
65
71
|
send_message 'a+=-9'
|
66
|
-
expect(replies.last).to eq
|
72
|
+
expect(replies.last).to eq get_negative(9)
|
67
73
|
end
|
68
74
|
|
69
75
|
it 'will subtract arbitrary karma' do
|
70
76
|
send_message 'a-=9'
|
71
|
-
expect(replies.last).to eq
|
77
|
+
expect(replies.last).to eq get_negative(9)
|
72
78
|
end
|
73
79
|
|
74
80
|
it 'will subtract negative arbitrary karma' do
|
75
81
|
send_message 'a-=-9'
|
76
|
-
expect(replies.last).to eq
|
82
|
+
expect(replies.last).to eq get_positive(9)
|
77
83
|
end
|
78
84
|
|
79
85
|
it 'will spacing' do
|
80
86
|
send_message 'a -= -9'
|
81
|
-
expect(replies.last).to eq
|
87
|
+
expect(replies.last).to eq get_positive(9)
|
82
88
|
end
|
83
89
|
|
84
90
|
it 'will spacing 2' do
|
85
91
|
send_message 'a += -9'
|
86
|
-
expect(replies.last).to eq
|
92
|
+
expect(replies.last).to eq get_negative(9)
|
87
93
|
end
|
88
94
|
|
89
95
|
it 'will spacing 3' do
|
90
96
|
send_message 'a ++'
|
91
|
-
expect(replies.last).to eq
|
97
|
+
expect(replies.last).to eq get_positive(1)
|
92
98
|
end
|
93
99
|
|
94
100
|
it 'will spacing 4' do
|
95
101
|
send_message 'a --'
|
96
|
-
expect(replies.last).to eq
|
102
|
+
expect(replies.last).to eq get_negative(1)
|
97
103
|
end
|
98
104
|
|
99
105
|
it 'uri tests' do
|
@@ -108,11 +114,19 @@ describe Lita::Handlers::OnewheelKarma, lita_handler: true do
|
|
108
114
|
|
109
115
|
it 'midstream karmas' do
|
110
116
|
send_message 'I like big a++ and I cannot lie'
|
111
|
-
expect(replies.last).to eq
|
117
|
+
expect(replies.last).to eq get_positive(1)
|
112
118
|
end
|
113
119
|
|
114
120
|
it 'midstream karma--s' do
|
115
121
|
send_message 'I like big a-- and I cannot lie'
|
116
|
-
expect(replies.last).to eq
|
122
|
+
expect(replies.last).to eq get_negative(1)
|
123
|
+
end
|
124
|
+
|
125
|
+
it 'roman numerals' do
|
126
|
+
send_message 'a--'
|
127
|
+
send_message 'a--'
|
128
|
+
send_message 'a--'
|
129
|
+
send_message 'a--'
|
130
|
+
expect(replies.last).to include 'a has IV'
|
117
131
|
end
|
118
132
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-karma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: roman-numerals
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.3'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|