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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49e9ed5a135df571d4b34502642bc60098d7d3a8
4
- data.tar.gz: f276cd062bd39cbad61724b2ee52d96eda01c5aa
3
+ metadata.gz: 444cfa9ddc22dad9846b18a8a11934660fb7b8cc
4
+ data.tar.gz: ccd867e077f4dcdaf305d1b08b669df70d2ad2d8
5
5
  SHA512:
6
- metadata.gz: c6c5259a713d240f5f53a3c13647f5f989aa91a8d5ae1a3eceff6db80c3b0c18b9fafc1b257c220b47f9c15d8d9400692eaa0b0d9199b4431e3c227114cfb515
7
- data.tar.gz: 3a5211f678a1dcdd2fc5dc7357f621d9eff0269aff30778774f9efb15cc642ca7970c7304f087455491b5ffad008068ed64c75c766812316b39e368aca9bd0d5
6
+ metadata.gz: 077e0126d817d39b7c7cad63a3c331b05529a0a4943fd67407566214cabe9c11e4ddfe9cb9885aede37c4292c151d754797ad83490fa0cd7e0c65c1d0b3611c3
7
+ data.tar.gz: d00c5ec231227974168aee8ee49a2720a5911ae1daa964b6aac71c87ec7176584f6a0df314d4c99bea760cf10671e2fd182ed0d1b820a099031335e391f51378
data/lib/confluency.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "confluency/version"
2
+ require "confluency/client"
2
3
 
3
4
  module Confluency
4
- # Your code goes here...
5
+ # your code here
5
6
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Confluency
2
- VERSION = "0.0.0"
2
+ VERSION = "0.0.1"
3
3
  end
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.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: