Skip to content

Commit

Permalink
[modify] README.md, kpt action
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryota Konno committed May 24, 2017
1 parent a9ad612 commit b04453b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Ruboty::Yurue

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ruboty/yurue`. To experiment with that code, run `bin/console` for an interactive prompt.

TODO: Delete this and the text above, and describe your gem
This bot will determine the order of kpt. For the moment, that's it.

## Installation

Expand All @@ -22,7 +20,7 @@ Or install it yourself as:

## Usage

TODO: Write usage instructions here
`@[bot_name] kpt @hanako @takeshi @taro` ... Just this. Shuffle appropriately and return it.

## Development

Expand Down
File renamed without changes.
12 changes: 8 additions & 4 deletions lib/ruboty/kpt/actions/kpt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ def call
private

def kpt
message = 'この順番でKPTしよう!\n'

# 渡されたidをシャッフルする
begin
ids = message[:ids]
ids = message[:ids].split
ids.shuffle!
rescue => e
'ERROR: ' + e
end

# シャッフル済みのIDをメッセージとともに返す
ids.join(' ')
reply = "この順番でKPTしよう!\n"

ids.each_with_index do |id, i|
reply << "#{i+1}回目: #{id}\n"
end

reply
end
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/ruboty/yurue.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "ruboty/yurue/version"
require "ruboty/handlers/kpt"

module Ruboty
module Yurue
Expand Down

0 comments on commit b04453b

Please sign in to comment.