confluency 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/README.md +21 -2
- data/confluency.gemspec +1 -0
- data/lib/confluency.rb +1 -0
- data/lib/confluency/client.rb +13 -12
- data/lib/confluency/string.rb +5 -0
- data/lib/confluency/version.rb +1 -1
- data/spec/client_spec.rb +16 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/string_spec.rb +18 -0
- metadata +25 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3652c5ffe7813bbe9b5764072fdc788a4d0e0f7
|
4
|
+
data.tar.gz: 69a089300e7eff359531b2a806224ed2ceed5a55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04ec95230a43e2e8acb9519dcf45de633e43610615e3452132c025e42972432ddfa88ab7cd50f9d951545eb0d61079df0cc1fbc540da47a9ef9d1bd0d355a595
|
7
|
+
data.tar.gz: 4327fd19c8b6203c0998f1ed5ff471e84904be1243f8ed7e848b43009938e8c96f7d2505733fc152c5ebe64f4d0130f5bb6b960936bfb9607c20f186cdc8aeb3
|
data/.rspec
ADDED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Confluency
|
2
2
|
|
3
|
-
|
3
|
+
Confluency serves as a client to connect to Confluence and treats you to some easy helper methods to format text for to meet [Confluence's storage format](https://confluence.atlassian.com/display/DOC/Confluence+Storage+Format)
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,26 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
To Connect
|
22
|
+
----------
|
23
|
+
|
24
|
+
client = Confluency::Client.new("CONFLUENCE_URL")
|
25
|
+
client.login("user","password")
|
26
|
+
|
27
|
+
Remote Methods
|
28
|
+
--------------
|
29
|
+
|
30
|
+
These will allow you to do things to administer Confluence, i.e. Add spaces, change permissions, delete pages, etc.
|
31
|
+
|
32
|
+
For a list of valid remote methods, please see [Confluence's list of remote methods](https://developer.atlassian.com/display/CONFDEV/Remote+Confluence+Methods) and note that the token can be ommited. The Confluency client already passes the token into the method.
|
33
|
+
|
34
|
+
Helper Methods
|
35
|
+
--------------
|
36
|
+
|
37
|
+
These helper methods are intended to make formating document easier from you application.
|
38
|
+
|
39
|
+
# String#to_heading
|
40
|
+
"HELLO".to_heading(3) # => <h3>HELLO</h3>
|
22
41
|
|
23
42
|
## Contributing
|
24
43
|
|
data/confluency.gemspec
CHANGED
data/lib/confluency.rb
CHANGED
data/lib/confluency/client.rb
CHANGED
@@ -2,16 +2,17 @@ require 'xmlrpc/client'
|
|
2
2
|
|
3
3
|
module Confluency
|
4
4
|
class Client
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
|
6
|
+
def initialize(server_url)
|
7
|
+
server_url += "/rpc/xmlrpc" unless server_url[-11..-1] == "/rpc/xmlrpc"
|
8
|
+
@server_url = server_url
|
9
|
+
server = XMLRPC::Client.new2(server_url)
|
10
|
+
@conf = server.proxy("confluence2")
|
11
|
+
@token = "12345"
|
12
|
+
end
|
13
|
+
|
14
|
+
def login(username, password)
|
15
|
+
@user = username
|
15
16
|
@pass = password
|
16
17
|
do_login()
|
17
18
|
end
|
@@ -38,5 +39,5 @@ module Confluency
|
|
38
39
|
raise e.faultString
|
39
40
|
end
|
40
41
|
end
|
41
|
-
|
42
|
-
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/confluency/version.rb
CHANGED
data/spec/client_spec.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'confluency'
|
3
|
+
|
4
|
+
describe Confluency::Client, '#new' do
|
5
|
+
|
6
|
+
before :each do
|
7
|
+
url = 'http://localhost'
|
8
|
+
@client = Confluency::Client.new(url)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should not raise an error" do
|
12
|
+
username = 'admin'
|
13
|
+
password = 'password'
|
14
|
+
@client.login(username,password)
|
15
|
+
end
|
16
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
4
|
+
# loaded once.
|
5
|
+
#
|
6
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
|
+
RSpec.configure do |config|
|
8
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
9
|
+
config.run_all_when_everything_filtered = true
|
10
|
+
config.filter_run :focus
|
11
|
+
|
12
|
+
# Run specs in random order to surface order dependencies. If you find an
|
13
|
+
# order dependency and want to debug it, you can fix the order by providing
|
14
|
+
# the seed, which is printed after each run.
|
15
|
+
# --seed 1234
|
16
|
+
config.order = 'random'
|
17
|
+
end
|
data/spec/string_spec.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'confluency'
|
3
|
+
|
4
|
+
describe String, "#to_heading" do
|
5
|
+
|
6
|
+
before :each do
|
7
|
+
@string = "This is my string"
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should return a string as a head element" do
|
11
|
+
@string.to_heading(1).should == "<h1>#{@string}</h1>"
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should return an <h3> if 3 is passed to to_heading" do
|
15
|
+
@string.to_heading(3).should == "<h3>#{@string}</h3>"
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate West
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: Confluency is a magical Ruby gem that's fluent in Confluence markup
|
42
56
|
email:
|
43
57
|
- natescott.west@gmail.com
|
@@ -46,6 +60,7 @@ extensions: []
|
|
46
60
|
extra_rdoc_files: []
|
47
61
|
files:
|
48
62
|
- .gitignore
|
63
|
+
- .rspec
|
49
64
|
- Gemfile
|
50
65
|
- LICENSE.txt
|
51
66
|
- README.md
|
@@ -53,7 +68,11 @@ files:
|
|
53
68
|
- confluency.gemspec
|
54
69
|
- lib/confluency.rb
|
55
70
|
- lib/confluency/client.rb
|
71
|
+
- lib/confluency/string.rb
|
56
72
|
- lib/confluency/version.rb
|
73
|
+
- spec/client_spec.rb
|
74
|
+
- spec/spec_helper.rb
|
75
|
+
- spec/string_spec.rb
|
57
76
|
homepage: http://github.com/drumsrgr8forn8/confluency
|
58
77
|
licenses:
|
59
78
|
- MIT
|
@@ -78,4 +97,7 @@ rubygems_version: 2.0.0
|
|
78
97
|
signing_key:
|
79
98
|
specification_version: 4
|
80
99
|
summary: Confluency will allow you to write to Confluence from another application
|
81
|
-
test_files:
|
100
|
+
test_files:
|
101
|
+
- spec/client_spec.rb
|
102
|
+
- spec/spec_helper.rb
|
103
|
+
- spec/string_spec.rb
|