lita-rally 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -2
- data/lib/lita/handlers/rally.rb +16 -22
- data/lita-rally.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bbc5ed8578ec25616f170a8e30daf1815f00c84
|
4
|
+
data.tar.gz: 49ff71920b01d7055f5cc6446a91877b99f8667f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e949763e95fd0f4309532b3b2ff78f3e30bf00be4c3638bfc7a0be72b60b00874e8a1caa64cb461568e2e98236f11d593a9b1c48337d7374f9832cebadcdc102
|
7
|
+
data.tar.gz: cb64a2c961a67104bf1d3e8e194ed9664e26163df98d7584c54efc9c8b3f043f90a79c7d255d9912ef4af08402cccd22c5b98de00e7d867739edfa3cbcee5688
|
data/README.md
CHANGED
@@ -23,8 +23,36 @@ gem "lita-rally"
|
|
23
23
|
|
24
24
|
**Optional:**
|
25
25
|
|
26
|
-
```config.handlers.rally.api_version``` - API version
|
27
|
-
|
26
|
+
```config.handlers.rally.api_version``` - API version. **Default:** 'v2.0'
|
27
|
+
|
28
|
+
```config.handlers.rally.read_only``` - [true/false] disable commands
|
29
|
+
that modifies objects. **Default:** false
|
30
|
+
|
31
|
+
```config.handlers.rally.action_state_map``` - [Hash] a map of actions to the
|
32
|
+
corresponding states of the artifact. **Default:**
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
{
|
36
|
+
'start' => 'Submitted',
|
37
|
+
'pause' => 'Submitted',
|
38
|
+
'backlog' => 'Submitted',
|
39
|
+
'finished' => 'Fixed',
|
40
|
+
'accept' => 'Closed',
|
41
|
+
}
|
42
|
+
```
|
43
|
+
|
44
|
+
```config.handlers.rally.action_schedule_state_map``` - [Hash] a map of actions
|
45
|
+
to the corresponding schedule states of the artifact. **Default:**
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
{
|
49
|
+
'start' => 'In-Progress',
|
50
|
+
'pause' => 'Defined',
|
51
|
+
'finish' => 'Completed',
|
52
|
+
'accept' => 'Accepted',
|
53
|
+
'backlog' => 'Backlog',
|
54
|
+
}
|
55
|
+
```
|
28
56
|
|
29
57
|
|
30
58
|
## Usage
|
data/lib/lita/handlers/rally.rb
CHANGED
@@ -79,6 +79,20 @@ module Lita
|
|
79
79
|
config :password, type: String, required: true
|
80
80
|
config :api_version, type: String, default: 'v2.0'
|
81
81
|
config :read_only, type: Object, default: false
|
82
|
+
config :action_state_map, type: Hash, default: {
|
83
|
+
'start' => 'Submitted',
|
84
|
+
'pause' => 'Submitted',
|
85
|
+
'backlog' => 'Submitted',
|
86
|
+
'finished' => 'Fixed',
|
87
|
+
'accept' => 'Closed',
|
88
|
+
}
|
89
|
+
config :action_schedule_state_map, type: Hash, default: {
|
90
|
+
'start' => 'In-Progress',
|
91
|
+
'pause' => 'Defined',
|
92
|
+
'finish' => 'Completed',
|
93
|
+
'accept' => 'Accepted',
|
94
|
+
'backlog' => 'Backlog',
|
95
|
+
}
|
82
96
|
|
83
97
|
route(/^rally me ([[:alpha:]]+)(\d+)/, :rally_show, command: true, help: {
|
84
98
|
'rally me <identifier>' => 'Show me that rally object'
|
@@ -174,29 +188,9 @@ module Lita
|
|
174
188
|
type = response.matches[0][1].downcase
|
175
189
|
id = response.matches[0][2]
|
176
190
|
|
177
|
-
schedule_state =
|
178
|
-
case action
|
179
|
-
when 'start'
|
180
|
-
'In-Progress'
|
181
|
-
when 'pause'
|
182
|
-
'Defined'
|
183
|
-
when 'finish'
|
184
|
-
'Completed'
|
185
|
-
when 'accept'
|
186
|
-
'Accepted'
|
187
|
-
when 'backlog'
|
188
|
-
'Backlog'
|
189
|
-
end
|
191
|
+
schedule_state = config.action_schedule_state_map[action]
|
190
192
|
|
191
|
-
state =
|
192
|
-
case action
|
193
|
-
when 'start','pause','backlog'
|
194
|
-
'Open'
|
195
|
-
when 'finish'
|
196
|
-
'Fixed'
|
197
|
-
when 'accept'
|
198
|
-
'Closed'
|
199
|
-
end
|
193
|
+
state = config.action_state_map[action]
|
200
194
|
|
201
195
|
response.reply(update_object(type, id, 'ScheduleState', schedule_state))
|
202
196
|
|
data/lita-rally.gemspec
CHANGED