ruboty-todo 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/lib/ruboty/actions/todo.rb +7 -0
- data/lib/ruboty/todo/version.rb +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: 6bd1e0ac44d9d04aa609d980b1b0130bdea37bb0
|
4
|
+
data.tar.gz: 082d74f92dccac328f289508f75d957c72687af3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c459d269a61f0e226b6be9bdb611d17f52d7f5e53d41a247bb6711d2cb36032ef2ef7704dcb8dd01d66f5d1225249c38808e5c80d7678d5a144d44fc59198bcf
|
7
|
+
data.tar.gz: 54ff9308ff09c711166550a87b5ddb284a983ab7db215c5fbeffacca8f91b56b02571be393f11ef99cacc79c95fed18a85bbde736deb3e4e5f4313aa0b725fe6
|
data/README.md
CHANGED
@@ -2,6 +2,21 @@
|
|
2
2
|
|
3
3
|
ruboty handler to manage your todo list
|
4
4
|
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
### Setup
|
8
|
+
|
9
|
+
set environment variables `ENV['TODO_OWNERS']` to check message from owners
|
10
|
+
|
11
|
+
- join owner's name by comma like below:
|
12
|
+
- `owner_alice,owner_bob,owner_charlie`
|
13
|
+
- ignore to check
|
14
|
+
- `IGNORE_CHECK`
|
15
|
+
|
16
|
+
### Show Help
|
17
|
+
|
18
|
+
`ruboty todo help`
|
19
|
+
|
5
20
|
## License
|
6
21
|
|
7
22
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/ruboty/actions/todo.rb
CHANGED
@@ -5,6 +5,8 @@ module Ruboty
|
|
5
5
|
attr_reader :todo_list
|
6
6
|
|
7
7
|
def call
|
8
|
+
return unless from_owner?
|
9
|
+
|
8
10
|
(command, arg) = (message[:data] || '').split(/\s/, 2)
|
9
11
|
command = parse_command(command)
|
10
12
|
@todo_list = ::Ruboty::Todo::List.new(message.robot.brain)
|
@@ -68,6 +70,11 @@ EOH
|
|
68
70
|
|
69
71
|
private
|
70
72
|
|
73
|
+
def from_owner?
|
74
|
+
return true if ENV['TODO_OWNERS'] == 'IGNORE_CHECK'
|
75
|
+
ENV['TODO_OWNERS'].split(',').map(&:strip).include?(message.from_name)
|
76
|
+
end
|
77
|
+
|
71
78
|
def change_item_state(arg, status)
|
72
79
|
item = find_item(arg)
|
73
80
|
return "item #{arg} is not found" if item.nil?
|
data/lib/ruboty/todo/version.rb
CHANGED