lita-queue 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/lita/handlers/queue.rb +13 -13
- data/lita-queue.gemspec +1 -1
- data/locales/en.yml +11 -0
- data/templates/display_queue_for_room.erb +1 -0
- data/templates/display_queue_for_room.slack.erb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 931bdd87aaf128a17aca1095851b3449c14576c3
|
4
|
+
data.tar.gz: 2dcc3421a2d9517438b21f1344e567cc7778215f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01923cc1c1581222e261b586b19b72aaa4ac5e126c6d4f3b5aecb381f1be23d5929fa75a0901cd7dac409e4ff6eb52b43b514053226a694b36c7ba6586fc7803
|
7
|
+
data.tar.gz: a4cf1380db88ce8ada0a2929d4b6f7f8eab9351b173343dbf530eadce193fb23c08d3f1cd201ada18cc1a26d046026d8ddb264d98b840a3c3c5ef8873454cf8c
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
5
5
|
We follow [Keep a Changelog](http://keepachangelog.com/) format.
|
6
6
|
|
7
|
+
## 0.4.0 - 2015-08-21
|
8
|
+
### Added
|
9
|
+
- I18n support
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
- Fixed channel name on slack, which was incorrectly displaying ID
|
13
|
+
|
7
14
|
## 0.3.0 - 2015-07-19
|
8
15
|
### Modified
|
9
16
|
- Correctly using Lita::Room object
|
data/lib/lita/handlers/queue.rb
CHANGED
@@ -43,11 +43,11 @@ module Lita
|
|
43
43
|
me = response.user.mention_name
|
44
44
|
|
45
45
|
if queue.include? me
|
46
|
-
response.reply
|
46
|
+
response.reply t('messages.already_on_queue')
|
47
47
|
else
|
48
48
|
queue << me
|
49
49
|
store_queue(room, queue)
|
50
|
-
response.reply
|
50
|
+
response.reply t('messages.added_to_queue', mention: me)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -59,9 +59,9 @@ module Lita
|
|
59
59
|
if queue.include? me
|
60
60
|
queue.delete(me)
|
61
61
|
store_queue(room, queue)
|
62
|
-
response.reply
|
62
|
+
response.reply t('messages.removed_from_queue', mention: me)
|
63
63
|
else
|
64
|
-
response.reply
|
64
|
+
response.reply t('messages.not_on_queue')
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -70,11 +70,11 @@ module Lita
|
|
70
70
|
queue = fetch_queue(room)
|
71
71
|
|
72
72
|
if queue.empty?
|
73
|
-
response.reply
|
73
|
+
response.reply t('messages.queue_is_empty')
|
74
74
|
elsif queue.size == 1
|
75
|
-
response.reply
|
75
|
+
response.reply t('messages.is_the_last_on_queue', mention: queue.first)
|
76
76
|
else
|
77
|
-
response.reply
|
77
|
+
response.reply t('messages.is_the_next_on_queue', mention: queue[1])
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -85,8 +85,8 @@ module Lita
|
|
85
85
|
unless queue.empty?
|
86
86
|
removed = queue.shift
|
87
87
|
store_queue(room, queue)
|
88
|
-
response.reply
|
89
|
-
response.reply
|
88
|
+
response.reply t('messages.removed_from_queue', mention: removed)
|
89
|
+
response.reply t('messages.is_the_next_on_queue_motivate', mention: queue.first) unless queue.empty?
|
90
90
|
end
|
91
91
|
|
92
92
|
response.reply display_queue(queue, room)
|
@@ -99,8 +99,8 @@ module Lita
|
|
99
99
|
unless queue.empty?
|
100
100
|
new_queue = queue.rotate
|
101
101
|
store_queue(room, new_queue)
|
102
|
-
response.reply
|
103
|
-
response.reply
|
102
|
+
response.reply t('messages.moved_to_the_end_of_queue', mention: queue.first)
|
103
|
+
response.reply t('messages.is_the_next_on_queue_motivate', mention: new_queue.first)
|
104
104
|
end
|
105
105
|
|
106
106
|
response.reply display_queue(queue, room)
|
@@ -116,9 +116,9 @@ module Lita
|
|
116
116
|
log.debug "displaying info for queue: #{queue.inspect} at #{room.inspect}"
|
117
117
|
|
118
118
|
if queue.empty?
|
119
|
-
|
119
|
+
t('messages.queue_is_empty')
|
120
120
|
else
|
121
|
-
|
121
|
+
render_template('display_queue_for_room', room: room, queue: queue)
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
data/lita-queue.gemspec
CHANGED
data/locales/en.yml
CHANGED
@@ -2,3 +2,14 @@ en:
|
|
2
2
|
lita:
|
3
3
|
handlers:
|
4
4
|
queue:
|
5
|
+
messages:
|
6
|
+
added_to_queue: '%{mention} have been added to queue.'
|
7
|
+
already_on_queue: 'You are already on queue!'
|
8
|
+
is_the_last_on_queue: '%{mention} is the last one on queue.'
|
9
|
+
is_the_next_on_queue: '%{mention} will be the next!'
|
10
|
+
is_the_next_on_queue_motivate: '%{mention} is the next. Go ahead!'
|
11
|
+
list_queue_for_room: 'Queue for %{room}: %{queue}'
|
12
|
+
moved_to_the_end_of_queue: '%{mention} has been moved to the end of the queue.'
|
13
|
+
not_on_queue: 'You are not on queue!'
|
14
|
+
queue_is_empty: 'Queue is empty!'
|
15
|
+
removed_from_queue: '%{mention} have been removed from queue.'
|
@@ -0,0 +1 @@
|
|
1
|
+
Queue for <%= @room.name %>: <%= @queue %>
|
@@ -0,0 +1 @@
|
|
1
|
+
Queue for <%= "<##{@room.id}>" %>: <%= @queue %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Mazetto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -144,6 +144,8 @@ files:
|
|
144
144
|
- spec/lita/handlers/queue_spec.rb
|
145
145
|
- spec/spec_helper.rb
|
146
146
|
- templates/.gitkeep
|
147
|
+
- templates/display_queue_for_room.erb
|
148
|
+
- templates/display_queue_for_room.slack.erb
|
147
149
|
homepage: https://github.com/brodock/lita-queue
|
148
150
|
licenses:
|
149
151
|
- MIT
|