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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 401490d5fdc8aa818f937bc9d1e47f82e53626ad
4
- data.tar.gz: bc865809d9e882f27380ecfc1c0c742975f045e2
3
+ metadata.gz: 6bd1e0ac44d9d04aa609d980b1b0130bdea37bb0
4
+ data.tar.gz: 082d74f92dccac328f289508f75d957c72687af3
5
5
  SHA512:
6
- metadata.gz: dccb9e91402f3f0953c33a2f7200f0997cdd9a3b04c07fe167944d625312649a58c36249da5dfd1fcd2a1fa4f9c1d6decc31bb1efe5dbf4612fd44ccbb39cad4
7
- data.tar.gz: b82452f44932d45a322e177238735ee13fd4f65119f7bab85e9c75d881c17db73f52d8311bd32cfaa303e5de51aaca99ef0f3867c0d7f00d08cc404f0d5dca1d
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).
@@ -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?
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Todo
3
- VERSION = '0.1.1'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-todo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SHIOYA, Hiromu