Soks 1.0.1 → 1.0.2
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/README.txt +2 -17
- data/lib/helpers/default-helpers.rb +42 -41
- data/lib/soks-utils.rb +7 -1
- data/lib/soks-view.rb +5 -2
- data/lib/soks.rb +2 -2
- data/templates/default/content/Author.textile +2 -1
- data/templates/default/content/{Automatic%20linking%20between%20pages.textile → Automatic%20linking.textile} +1 -1
- data/templates/default/content/Home%20Page.textile +2 -2
- data/templates/default/content/How%20to%20get%20the%20latest%20Soks%20from%20cvs.textile +33 -11
- data/templates/default/content/How%20to%20hack%20soks.textile +1 -1
- data/templates/default/content/List%20of%20changes.textile +5 -131
- data/templates/default/content/News%3A%20Version%201%2D0%2D1%20released.textile +1 -1
- data/templates/default/content/Pages%20to%20include%20in%20the%20distribution.textile +5 -2
- data/templates/default/content/Planned%20Features.textile +12 -2
- data/templates/default/content/README.textile +2 -17
- data/templates/default/content/Recent%20changes%20to%20this%20site.textile +150 -123
- data/templates/default/content/SOKS%20features.textile +8 -9
- data/templates/default/content/Sidebar%20Page.textile +3 -0
- data/templates/default/content/Site%20Index.textile +17 -2
- data/templates/default/content/{Soks%20Licence.textile → Soks%27s%20Licence.textile} +0 -0
- data/templates/default/version.txt +1 -1
- data/templates/default/views/frame.rhtml +2 -2
- data/test/test_counter-helper.rb +25 -21
- data/test/test_soks-helpers.rb +46 -5
- data/test/test_soks-view.rb +14 -2
- data/test/test_soks.rb +9 -0
- metadata +5 -5
- data/templates/default/content/How%20to%20use%20the%20keyboard%20shortcuts.textile +0 -17
File without changes
|
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
@@ -17,9 +17,9 @@
|
|
17
17
|
|
18
18
|
<div id='menu'>
|
19
19
|
|
20
|
-
<h1><%=
|
20
|
+
<h1><%= self.name %></h1>
|
21
21
|
<a href='<%= url 'Home Page' %>' accesskey='H' >
|
22
|
-
<img width='149' src='<%= file 'logo.jpg' %>' alt='<%=
|
22
|
+
<img width='149' src='<%= file 'logo.jpg' %>' alt='<%= self.name %>' />
|
23
23
|
</a>
|
24
24
|
|
25
25
|
<h2>Search</h2>
|
data/test/test_counter-helper.rb
CHANGED
@@ -49,14 +49,16 @@ class TestViewCountHelper < Test::Unit::TestCase
|
|
49
49
|
test_page_count
|
50
50
|
@wiki.notify( :test_event )
|
51
51
|
wait_for_queue_to_empty
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
52
|
+
content = @wiki.page('Popular Pages').content.split "\n"
|
53
|
+
[ [ 0, "h1. Popular Pages" ],
|
54
|
+
[ 4, "| count1 | 3 |" ],
|
55
|
+
[ 5, "| count2 | 2 |" ],
|
56
|
+
[ 6, "| 1 others | 1 |" ],
|
57
|
+
[ 7, "| *Total* | *6* |" ] ].each do |i,line|
|
58
|
+
assert_equal line, content[i]
|
59
|
+
end
|
59
60
|
end
|
61
|
+
|
60
62
|
end
|
61
63
|
|
62
64
|
class TestViewerCountHelper < Test::Unit::TestCase
|
@@ -103,13 +105,14 @@ class TestViewerCountHelper < Test::Unit::TestCase
|
|
103
105
|
test_viewer_count
|
104
106
|
@wiki.notify( :test_event )
|
105
107
|
wait_for_queue_to_empty
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
108
|
+
content = @wiki.page('Popular Pages').content.split "\n"
|
109
|
+
[ [ 0, "h1. Popular Pages" ],
|
110
|
+
[ 4, "| Author1 | 3 |" ],
|
111
|
+
[ 5, "| Author2 | 2 |" ],
|
112
|
+
[ 6, "| 1 others | 1 |" ],
|
113
|
+
[ 7, "| *Total* | *6* |" ] ].each do |i,line|
|
114
|
+
assert_equal line, content[i]
|
115
|
+
end
|
113
116
|
end
|
114
117
|
end
|
115
118
|
|
@@ -147,12 +150,13 @@ class TestAuthorCountHelper < Test::Unit::TestCase
|
|
147
150
|
test_author_count
|
148
151
|
@wiki.notify( :test_event )
|
149
152
|
wait_for_queue_to_empty
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
153
|
+
content = @wiki.page('Principal Authors').content.split "\n"
|
154
|
+
[ [ 0, "h1. Principal Authors" ],
|
155
|
+
[ 4, "| t1 | 3 |" ],
|
156
|
+
[ 5, "| t2 | 2 |" ],
|
157
|
+
[ 6, "| 1 others | 1 |" ],
|
158
|
+
[ 7, "| *Total* | *6* |" ] ].each do |i,line|
|
159
|
+
assert_equal line, content[i]
|
160
|
+
end
|
157
161
|
end
|
158
162
|
end
|
data/test/test_soks-helpers.rb
CHANGED
@@ -4,6 +4,47 @@ require 'mock-objects'
|
|
4
4
|
require 'helpers/default-helpers'
|
5
5
|
require 'generator'
|
6
6
|
|
7
|
+
class TestAutomaticSummary < Test::Unit::TestCase
|
8
|
+
include TearDownableWiki
|
9
|
+
|
10
|
+
def test_basics
|
11
|
+
AutomaticSummary.new( @wiki, 'automatic summary' ) { |page| page.name =~ /hello/i }
|
12
|
+
@wiki.revise 'hello world', 'hello world', 'test author'
|
13
|
+
@wiki.revise 'hello john', 'hello john', 'test author'
|
14
|
+
@wiki.revise 'hello frank', 'hello frank', 'test author'
|
15
|
+
@wiki.revise 'hello frank', 'page deleted', 'test author'
|
16
|
+
@wiki.revise 'goodbye world', 'goodbye world', 'test author'
|
17
|
+
wait_for_queue_to_empty
|
18
|
+
content = @wiki.page('automatic summary').content
|
19
|
+
assert_match /hello world/, content
|
20
|
+
assert_match /hello john/, content
|
21
|
+
assert_no_match /goodbye world/, content
|
22
|
+
assert_no_match /hello frank/, content
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_updates_on_revision
|
26
|
+
as = AutomaticSummary.new( @wiki, 'update on revision test' ) { |page| page.name =~ /summarise/i }
|
27
|
+
@wiki.revise('summarise 1','initial content','test author')
|
28
|
+
wait_for_queue_to_empty
|
29
|
+
assert_match(/initial content/,@wiki.page('update on revision test').content )
|
30
|
+
@wiki.revise('summarise 1','updated content','test author')
|
31
|
+
wait_for_queue_to_empty
|
32
|
+
assert_match(/updated content/,@wiki.page('update on revision test').content )
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_removes_when_no_longer_true
|
36
|
+
AutomaticSummary.new( @wiki, 'remove when not true test' ) { |page| page.content =~ /hello/i }
|
37
|
+
@wiki.revise('summarise 1','hello','test author')
|
38
|
+
wait_for_queue_to_empty
|
39
|
+
assert_match(/hello/,@wiki.page('remove when not true test').content )
|
40
|
+
@wiki.revise('summarise 1','bye','test author')
|
41
|
+
wait_for_queue_to_empty
|
42
|
+
assert_no_match(/hello/,@wiki.page('remove when not true test').content )
|
43
|
+
assert_no_match(/bye/,@wiki.page('remove when not true test').content )
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
7
48
|
class TestRecentChanges < Test::Unit::TestCase
|
8
49
|
include TearDownableWiki
|
9
50
|
|
@@ -12,7 +53,7 @@ class TestRecentChanges < Test::Unit::TestCase
|
|
12
53
|
@wiki.revise( 'testpage','B','normal person')
|
13
54
|
@wiki.revise( 'testpage2','A','normal person')
|
14
55
|
wait_for_queue_to_empty
|
15
|
-
assert_equal(2, rc.
|
56
|
+
assert_equal(2, rc.summary.to_a.size)
|
16
57
|
assert_match( /normal person/i, rctextile )
|
17
58
|
end
|
18
59
|
|
@@ -21,7 +62,7 @@ class TestRecentChanges < Test::Unit::TestCase
|
|
21
62
|
@wiki.revise( 'testpage','B','normal person')
|
22
63
|
@wiki.revise( 'testpage','A','normal person')
|
23
64
|
wait_for_queue_to_empty
|
24
|
-
assert_equal(1, rc.
|
65
|
+
assert_equal(1, rc.summary.to_a.size)
|
25
66
|
assert_match( /normal person/i, rctextile )
|
26
67
|
end
|
27
68
|
|
@@ -30,7 +71,7 @@ class TestRecentChanges < Test::Unit::TestCase
|
|
30
71
|
@wiki.revise( 'testpage','B','p1')
|
31
72
|
@wiki.revise( 'testpage','A','p2')
|
32
73
|
wait_for_queue_to_empty
|
33
|
-
assert_equal(2, @rc.
|
74
|
+
assert_equal(2, @rc.summary.to_a.size)
|
34
75
|
assert_match( /p1/i, rctextile )
|
35
76
|
assert_match( /p2/i, rctextile )
|
36
77
|
end
|
@@ -41,7 +82,7 @@ class TestRecentChanges < Test::Unit::TestCase
|
|
41
82
|
@wiki.revise( 'testpage2','A','normal person')
|
42
83
|
rc = AutomaticRecentChanges.new( @wiki)
|
43
84
|
assert_equal(['recent changes to this site','testpage','testpage2'],@wiki.map{|name,page| name }.sort)
|
44
|
-
assert_equal(2, rc.
|
85
|
+
assert_equal(2, rc.summary.to_a.size)
|
45
86
|
assert_match( /normal person/i, rctextile )
|
46
87
|
assert_no_match( /AutomaticPageMover/i, rctextile )
|
47
88
|
end
|
@@ -53,7 +94,7 @@ class TestRecentChanges < Test::Unit::TestCase
|
|
53
94
|
@wiki.revise( 'testpage2','A','normal person')
|
54
95
|
wait_for_queue_to_empty
|
55
96
|
assert_equal(['recent changes to this site','testpage','testpage2'],@wiki.map{|name,page| name }.sort)
|
56
|
-
assert_equal(2, rc.
|
97
|
+
assert_equal(2, rc.summary.to_a.size)
|
57
98
|
assert_match( /normal person/i, rctextile )
|
58
99
|
assert_no_match( /AutomaticPageMover/i, rctextile )
|
59
100
|
end
|
data/test/test_soks-view.rb
CHANGED
@@ -52,9 +52,13 @@ class TestBruteMatch < Test::Unit::TestCase
|
|
52
52
|
assert_equal( [['.Site Index A.',:dot_index_a]],match(".Site Index A. ball") )
|
53
53
|
end
|
54
54
|
|
55
|
-
def
|
55
|
+
def test_do_not_match
|
56
|
+
assert_equal [], match("Oh! L'EQUIPE? C'est...", ["l'equipe"])
|
57
|
+
end
|
58
|
+
|
59
|
+
def match( text, do_not_match = [] )
|
56
60
|
matches = []
|
57
|
-
@match.match( text ) { |m,p|
|
61
|
+
@match.match( text, do_not_match ) { |m,p|
|
58
62
|
matches << [m,p]
|
59
63
|
"$1"
|
60
64
|
}
|
@@ -162,6 +166,14 @@ class TestWikiRedCloth < Test::Unit::TestCase
|
|
162
166
|
assert_equal( %q{<p><a href='http://testsite.com/view/AGreatPageOfStuff' class='automatic'>A "great page" of stuff</a></p>},html('test quotes in title'))
|
163
167
|
end
|
164
168
|
|
169
|
+
def test_dont_match_the_page_title
|
170
|
+
@view.revise('Ruby','a page about ruby','tamc2')
|
171
|
+
@view.revise('not ruby','a page about ruby','tamc2')
|
172
|
+
wait_for_queue_to_empty
|
173
|
+
assert_equal( %q{<p>a page about <a href='http://testsite.com/view/Ruby' class='automatic'>ruby</a></p>},html('not ruby'))
|
174
|
+
assert_equal( %q{<p>a page about ruby</p>},html('ruby'))
|
175
|
+
end
|
176
|
+
|
165
177
|
def test_wiki_links
|
166
178
|
@view.revise('test1','[[test => a wonderfull page?great=good ]]','tamc2')
|
167
179
|
@view.revise('test2','[[test => /edit/a wonderfull page?great =good ]]','tamc2')
|
data/test/test_soks.rb
ADDED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: Soks
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2005-
|
6
|
+
version: 1.0.2
|
7
|
+
date: 2005-09-27 00:00:00 +01:00
|
8
8
|
summary: Yet another wiki.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -84,7 +84,7 @@ files:
|
|
84
84
|
- templates/default/content/Automatic%20counters.textile
|
85
85
|
- templates/default/content/Automatic%20exporters.textile
|
86
86
|
- templates/default/content/Automatic%20importers.textile
|
87
|
-
- templates/default/content/Automatic%20linking
|
87
|
+
- templates/default/content/Automatic%20linking.textile
|
88
88
|
- templates/default/content/Automatic%20maintenance%20helpers.textile
|
89
89
|
- templates/default/content/Automatic%20Summaries.textile
|
90
90
|
- templates/default/content/Bug%3A%20Competing%20edits.textile
|
@@ -111,7 +111,6 @@ files:
|
|
111
111
|
- templates/default/content/How%20to%20report%20a%20bug.textile
|
112
112
|
- templates/default/content/How%20to%20upgrade%20soks.textile
|
113
113
|
- templates/default/content/How%20to%20use%20the%20Automatic%20Helper%20classes.textile
|
114
|
-
- templates/default/content/How%20to%20use%20the%20keyboard%20shortcuts.textile
|
115
114
|
- templates/default/content/How%20to%20use%20this%20wiki.textile
|
116
115
|
- templates/default/content/List%20of%20changes.textile
|
117
116
|
- templates/default/content/News%3A%20Version%201%2D0%2D0%20released.textile
|
@@ -126,7 +125,7 @@ files:
|
|
126
125
|
- templates/default/content/Sidebar%20Page.textile
|
127
126
|
- templates/default/content/Site%20Index.textile
|
128
127
|
- templates/default/content/SOKS%20features.textile
|
129
|
-
- templates/default/content/Soks%20Licence.textile
|
128
|
+
- templates/default/content/Soks%27s%20Licence.textile
|
130
129
|
- templates/default/content/Tag%3A%20Include%20this%20page%20in%20the%20distribution.textile
|
131
130
|
- templates/default/views/frame.rhtml
|
132
131
|
- templates/default/views/messages.yaml
|
@@ -152,6 +151,7 @@ files:
|
|
152
151
|
- test/test_soks-storage.rb
|
153
152
|
- test/test_soks-utils.rb
|
154
153
|
- test/test_soks-view.rb
|
154
|
+
- test/test_soks.rb
|
155
155
|
- test/html/2006Mar.html
|
156
156
|
- test/html/poignant.html
|
157
157
|
- test/html/poignant.textile
|
@@ -1,17 +0,0 @@
|
|
1
|
-
h1. Keyboard Shortcuts
|
2
|
-
|
3
|
-
Soks has a number of keyboard short cuts. Depending on your browser, only some of them will work:
|
4
|
-
|
5
|
-
* ctrl-n : New page. Will use whatever text you had selected as the title of the new page (definitely only works on a few browsers[1])
|
6
|
-
* ctrl-e: Edit page, and if you are editing:
|
7
|
-
** ctrl-s saves the page
|
8
|
-
** ctrl-c cancels the editing
|
9
|
-
** ctrl-u undos the previous edit
|
10
|
-
** ctrl-a shows all the previous changes
|
11
|
-
* ctrl-h: Home page
|
12
|
-
|
13
|
-
*Note:* On Linux/Firefox and WindowsXP/IE6.0, substitute "meta" or "alt" for "ctrl". And for WindowsXP/IE6.0, these will only move you to the link on the page -- you then have to hit enter to proceed.
|
14
|
-
|
15
|
-
fn1. Does not work on Linux/Firefox1.0 or WindowsXP/IE6.0
|
16
|
-
|
17
|
-
Tag: Include this page in the distribution
|