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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c68bea41fdca6b89d3d91c689a4a2f270204a01
4
- data.tar.gz: a46a13c18c6624f7190d9151341b0d95054b00b6
3
+ metadata.gz: 931bdd87aaf128a17aca1095851b3449c14576c3
4
+ data.tar.gz: 2dcc3421a2d9517438b21f1344e567cc7778215f
5
5
  SHA512:
6
- metadata.gz: 82cdd8f102c7d4fa791484b7a0cc8efca7686d3d8498cf1be886ba003d96d6db41ea13c2b45b985fe4039cb062b8b86342856442f746a27baa342164eece9b3f
7
- data.tar.gz: 3e84ef189225c3f501f1f95287b38e88f24b921395a5aa2f67cd2fabdae4def1047af8387fb35bbcde3bbfb983de6ba9509c32f7a52a9fc312fdc16e403fd0cd
6
+ metadata.gz: 01923cc1c1581222e261b586b19b72aaa4ac5e126c6d4f3b5aecb381f1be23d5929fa75a0901cd7dac409e4ff6eb52b43b514053226a694b36c7ba6586fc7803
7
+ data.tar.gz: a4cf1380db88ce8ada0a2929d4b6f7f8eab9351b173343dbf530eadce193fb23c08d3f1cd201ada18cc1a26d046026d8ddb264d98b840a3c3c5ef8873454cf8c
@@ -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
@@ -43,11 +43,11 @@ module Lita
43
43
  me = response.user.mention_name
44
44
 
45
45
  if queue.include? me
46
- response.reply "You are already on queue!"
46
+ response.reply t('messages.already_on_queue')
47
47
  else
48
48
  queue << me
49
49
  store_queue(room, queue)
50
- response.reply "#{me} have been added to queue."
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 "#{me} have been removed from queue."
62
+ response.reply t('messages.removed_from_queue', mention: me)
63
63
  else
64
- response.reply "You are not on queue!"
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 "Queue is empty"
73
+ response.reply t('messages.queue_is_empty')
74
74
  elsif queue.size == 1
75
- response.reply "#{queue.first} is the last one on queue."
75
+ response.reply t('messages.is_the_last_on_queue', mention: queue.first)
76
76
  else
77
- response.reply "#{queue[1]} will be the next!"
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 "#{removed} have been removed from queue."
89
- response.reply "#{queue.first} is the next. Go ahead!" unless queue.empty?
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 "#{queue.first} has been moved to the end of the queue."
103
- response.reply "#{new_queue.first} is the next. Go ahead!"
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
- "Queue is empty!"
119
+ t('messages.queue_is_empty')
120
120
  else
121
- "Queue for #{room.name}: #{queue}"
121
+ render_template('display_queue_for_room', room: room, queue: queue)
122
122
  end
123
123
  end
124
124
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-queue"
3
- spec.version = "0.3.0"
3
+ spec.version = "0.4.0"
4
4
  spec.authors = ["Gabriel Mazetto"]
5
5
  spec.email = ["brodock@gmail.com"]
6
6
  spec.description = "Lita plugin to manage channel specific queue"
@@ -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.3.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-14 00:00:00.000000000 Z
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