confluence-client 0.0.3 → 0.0.4
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.
- data/HISTORY +5 -0
- data/README.rdoc +22 -0
- data/lib/confluence-client.rb +54 -0
- data/lib/confluence-client/version.rb +1 -1
- metadata +4 -4
data/HISTORY
CHANGED
data/README.rdoc
CHANGED
@@ -12,6 +12,9 @@
|
|
12
12
|
# Print error message if error on last API call.
|
13
13
|
puts confluence.error if confluence.error?
|
14
14
|
|
15
|
+
##########
|
16
|
+
# Spaces #
|
17
|
+
##########
|
15
18
|
space = confluence.get_space('foo')
|
16
19
|
if space
|
17
20
|
puts "found space: #{space.inspect}"
|
@@ -30,6 +33,9 @@
|
|
30
33
|
puts "unable to remove space: #{c.error}"
|
31
34
|
end
|
32
35
|
|
36
|
+
#########
|
37
|
+
# Users #
|
38
|
+
#########
|
33
39
|
user = confluence.get_user('stan')
|
34
40
|
if user
|
35
41
|
puts "found user: #{user.inspect}"
|
@@ -43,6 +49,22 @@
|
|
43
49
|
puts "unable to remove user: #{c.error}"
|
44
50
|
end
|
45
51
|
|
52
|
+
#########
|
53
|
+
# Users #
|
54
|
+
#########
|
55
|
+
group = confluence.get_group('some:group')
|
56
|
+
if group
|
57
|
+
puts "found group: #{group.inspect}"
|
58
|
+
else
|
59
|
+
group = confluence.add_group('some:group')
|
60
|
+
end
|
61
|
+
|
62
|
+
if confluence.remove_group('some:group')
|
63
|
+
puts 'removed group'
|
64
|
+
else
|
65
|
+
puts "unable to remove group: #{c.error}"
|
66
|
+
end
|
67
|
+
|
46
68
|
confluence.logout
|
47
69
|
end
|
48
70
|
|
data/lib/confluence-client.rb
CHANGED
@@ -15,6 +15,9 @@ module Confluence # :nodoc:
|
|
15
15
|
# # Print error message if error on last API call.
|
16
16
|
# puts confluence.error if confluence.error?
|
17
17
|
#
|
18
|
+
# ##########
|
19
|
+
# # Spaces #
|
20
|
+
# ##########
|
18
21
|
# space = confluence.get_space('foo')
|
19
22
|
# if space
|
20
23
|
# puts "found space: #{space.inspect}"
|
@@ -33,6 +36,9 @@ module Confluence # :nodoc:
|
|
33
36
|
# puts "unable to remove space: #{c.error}"
|
34
37
|
# end
|
35
38
|
#
|
39
|
+
# #########
|
40
|
+
# # Users #
|
41
|
+
# #########
|
36
42
|
# user = confluence.get_user('stan')
|
37
43
|
# if user
|
38
44
|
# puts "found user: #{user.inspect}"
|
@@ -46,6 +52,22 @@ module Confluence # :nodoc:
|
|
46
52
|
# puts "unable to remove user: #{c.error}"
|
47
53
|
# end
|
48
54
|
#
|
55
|
+
# #########
|
56
|
+
# # Users #
|
57
|
+
# #########
|
58
|
+
# group = confluence.get_group('some:group')
|
59
|
+
# if group
|
60
|
+
# puts "found group: #{group.inspect}"
|
61
|
+
# else
|
62
|
+
# group = confluence.add_group('some:group')
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# if confluence.remove_group('some:group')
|
66
|
+
# puts 'removed group'
|
67
|
+
# else
|
68
|
+
# puts "unable to remove group: #{c.error}"
|
69
|
+
# end
|
70
|
+
#
|
49
71
|
# confluence.logout
|
50
72
|
# end
|
51
73
|
#
|
@@ -76,6 +98,16 @@ module Confluence # :nodoc:
|
|
76
98
|
yield self if block_given?
|
77
99
|
end
|
78
100
|
|
101
|
+
# Create Confluence group. Returns group hash or nil.
|
102
|
+
#
|
103
|
+
# Params:
|
104
|
+
# +name+:: Group name.
|
105
|
+
def add_group(name)
|
106
|
+
addGroup(name)
|
107
|
+
return { 'name' => name } if ok?
|
108
|
+
return nil
|
109
|
+
end
|
110
|
+
|
79
111
|
# Create Confluence space. Return space hash or nil.
|
80
112
|
#
|
81
113
|
# Params:
|
@@ -106,6 +138,19 @@ module Confluence # :nodoc:
|
|
106
138
|
!ok?
|
107
139
|
end
|
108
140
|
|
141
|
+
# Return Confluence group hash or nil.
|
142
|
+
#
|
143
|
+
# Params:
|
144
|
+
# +name+:: Group name.
|
145
|
+
def get_group(name)
|
146
|
+
groups = getGroups
|
147
|
+
if ok?
|
148
|
+
return { 'name' => name } if groups.include?(name)
|
149
|
+
@error = 'group not found'
|
150
|
+
end
|
151
|
+
nil
|
152
|
+
end
|
153
|
+
|
109
154
|
# Return Confluence space hash or nil.
|
110
155
|
#
|
111
156
|
# Params:
|
@@ -162,6 +207,15 @@ module Confluence # :nodoc:
|
|
162
207
|
@error.nil?
|
163
208
|
end
|
164
209
|
|
210
|
+
# Remove Confluence group. Returns boolean.
|
211
|
+
#
|
212
|
+
# Params:
|
213
|
+
# +name+:: Remove group with this name.
|
214
|
+
# +default_group+:: If specified, members of +name+ will be added to this group. Defaults to +''+.
|
215
|
+
def remove_group(name, default_group='')
|
216
|
+
return removeGroup( name, default_group )
|
217
|
+
end
|
218
|
+
|
165
219
|
# Remove Confluence space. Returns boolean.
|
166
220
|
#
|
167
221
|
# Params:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: confluence-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-04-
|
12
|
+
date: 2011-04-06 00:00:00.000000000 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
17
|
-
requirement: &
|
17
|
+
requirement: &2156138740 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: 2.5.0
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2156138740
|
26
26
|
description: Ruby client for the Confluence XML::RPC API
|
27
27
|
email:
|
28
28
|
- blair.christensen@gmail.com
|