ruboty-scorekeeper 0.0.2 → 0.0.3

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: f924ad6fae82cb81963f3e757b0e279fd8e14939
4
- data.tar.gz: ece173f871a20ee56f35890da47ebd569229b542
3
+ metadata.gz: baaef5ae9ba7cf0dd41bd1ad4d6f6e5928e17784
4
+ data.tar.gz: 03a8ce50f98b5ddd8b837eabe73e2485e89e8cee
5
5
  SHA512:
6
- metadata.gz: 8d462b03cb3789270565daea475aaeacdfb766883930adb8d0224461224d71b0ba3923095b2732e7f9e3c41e89b02eb00c134be6bfa25c18488e9b945840e291
7
- data.tar.gz: 36226c9a0c375ff784a3c7d03b02967869c7a747214d8c8b199b2b8a1cd965a1850b19574bc6cb10e7246806c95cf8e22c3ebde2e53caac1cbec99608537ab15
6
+ metadata.gz: 5a16a79bd53bf757cb114bdfcc5c98dacd9026a535140d163babedf9889f68292010d028a19dabe4cb0f76e623cb90ec5eb1b61346e7c13ad62e19cfaae9ba8f
7
+ data.tar.gz: 65f164db0a8d55306d8958748741001a79bd642a199c17b288a8b25ce531f8defdba699d4555e83a555af78f3b4341958db5cd314c3e3c47aabb0a4f11ccdee4
data/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  ruboty handler.
4
4
  increment decrement scorekeeper
5
5
 
6
+ ![](https://www.evernote.com/shard/s4/sh/735a955e-0b8f-4b92-b5fa-fc37e0aa1d50/373f7227962198cfdbf0f2721813d3e5/deep/0/Slack.png)
7
+
6
8
  ```
7
9
  > r7kamura++
8
10
  incremented r7kamura (1 pt)
@@ -27,6 +29,7 @@ decremented yoshiori (-1 pt)
27
29
  * show scoreboard - Show scoreboard
28
30
  * scorekeeper {name} - Show current point of {name}
29
31
  * what's the score of {name} - Show current point of {name}
32
+ * scorekeeper delete {name} - Delete a point of {name}
30
33
 
31
34
  ## Contributing
32
35
 
@@ -22,6 +22,12 @@ module Ruboty
22
22
  on( /scorekeeper (?<name>.+)$|what(?:'s| is)(?: the)? score of (?<name>.+)\??$/i,
23
23
  name: "score",
24
24
  description: "Show current point of <name>",
25
+ missing: true
26
+ )
27
+
28
+ on( /scorekeeper delete (?<name>.+)/i,
29
+ name: "delete",
30
+ description: "Delete a point of <name>",
25
31
  )
26
32
  private
27
33
 
@@ -55,6 +61,15 @@ module Ruboty
55
61
  )
56
62
  end
57
63
 
64
+ def delete(message)
65
+ name = normalize_name(message[:name])
66
+ if scores.delete(name)
67
+ message.reply("deleted a point of #{name}")
68
+ else
69
+ message.reply("#{name} is not found")
70
+ end
71
+ end
72
+
58
73
  def scores
59
74
  robot.brain.data[NAMESPACE] ||= {}
60
75
  end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Scorekeeper
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-scorekeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshiori SHOJI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-10 00:00:00.000000000 Z
11
+ date: 2015-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.2.2
91
+ rubygems_version: 2.4.5
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: ruboty handler. increment decrement scorekeeper