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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff72b0fbfa6e11ab442f696236e705c0429846e7
4
- data.tar.gz: 363ebeef8d49d31c883ede14bae87e97e1061672
3
+ metadata.gz: 9bbc5ed8578ec25616f170a8e30daf1815f00c84
4
+ data.tar.gz: 49ff71920b01d7055f5cc6446a91877b99f8667f
5
5
  SHA512:
6
- metadata.gz: 0a56efa23c18ce9a1a850b6ab52ecd00858b1933dc47486cd8423be250690b7aed1d2c0a65a77cd1ee95176292f31e17ab2cbd7cd8162e483d5c1ffe878d073d
7
- data.tar.gz: a984803b293ed835caa19e1f6126bdff29bd5b755207a4accac6abc81d480d8689d54debed9bfd6224d893d3f2fd2f6ebdb1069f0c6ec5d9682da3de6d906e86
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, default 'v2.0'
27
- ```config.handlers.rally.read_only``` - disable commands that modifies objects
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
@@ -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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-rally'
3
- spec.version = '0.5.0'
3
+ spec.version = '0.5.1'
4
4
  spec.authors = ['Richard Li']
5
5
  spec.email = ['evilcat@wisewolfsolutions.com']
6
6
  spec.description = %q{Rally plugin for lita bot}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-rally
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Li