you_track 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/you_track/client/requests/apply_issue_command.rb +18 -2
- data/lib/you_track/version.rb +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: fb508f765c63379fa92d71225d020409e27880a1
|
|
4
|
+
data.tar.gz: acd0ac2005f571727435031975af75e66bf5595b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ae9c7c0e97112d80d0a27d5a84d04aa17ab0da9425adc06a47e8c5efb43f68e54b800539664058278e52c243baff3d785a0862f61f5483b91b174516893caa7b
|
|
7
|
+
data.tar.gz: 4149e84c106b152dc9c606f3c2560da2826b728aa0d86e3a79ee9d618d352c1b886581c1229014596ce30a9bd28025263cf4dd338407d373d7f45a9c815a7e67
|
|
@@ -29,8 +29,24 @@ class YouTrack::Client::ApplyIssueCommand < YouTrack::Client::Request
|
|
|
29
29
|
}
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
if params["command"]
|
|
33
|
-
|
|
32
|
+
if command = params["command"]
|
|
33
|
+
words = command.scan(/[^\s]+/) # ["State", "In", "Progress", "Assignee", "jlane"]
|
|
34
|
+
acceptable_commands = find(:project_custom_fields, issue["projectShortName"]).map { |cf| cf["name"] }
|
|
35
|
+
|
|
36
|
+
command_map = Hash.new { |h,k| h[k] = [] }
|
|
37
|
+
|
|
38
|
+
current_command = words.shift
|
|
39
|
+
words.each do |word|
|
|
40
|
+
unless acceptable_commands.include?(word)
|
|
41
|
+
command_map[current_command] << word
|
|
42
|
+
else
|
|
43
|
+
# @todo validate command on closer
|
|
44
|
+
current_command = word
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
commands = command_map.inject({}) { |r,(k,v)| r.merge(k => v.join(" ")) }
|
|
49
|
+
|
|
34
50
|
commands.each do |field, value|
|
|
35
51
|
prototype = service.data[:custom_fields].fetch(field)
|
|
36
52
|
|
data/lib/you_track/version.rb
CHANGED