wiki_lib 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/LICENSE +1 -1
- data/README +10 -16
- data/Rakefile +39 -30
- data/VERSION +1 -0
- data/lib/wiki_lib.rb +0 -1
- data/lib/wiki_lib/pm_wiki.rb +3 -1
- data/spec/wiki_lib/pm_wiki_spec.rb +19 -0
- data/wiki_lib.gemspec +61 -0
- metadata +61 -13
- data/spec/wiki_lib_spec.rb +0 -7
data/LICENSE
CHANGED
data/README
CHANGED
@@ -1,25 +1,19 @@
|
|
1
|
-
wiki-lib
|
2
|
-
========
|
1
|
+
= wiki-lib
|
3
2
|
|
4
3
|
A simple library for easing interaction with wikis (currently just PMWiki) in ruby,
|
5
4
|
in essence, a wrapper around the mechanize gem.
|
6
5
|
|
7
|
-
require 'rubygems'
|
8
|
-
|
9
|
-
require 'wiki_lib'
|
6
|
+
require 'rubygems'
|
7
|
+
require 'wiki_lib'
|
10
8
|
|
11
|
-
@pm_wiki = WikiLib::PMWiki.new('http://www.pmwiki.org/wiki', '
|
9
|
+
@pm_wiki = WikiLib::PMWiki.new('http://www.pmwiki.org/wiki', 'auser', 'apassword')
|
12
10
|
|
13
|
-
# get the page
|
14
|
-
@page = @pm_wiki.get_page('PmWiki/FAQ')
|
11
|
+
# get the page
|
12
|
+
@page = @pm_wiki.get_page('PmWiki/FAQ')
|
15
13
|
|
16
|
-
# get the current sandbox text
|
17
|
-
@sandbox = @pm_wiki.get_edit_text('Main/WikiSandbox')
|
14
|
+
# get the current sandbox text
|
15
|
+
@sandbox = @pm_wiki.get_edit_text('Main/WikiSandbox')
|
18
16
|
|
19
|
-
# upload the reversed sandbox text back to the sandbox
|
20
|
-
@pm_wiki.upload_page('Main/WikiSandbox', @sandbox.reverse, "You're in backwards land, today".reverse)
|
17
|
+
# upload the reversed sandbox text back to the sandbox
|
18
|
+
@pm_wiki.upload_page('Main/WikiSandbox', @sandbox.reverse, "You're in backwards land, today".reverse)
|
21
19
|
|
22
|
-
COPYRIGHT
|
23
|
-
=========
|
24
|
-
|
25
|
-
Copyright (c) 2008 Jonathan Stott. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -1,44 +1,53 @@
|
|
1
1
|
require 'rake'
|
2
|
-
require 'rake/testtask'
|
3
|
-
require 'rake/rdoctask'
|
4
|
-
require 'rcov/rcovtask'
|
5
2
|
|
6
3
|
begin
|
7
4
|
require 'jeweler'
|
8
|
-
Jeweler::Tasks.new do |
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
5
|
+
Jeweler::Tasks.new do |gem|
|
6
|
+
gem.name = "wiki_lib"
|
7
|
+
gem.summary = "A simple library to wrap around some common wiki operations"
|
8
|
+
gem.description = "A simple library to wrap around some common wiki operations\nCurrently only PMWiki is supported, but more will be added as and when."
|
9
|
+
gem.email = "jonathan.stott@gmail.com"
|
10
|
+
gem.homepage = "http://github.com/namelessjon/wiki_lib"
|
11
|
+
gem.authors = ["Jonathan Stott"]
|
12
|
+
gem.add_dependency "mechanize", "~> 1.0"
|
13
|
+
gem.add_development_dependency "bacon"
|
14
|
+
gem.add_development_dependency "yard"
|
15
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
16
|
end
|
19
17
|
Jeweler::GemcutterTasks.new
|
20
18
|
rescue LoadError
|
21
|
-
puts "Jeweler not available. Install it with:
|
19
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
22
20
|
end
|
23
21
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
require 'rake/testtask'
|
23
|
+
Rake::TestTask.new(:spec) do |spec|
|
24
|
+
spec.libs << 'lib' << 'spec'
|
25
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
26
|
+
spec.verbose = true
|
28
27
|
end
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
begin
|
30
|
+
require 'rcov/rcovtask'
|
31
|
+
Rcov::RcovTask.new do |spec|
|
32
|
+
spec.libs << 'spec'
|
33
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
34
|
+
spec.verbose = true
|
35
|
+
end
|
36
|
+
rescue LoadError
|
37
|
+
task :rcov do
|
38
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
t.verbose = true
|
42
|
-
end
|
42
|
+
task :spec => :check_dependencies
|
43
|
+
|
44
|
+
task :default => :spec
|
43
45
|
|
44
|
-
|
46
|
+
begin
|
47
|
+
require 'yard'
|
48
|
+
YARD::Rake::YardocTask.new
|
49
|
+
rescue LoadError
|
50
|
+
task :yardoc do
|
51
|
+
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
|
52
|
+
end
|
53
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/lib/wiki_lib.rb
CHANGED
data/lib/wiki_lib/pm_wiki.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'mechanize'
|
2
|
+
|
1
3
|
module WikiLib
|
2
4
|
##
|
3
5
|
# Class for interacting with the PMWiki
|
@@ -14,7 +16,7 @@ module WikiLib
|
|
14
16
|
@base = base_page
|
15
17
|
@pass = password
|
16
18
|
@user = username
|
17
|
-
@agent = ::
|
19
|
+
@agent = ::Mechanize.new
|
18
20
|
end
|
19
21
|
|
20
22
|
##
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
# Jonathan D. Stott <jonathan.stott@gmail.com>
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'wiki_lib/pm_wiki'
|
5
|
+
|
6
|
+
describe "WikiLib::PMWiki" do
|
7
|
+
before do
|
8
|
+
@wiki = WikiLib::PMWiki.new('http://example.com', 'user', 'password')
|
9
|
+
end
|
10
|
+
|
11
|
+
it "gives a correct page_url" do
|
12
|
+
@wiki.page_url('Home').should == "http://example.com/Home"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "gives a correct edit_url" do
|
16
|
+
@wiki.edit_url('Home').should == "http://example.com/Home?action=edit"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
data/wiki_lib.gemspec
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{wiki_lib}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Jonathan Stott"]
|
12
|
+
s.date = %q{2010-05-21}
|
13
|
+
s.description = %q{A simple library to wrap around some common wiki operations
|
14
|
+
Currently only PMWiki is supported, but more will be added as and when.}
|
15
|
+
s.email = %q{jonathan.stott@gmail.com}
|
16
|
+
s.extra_rdoc_files = [
|
17
|
+
"LICENSE",
|
18
|
+
"README"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/wiki_lib.rb",
|
27
|
+
"lib/wiki_lib/pm_wiki.rb",
|
28
|
+
"spec/spec_helper.rb",
|
29
|
+
"spec/wiki_lib/pm_wiki_spec.rb",
|
30
|
+
"wiki_lib.gemspec"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://github.com/namelessjon/wiki_lib}
|
33
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.3.7}
|
36
|
+
s.summary = %q{A simple library to wrap around some common wiki operations}
|
37
|
+
s.test_files = [
|
38
|
+
"spec/wiki_lib/pm_wiki_spec.rb",
|
39
|
+
"spec/spec_helper.rb"
|
40
|
+
]
|
41
|
+
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_runtime_dependency(%q<mechanize>, ["~> 1.0"])
|
48
|
+
s.add_development_dependency(%q<bacon>, [">= 0"])
|
49
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
50
|
+
else
|
51
|
+
s.add_dependency(%q<mechanize>, ["~> 1.0"])
|
52
|
+
s.add_dependency(%q<bacon>, [">= 0"])
|
53
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
54
|
+
end
|
55
|
+
else
|
56
|
+
s.add_dependency(%q<mechanize>, ["~> 1.0"])
|
57
|
+
s.add_dependency(%q<bacon>, [">= 0"])
|
58
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
metadata
CHANGED
@@ -1,27 +1,66 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wiki_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Jonathan Stott
|
8
|
-
autorequire:
|
14
|
+
autorequire:
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2010-05-21 00:00:00 +01:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: mechanize
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ~>
|
22
28
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
29
|
+
hash: 15
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
version: "1.0"
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: bacon
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
version: "0"
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: yard
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
62
|
+
type: :development
|
63
|
+
version_requirements: *id003
|
25
64
|
description: |-
|
26
65
|
A simple library to wrap around some common wiki operations
|
27
66
|
Currently only PMWiki is supported, but more will be added as and when.
|
@@ -34,13 +73,16 @@ extra_rdoc_files:
|
|
34
73
|
- LICENSE
|
35
74
|
- README
|
36
75
|
files:
|
76
|
+
- .gitignore
|
37
77
|
- LICENSE
|
38
78
|
- README
|
39
79
|
- Rakefile
|
80
|
+
- VERSION
|
40
81
|
- lib/wiki_lib.rb
|
41
82
|
- lib/wiki_lib/pm_wiki.rb
|
42
83
|
- spec/spec_helper.rb
|
43
|
-
- spec/
|
84
|
+
- spec/wiki_lib/pm_wiki_spec.rb
|
85
|
+
- wiki_lib.gemspec
|
44
86
|
has_rdoc: true
|
45
87
|
homepage: http://github.com/namelessjon/wiki_lib
|
46
88
|
licenses: []
|
@@ -51,24 +93,30 @@ rdoc_options:
|
|
51
93
|
require_paths:
|
52
94
|
- lib
|
53
95
|
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
54
97
|
requirements:
|
55
98
|
- - ">="
|
56
99
|
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
101
|
+
segments:
|
102
|
+
- 0
|
57
103
|
version: "0"
|
58
|
-
version:
|
59
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
60
106
|
requirements:
|
61
107
|
- - ">="
|
62
108
|
- !ruby/object:Gem::Version
|
109
|
+
hash: 3
|
110
|
+
segments:
|
111
|
+
- 0
|
63
112
|
version: "0"
|
64
|
-
version:
|
65
113
|
requirements: []
|
66
114
|
|
67
115
|
rubyforge_project:
|
68
|
-
rubygems_version: 1.3.
|
116
|
+
rubygems_version: 1.3.7
|
69
117
|
signing_key:
|
70
118
|
specification_version: 3
|
71
119
|
summary: A simple library to wrap around some common wiki operations
|
72
120
|
test_files:
|
121
|
+
- spec/wiki_lib/pm_wiki_spec.rb
|
73
122
|
- spec/spec_helper.rb
|
74
|
-
- spec/wiki_lib_spec.rb
|