confluence-rest-api 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -0
- data/confluence-rest-api.gemspec +2 -2
- data/lib/confluence.rb +4 -4
- data/lib/storage_format.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6470ce4a3916a34479ddbd6d9b8e880ebd81c880f9fb469418b8c231da8016be
|
4
|
+
data.tar.gz: a2d2d4d82cd187ff1ae6e748b2031fdab215555c9593adecc2ef75fdbab437ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5d3f5be7749537bd8c750535257ca1082722eb0ebead4336da7188845f34a1e961a80d9d0794f3faae306b128639055620937800c5a751cd25c8ff40574d8b3
|
7
|
+
data.tar.gz: a38c201489ec9839a16b3571db9b0636702dbe2abd9b258dfff9450e0df08fdaada08dcd0f86dc4902edae5d2d62f9f118eddcff9fb0b0c21d35f743c33359db
|
data/README.md
CHANGED
@@ -63,6 +63,30 @@ unless home_page.id.nil?
|
|
63
63
|
client.create_page_with_parent('My Page Title', space_key, 'My Page Body Content', home_page.id)
|
64
64
|
end
|
65
65
|
|
66
|
+
###########################################################
|
67
|
+
# Update a page with a new title and keep the same parent
|
68
|
+
###########################################################
|
69
|
+
page_obj = PageObject.new('My Page Title', space_key)
|
70
|
+
title = 'My New Page Title'
|
71
|
+
# Storage Format for the page can also be modified here if needed.
|
72
|
+
content = page_obj.storage_format
|
73
|
+
unless page_obj.id.nil?
|
74
|
+
client.update_page_with_no_parent(page_obj, title, space_key, content)
|
75
|
+
end
|
76
|
+
|
77
|
+
################################################
|
78
|
+
# Update a page with a new title and new parent
|
79
|
+
################################################
|
80
|
+
page_obj = PageObject.new('My Page Title', space_key)
|
81
|
+
parent_obj = PageObject.new('My New Parent', space_key)
|
82
|
+
title = 'My New Page Title'
|
83
|
+
# Storage Format for the page can also be modified here if needed.
|
84
|
+
content = page_obj.storage_format
|
85
|
+
unless page_obj.id.nil? || parent_obj.id.nil?
|
86
|
+
client.update_page_with_parent(page_obj, title, parent_obj, space_key, content)
|
87
|
+
end
|
88
|
+
|
89
|
+
|
66
90
|
#############################
|
67
91
|
# Add an attachment to a page
|
68
92
|
#############################
|
data/confluence-rest-api.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{confluence-rest-api}
|
3
|
-
s.version = "1.0.
|
4
|
-
s.date = %q{2020-
|
3
|
+
s.version = "1.0.8"
|
4
|
+
s.date = %q{2020-05-22}
|
5
5
|
s.summary = %q{Ruby REST API Client to create, update, and view pages}
|
6
6
|
s.authors = "Gregory J. Miller"
|
7
7
|
s.files = [
|
data/lib/confluence.rb
CHANGED
@@ -22,14 +22,14 @@ class ConfluenceClient
|
|
22
22
|
|
23
23
|
end
|
24
24
|
|
25
|
-
def update_page_with_parent(page_obj, parent_page_obj, spacekey, content)
|
25
|
+
def update_page_with_parent(page_obj, title, parent_page_obj, spacekey, content)
|
26
26
|
|
27
27
|
version = page_obj.version + 1
|
28
28
|
|
29
29
|
page_meta = { type: 'update_page_with_parent',
|
30
30
|
pageid: page_obj.id,
|
31
31
|
parentid: parent_page_obj.id,
|
32
|
-
title:
|
32
|
+
title: title,
|
33
33
|
spacekey: spacekey,
|
34
34
|
content: content,
|
35
35
|
version: version }
|
@@ -49,13 +49,13 @@ class ConfluenceClient
|
|
49
49
|
|
50
50
|
end
|
51
51
|
|
52
|
-
def update_page_with_no_parent(page_obj, spacekey, content)
|
52
|
+
def update_page_with_no_parent(page_obj, title, spacekey, content)
|
53
53
|
|
54
54
|
version = page_obj.version + 1
|
55
55
|
|
56
56
|
page_meta = { type: 'update_page_with_no_parent',
|
57
57
|
pageid: page_obj.id,
|
58
|
-
title:
|
58
|
+
title: title,
|
59
59
|
spacekey: spacekey,
|
60
60
|
content: content,
|
61
61
|
version: version }
|
data/lib/storage_format.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: confluence-rest-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregory J. Miller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|