mosespa 1.1.0 → 1.2.0
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/mosespa.rb +17 -6
- data/mosespa.gemspec +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dd5323938a623f4a172c72c1abb11ffdeb66e5d
|
4
|
+
data.tar.gz: 5dc78ede5463b4a86b981cd9f584d70891bca9a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12b70d35f7478ee2b2abf7375ff82cd8747ea675783ce2d6ca28d17079cf7a89d3de8cc01f65b1ec5f5c1ca5a218c9fe9a0d0f1993fe68419736420ee1971c04
|
7
|
+
data.tar.gz: fe835b345b691a89e1c1e6892dd2e3c4930828c2078ce761055c108277644dd5cc8be3968184aec8452804d2fe9cffdb03c3a647df251abd2ba81ce7ab1de0c6
|
data/lib/mosespa.rb
CHANGED
@@ -36,11 +36,13 @@ module Mosespa
|
|
36
36
|
file = Tempfile.new('mosespa')
|
37
37
|
need_external_editor = summary.nil?
|
38
38
|
if need_external_editor
|
39
|
-
summary, description = create_get_options(file, project, summary, description)
|
39
|
+
task_type, summary, description = create_get_options(file, project,'Task' ,summary, description)
|
40
|
+
$stderr.puts "Ticket type was: #{task_type}"
|
41
|
+
$stderr.puts "Summary was: #{summary}"
|
40
42
|
end
|
41
|
-
fail "Won't create a ticket without summary" if summary.nil?
|
43
|
+
fail "Won't create a ticket without summary" if summary.nil? or summary.empty?
|
42
44
|
t = client.Issue.build
|
43
|
-
request = {'summary' => summary, 'description' => description, 'project' => {'key' => project.key}, 'issuetype' => {'name'=> 'Task'} }
|
45
|
+
request = {'summary' => summary, 'description' => description, 'project' => {'key' => project.key}, 'issuetype' => {'name'=> task_type || 'Task'} }
|
44
46
|
begin
|
45
47
|
resp = t.save!({'fields' =>request})
|
46
48
|
rescue Exception => e
|
@@ -52,8 +54,8 @@ module Mosespa
|
|
52
54
|
file.unlink
|
53
55
|
end
|
54
56
|
|
55
|
-
def create_get_options(file, project, summary, description)
|
56
|
-
file.write(summary || "")
|
57
|
+
def create_get_options(file, project, task_type, summary, description)
|
58
|
+
file.write(summary || "Task:")
|
57
59
|
file.write("\n")
|
58
60
|
file.write("\n")
|
59
61
|
file.write(description ||"")
|
@@ -61,17 +63,26 @@ module Mosespa
|
|
61
63
|
file.write("# Here you can edit the ticket you want to create\n")
|
62
64
|
file.write("# Line starting with a # will be ignored\n")
|
63
65
|
file.write("# The format is the same as a git commit\n")
|
66
|
+
file.write("\n")
|
67
|
+
file.write("Summary line follows this template : [TaskType]: [Title]\n")
|
68
|
+
file.write("This means that if you write: Story: Create a prototype of SOA\n")
|
69
|
+
file.write("You'll get a new story about creating a SOA prototype")
|
70
|
+
file.write("The summary line is always followed by an empty line and may be followed by a description")
|
71
|
+
file.write("\n\n")
|
64
72
|
file.write("# /* vim: set filetype=gitcommit : */")
|
65
73
|
file.close #need to flush
|
66
74
|
file.open
|
67
75
|
system "$EDITOR #{file.path}"
|
68
76
|
all = file.read.lines.reject {|l| l.start_with? "#"}.map {|l| l.chop}
|
69
77
|
summary = all[0]
|
78
|
+
m = /^(?<task_type>\w+):(.*)/.match(summary)
|
79
|
+
task_type, summary = m.to_a.drop(1) if m
|
80
|
+
|
70
81
|
description = all.drop(2).join("\n")
|
71
82
|
puts "summary: #{summary}"
|
72
83
|
puts "description: #{description}"
|
73
84
|
file.close
|
74
|
-
[summary, description]
|
85
|
+
[task_type, summary, description]
|
75
86
|
end
|
76
87
|
end
|
77
88
|
|
data/mosespa.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mosespa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grégoire Seux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jira-ruby
|
@@ -92,4 +92,3 @@ signing_key:
|
|
92
92
|
specification_version: 4
|
93
93
|
summary: Play on command line with JIRA
|
94
94
|
test_files: []
|
95
|
-
has_rdoc:
|