confluency 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/confluency.rb +2 -1
- data/lib/confluency/client.rb +42 -0
- data/lib/confluency/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 444cfa9ddc22dad9846b18a8a11934660fb7b8cc
|
4
|
+
data.tar.gz: ccd867e077f4dcdaf305d1b08b669df70d2ad2d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 077e0126d817d39b7c7cad63a3c331b05529a0a4943fd67407566214cabe9c11e4ddfe9cb9885aede37c4292c151d754797ad83490fa0cd7e0c65c1d0b3611c3
|
7
|
+
data.tar.gz: d00c5ec231227974168aee8ee49a2720a5911ae1daa964b6aac71c87ec7176584f6a0df314d4c99bea760cf10671e2fd182ed0d1b820a099031335e391f51378
|
data/lib/confluency.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'xmlrpc/client'
|
2
|
+
|
3
|
+
module Confluency
|
4
|
+
class Client
|
5
|
+
def initialize(url)
|
6
|
+
url += "/rpc/xmlrpc" unless url[-11//-1] == "/rpc/xmlrpc"
|
7
|
+
@url = url
|
8
|
+
server = XMLRPC::Client.new2(server_url)
|
9
|
+
@conf = server.proxy("confluence2")
|
10
|
+
@token = "12345"
|
11
|
+
end
|
12
|
+
|
13
|
+
def login(username, password)
|
14
|
+
@user = username
|
15
|
+
@pass = password
|
16
|
+
do_login()
|
17
|
+
end
|
18
|
+
|
19
|
+
def method_missing(method_name, *args)
|
20
|
+
begin
|
21
|
+
@conf.send(method_name, *([@token] + args))
|
22
|
+
rescue XMLRPC::FaultException => e
|
23
|
+
if (e.faultString.include?("InvalidSessionException"))
|
24
|
+
do_login
|
25
|
+
retry
|
26
|
+
else
|
27
|
+
raise e.faultString
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def do_login()
|
35
|
+
begin
|
36
|
+
@token = @conf.login(@user, @pass)
|
37
|
+
rescue XMLRPC::FaultException => e
|
38
|
+
raise e.faultString
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/confluency/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: confluency
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate West
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- Rakefile
|
53
53
|
- confluency.gemspec
|
54
54
|
- lib/confluency.rb
|
55
|
+
- lib/confluency/client.rb
|
55
56
|
- lib/confluency/version.rb
|
56
57
|
homepage: http://github.com/drumsrgr8forn8/confluency
|
57
58
|
licenses:
|