sappho-data-publisher 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,7 @@ module Sappho
|
|
14
14
|
|
15
15
|
def connect
|
16
16
|
super do |url|
|
17
|
-
XMLRPC::Client.new2("#{url}/rpc/xmlrpc").proxy('
|
17
|
+
XMLRPC::Client.new2("#{url}/rpc/xmlrpc").proxy('confluence2')
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -32,7 +32,7 @@ module Sappho
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def getScript rawPage
|
35
|
-
rawPage.scan(
|
35
|
+
rawPage.scan(/\<ac\:macro ac\:name=\"noformat\"\>.*?\<ac\:plain-text-body\>\<!\[CDATA\[(.*?)\]\]\>\<\/ac\:plain-text-body\>/m).each { |pageData| yield pageData[0] }
|
36
36
|
end
|
37
37
|
|
38
38
|
def publish content, pageData, parameters
|
@@ -18,10 +18,14 @@ module Sappho
|
|
18
18
|
end
|
19
19
|
@allCustomFields = @appServer.getCustomFields @token
|
20
20
|
@users = {}
|
21
|
+
@fetchSubTasks = true
|
21
22
|
end
|
22
23
|
|
23
24
|
def gatherData pageData, parameters
|
24
25
|
checkLoggedIn
|
26
|
+
if fetchSubTasks = parameters['fetchSubTasks']
|
27
|
+
@fetchSubTasks = fetchSubTasks == "yes"
|
28
|
+
end
|
25
29
|
# process a single issue fetch request
|
26
30
|
if key = parameters['key']
|
27
31
|
@logger.info "fetching Jira issue #{key}"
|
@@ -69,7 +73,7 @@ module Sappho
|
|
69
73
|
|
70
74
|
def processIssues pageData, issues
|
71
75
|
pageData['issues'] = cookedIssues = []
|
72
|
-
cookIssues issues, cookedIssues
|
76
|
+
cookIssues issues, cookedIssues, @fetchSubTasks
|
73
77
|
end
|
74
78
|
|
75
79
|
def jqlQuery jql, maxresults
|
@@ -77,7 +81,7 @@ module Sappho
|
|
77
81
|
@appServer.getIssuesFromJqlSearch @token, jql, maxresults
|
78
82
|
end
|
79
83
|
|
80
|
-
def cookIssues issues, cookedIssues
|
84
|
+
def cookIssues issues, cookedIssues, fetchSubTasks
|
81
85
|
issues.each { |issue|
|
82
86
|
cookedIssue = {}
|
83
87
|
['id', 'key', 'summary', 'description', 'assignee', 'created', 'duedate', 'priority',
|
@@ -95,8 +99,8 @@ module Sappho
|
|
95
99
|
customFieldValue['values']
|
96
100
|
}
|
97
101
|
cookedIssue['subtasks'] = cookedSubtasks = []
|
98
|
-
subtasks = jqlQuery
|
99
|
-
cookIssues subtasks, cookedSubtasks
|
102
|
+
subtasks = fetchSubTasks ? jqlQuery("parent=#{issue['key']}", 100) : []
|
103
|
+
cookIssues subtasks, cookedSubtasks, false
|
100
104
|
cookedIssues << cookedIssue
|
101
105
|
}
|
102
106
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
This is ignored.
|
2
2
|
So is this.
|
3
|
-
|
3
|
+
<ac:macro ac:name="noformat">
|
4
|
+
<ac:plain-text-body><![CDATA[
|
4
5
|
This is not ignored.
|
5
6
|
|
6
7
|
And the above blank line should be included.
|
@@ -10,32 +11,9 @@ And the above blank line should be included.
|
|
10
11
|
And the above blank lines, and below, should be included.
|
11
12
|
|
12
13
|
|
13
|
-
|
14
|
+
]]></ac:plain-text-body>
|
14
15
|
|
15
16
|
Try a one-liner.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
Try another one-liner.
|
20
|
-
{noformat}This one-liner is not ignored.{noformat} <- the trailing {noformat} will be included because it isn't at column 1.
|
21
|
-
{noformat}
|
22
|
-
|
23
|
-
This is ignored.
|
24
|
-
{noformat:nopanel=true}
|
25
|
-
This is not ignored, either.
|
26
|
-
{noformat} <- And this line should be included.
|
27
|
-
{noformat}
|
28
|
-
{noformat xx}
|
29
|
-
It does not matter about extra invalid stuff on the opening {noformat}.
|
30
|
-
{noformat}
|
31
|
-
|
32
|
-
Test for an invalid closing {noformat}.
|
33
|
-
{noformat}
|
34
|
-
Invalid closing: Line 1
|
35
|
-
{noformatx}
|
36
|
-
Invalid closing: Line 2
|
37
|
-
{noformat}
|
38
|
-
|
39
|
-
Finally, test what happens when a chunk is left open.
|
40
|
-
{noformat}
|
41
|
-
This will not end up in a chunk!
|
17
|
+
<ac:macro ac:name="noformat">
|
18
|
+
<ac:plain-text-body><![CDATA[This one-liner is not ignored.
|
19
|
+
]]></ac:plain-text-body>
|
@@ -9,13 +9,3 @@ And the above blank lines, and below, should be included.
|
|
9
9
|
|
10
10
|
|
11
11
|
----This one-liner is not ignored.
|
12
|
-
----This one-liner is not ignored.{noformat} <- the trailing {noformat} will be included because it isn't at column 1.
|
13
|
-
----
|
14
|
-
This is not ignored, either.
|
15
|
-
{noformat} <- And this line should be included.
|
16
|
-
----
|
17
|
-
It does not matter about extra invalid stuff on the opening {noformat}.
|
18
|
-
----
|
19
|
-
Invalid closing: Line 1
|
20
|
-
{noformatx}
|
21
|
-
Invalid closing: Line 2
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sappho-data-publisher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 5
|
10
|
+
version: 0.2.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Heald
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2013-09-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|