clwiki 2.0.0
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/LICENSE +31 -0
- data/Rakefile +53 -0
- data/app/assets/javascripts/cl_wiki/application.js +29 -0
- data/app/assets/stylesheets/cl_wiki/application.css +103 -0
- data/app/controllers/cl_wiki/application_controller.rb +4 -0
- data/app/controllers/cl_wiki/page_controller.rb +106 -0
- data/app/helpers/cl_wiki/application_helper.rb +4 -0
- data/app/views/cl_wiki/page/edit.html.erb +8 -0
- data/app/views/cl_wiki/page/find.html.erb +27 -0
- data/app/views/cl_wiki/page/recent.html.erb +4 -0
- data/app/views/cl_wiki/page/recent.rss.builder +18 -0
- data/app/views/cl_wiki/page/show.html.erb +1 -0
- data/app/views/layouts/cl_wiki/application.html.erb +14 -0
- data/config/clwiki.yml +73 -0
- data/config/initializers/clwiki.rb +9 -0
- data/config/routes.rb +15 -0
- data/lib/cl_wiki.rb +12 -0
- data/lib/cl_wiki/configuration.rb +171 -0
- data/lib/cl_wiki/engine.rb +5 -0
- data/lib/cl_wiki/file.rb +171 -0
- data/lib/cl_wiki/find_in_file.rb +33 -0
- data/lib/cl_wiki/format/format.blockquote.rb +15 -0
- data/lib/cl_wiki/format/format.graphviz.digraph.rb +16 -0
- data/lib/cl_wiki/format/format.opml.rb +105 -0
- data/lib/cl_wiki/format/format.pre.blockquote.rb +15 -0
- data/lib/cl_wiki/format/format.simpletable.rb +25 -0
- data/lib/cl_wiki/index.rb +455 -0
- data/lib/cl_wiki/page.rb +516 -0
- data/lib/cl_wiki/tools/cron.reminders.rb +241 -0
- data/lib/cl_wiki/tools/movepages.rb +27 -0
- data/lib/cl_wiki/tools/pagestomove.txt +56 -0
- data/lib/cl_wiki/tools/rublog/clWiki.rb +62 -0
- data/lib/cl_wiki/tools/rublog/readme.txt +2 -0
- data/lib/cl_wiki/tools/singlepage.rb +58 -0
- data/lib/cl_wiki/tools/test/singlepagetest.rb +9 -0
- data/lib/cl_wiki/tools/thunderbird.rb +23 -0
- data/lib/cl_wiki/version.rb +3 -0
- data/test/dummy/README.rdoc +259 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +16 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +37 -0
- data/test/dummy/config/boot.rb +9 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +34 -0
- data/test/dummy/config/environments/production.rb +81 -0
- data/test/dummy/config/environments/test.rb +36 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/locale.rb +7 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +12 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/development.log +1963 -0
- data/test/dummy/log/test.log +1340 -0
- data/test/dummy/public/404.html +27 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/17ea26cbf693e610505bdc24be534847 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/1883f3d938430da389005555d27c0bad +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/1b9132b83b822937e80ef987f7da1760 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/259fb44b87b29348087957b4937a1953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/37f8e4f0491b6401433af823dfb471d9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/48d7a2c40083020f9e7d97d4d73f26fa +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4b0bfb6eb9d6983eb9defa58dd96dae4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4da11f1195532cd7b80f2dde7cf843d5 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/57347ee373d74c87e1515a059c701085 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/61b40e54192bf61d97ce2aef71e7d694 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/633b01c5a65fcd6457baf30d1cc94148 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6ad8bb345cc43acfca78c043b7bfefae +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/87a335a43cb68a253dea2b6c0269a4d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8a38b2f4390e68175dae4b4b1c144e2e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8ddc1a668acec35c2707ebc47768f59c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8f5ab7b6f73a1e9f16421b299134e39a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9835aec4bc0277b8f02d0e86c977fdba +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ae4f771558859f9c120a0f22328e8521 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/afed0eaa6fcf7a263498a08a5cc02cf0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/be786e5567855cdc6817603725fd1b8d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bf9b02df32690fb2a936818715d611f3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c2bf9d91a6a2786263b9912b948f435d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ce4c918439a53cb89d02313ed990d5de +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d9c791f08c547f30854ad746a89b0bb5 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ddc3a7b5173ff5c911a53004b56e4305 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/dfed1391742203d15f08cb07173bccba +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e282b6bdaa0e070754f8558b9de5e417 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f0e957c30443ade693f73ff470f0f894 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f6b3cbb9c04d5af74d780464c9a34ee5 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/fb41fedee86fd2d10ddd938bf5d68eb7 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/1883f3d938430da389005555d27c0bad +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/48d7a2c40083020f9e7d97d4d73f26fa +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/61b40e54192bf61d97ce2aef71e7d694 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/8f5ab7b6f73a1e9f16421b299134e39a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/9835aec4bc0277b8f02d0e86c977fdba +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/ae4f771558859f9c120a0f22328e8521 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/be786e5567855cdc6817603725fd1b8d +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c2bf9d91a6a2786263b9912b948f435d +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/ce4c918439a53cb89d02313ed990d5de +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e282b6bdaa0e070754f8558b9de5e417 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f0e957c30443ade693f73ff470f0f894 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f6b3cbb9c04d5af74d780464c9a34ee5 +0 -0
- data/test/dummy/tmp/testrep/FooBar.txt +1 -0
- data/test/dummy/tmp/testrep/FrontPage.txt +1 -0
- data/test/dummy/tmp/testrep/QuuxBaz.txt +1 -0
- data/test/dummy/wikirep/AboutClWiki.txt +31 -0
- data/test/dummy/wikirep/ChrisMorris.txt +4 -0
- data/test/dummy/wikirep/DotTest.txt +6 -0
- data/test/dummy/wikirep/FooBar.txt +4 -0
- data/test/dummy/wikirep/FooBarQuux.txt +4 -0
- data/test/dummy/wikirep/FrontPage.txt +14 -0
- data/test/dummy/wikirep/HtmlAreaTest.txt +4 -0
- data/test/dummy/wikirep/PreTagsTest.txt +27 -0
- data/test/dummy/wikirep/TheMan.txt +4 -0
- data/test/helpers/wiki_helper_test.rb +4 -0
- data/test/lib/clwiki/clwiki_test_helper.rb +3 -0
- data/test/lib/clwiki/file_test.rb +93 -0
- data/test/lib/clwiki/find_in_file_test.rb +111 -0
- data/test/lib/clwiki/index_test.rb +32 -0
- data/test/lib/clwiki/page_test.rb +239 -0
- data/test/lib/clwiki/test_base.rb +25 -0
- data/test/test_helper.rb +15 -0
- metadata +312 -0
@@ -0,0 +1,241 @@
|
|
1
|
+
# modified version of Cron class by John Small mailto:jsmall@laser.net
|
2
|
+
# RAA entry as of 1/2/03 is defunct - web site is bad url
|
3
|
+
|
4
|
+
# next step -- every minute write to file the time
|
5
|
+
# then, every minute, verify the previous minute written to file matches.
|
6
|
+
# if not, then simulate every minute in between time and call testAndLaunch
|
7
|
+
# ... this way missed time will be caught up
|
8
|
+
|
9
|
+
# other approach is to prefigure when items should go and write them to a log
|
10
|
+
# then delete them from the log when they are sent -- and do a catch up
|
11
|
+
# on every check
|
12
|
+
|
13
|
+
require 'cl/util/console'
|
14
|
+
require 'cl/util/win'
|
15
|
+
require 'rubygems'
|
16
|
+
gem 'mosmtp', '>= 2010.141.2'
|
17
|
+
require 'mosmtp'
|
18
|
+
$LOAD_PATH << '..'
|
19
|
+
require 'clwikiconf'
|
20
|
+
require 'clwikipage'
|
21
|
+
require 'parsedate'
|
22
|
+
|
23
|
+
class Cron
|
24
|
+
def loadCrontab()
|
25
|
+
File.open(@crontabFilename, "r") do |f|
|
26
|
+
@crontab = []
|
27
|
+
f.each_line { | line |
|
28
|
+
line.chomp!
|
29
|
+
next if (line =~ /^$/) # skip blank lines
|
30
|
+
next if (line =~ /^\#/) # skip comments
|
31
|
+
@crontab << line.split(/ +/,6)
|
32
|
+
}
|
33
|
+
end
|
34
|
+
@crontabAge = File.mtime(@crontabFilename)
|
35
|
+
end
|
36
|
+
|
37
|
+
def inRange(value,range)
|
38
|
+
range.split(/,/).each { | subrange |
|
39
|
+
low, high = subrange.split(/\-/)
|
40
|
+
low = low.to_i
|
41
|
+
if high
|
42
|
+
high = high.to_i
|
43
|
+
return true if value >= low and value <= high;
|
44
|
+
else
|
45
|
+
return true if low == value;
|
46
|
+
end
|
47
|
+
}
|
48
|
+
false
|
49
|
+
end
|
50
|
+
|
51
|
+
def nth_wday_of_month?(nth)
|
52
|
+
require 'date'
|
53
|
+
|
54
|
+
all_wday_in_month = []
|
55
|
+
today = Date.today
|
56
|
+
(-5..5).each do |i|
|
57
|
+
a_date = (today + (i*7))
|
58
|
+
all_wday_in_month << a_date if a_date.mon == today.mon
|
59
|
+
end
|
60
|
+
all_wday_in_month[nth - 1] == today
|
61
|
+
end
|
62
|
+
|
63
|
+
def wday_in_range(current_wday, tweekday)
|
64
|
+
tweekday, nth_wday = tweekday.split('/')
|
65
|
+
result = inRange(current_wday, tweekday)
|
66
|
+
if result && nth_wday
|
67
|
+
result = nth_wday_of_month?(nth_wday.to_i)
|
68
|
+
end
|
69
|
+
result
|
70
|
+
end
|
71
|
+
|
72
|
+
def testAndLaunch(now)
|
73
|
+
@crontab.each { | task |
|
74
|
+
tmin, thour, tmonthday, tmonth, tweekday, tcommand = task
|
75
|
+
launch = false
|
76
|
+
|
77
|
+
# Launch this month of the year?
|
78
|
+
if tmonth.eql?("*") || inRange(now.mon,tmonth)
|
79
|
+
launch = true
|
80
|
+
end
|
81
|
+
|
82
|
+
# Launch this day of the month?
|
83
|
+
if launch && !tmonthday.eql?("*") &&
|
84
|
+
!inRange(now.mday,tmonthday)
|
85
|
+
launch = false
|
86
|
+
end
|
87
|
+
|
88
|
+
# Launch this day of the week?
|
89
|
+
if launch && !tweekday.eql?("*") &&
|
90
|
+
!wday_in_range(now.wday, tweekday)
|
91
|
+
launch = false
|
92
|
+
end
|
93
|
+
|
94
|
+
# Launch this hour of the day?
|
95
|
+
if launch && !thour.eql?("*") &&
|
96
|
+
!inRange(now.hour,thour)
|
97
|
+
launch = false
|
98
|
+
end
|
99
|
+
|
100
|
+
# Launch this minute of the hour?
|
101
|
+
if launch && !tmin.eql?("*") &&
|
102
|
+
!inRange(now.min,tmin)
|
103
|
+
launch = false;
|
104
|
+
end
|
105
|
+
|
106
|
+
if launch || $debug
|
107
|
+
subj = "[rem] " + tcommand.gsub(/_/, ' ')
|
108
|
+
body = time_to_str(now) + "\n" + parse_tcommand_for_wiki_pages(tcommand) + "\n" +
|
109
|
+
"\n" +
|
110
|
+
"http://localhost/clwiki/clwikicgi.rb?page=/UrgentToDo"
|
111
|
+
to = 'chrismo@clabs.org'
|
112
|
+
msg_id = "#{subj.scan(/[A-Za-z0-9]/).to_s}@clabs.org"
|
113
|
+
do_sendmail(to, 'chrismo@clabs.org', subj, body, msg_id)
|
114
|
+
puts 'sent ' + subj + "\n" +
|
115
|
+
('-' * (subj.length + 5)) + "\n" +
|
116
|
+
body + "\n" if @verbose
|
117
|
+
end
|
118
|
+
}
|
119
|
+
end
|
120
|
+
|
121
|
+
def parse_tcommand_for_wiki_pages(tcommand)
|
122
|
+
content = ''
|
123
|
+
content << tcommand + "\n\n"
|
124
|
+
formatter = ClWikiPageFormatter.new(tcommand, '/UrgentToDo')
|
125
|
+
formatter.formatLinks do |word|
|
126
|
+
if formatter.isWikiName?(word)
|
127
|
+
wiki_page_name = word
|
128
|
+
ref_page_full_name = formatter.expand_path(wiki_page_name, '/UrgentToDo')
|
129
|
+
puts ref_page_full_name
|
130
|
+
if ClWikiPage.page_exists?(ref_page_full_name)
|
131
|
+
ref_page = ClWikiPage.new(ref_page_full_name, $wiki_path)
|
132
|
+
ref_page.read_raw_content
|
133
|
+
content << ref_page_full_name << "\n" <<
|
134
|
+
('-' * ref_page_full_name.length) << "\n\n" <<
|
135
|
+
ref_page.raw_content << "\n"
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
content
|
140
|
+
end
|
141
|
+
|
142
|
+
def initialize(crontabFilename,verbose=false)
|
143
|
+
@crontabAge = 0
|
144
|
+
@lines = 0
|
145
|
+
@verbose = verbose
|
146
|
+
@crontabFilename = crontabFilename
|
147
|
+
end
|
148
|
+
|
149
|
+
def str_to_time(str)
|
150
|
+
begin
|
151
|
+
Time.local(*([ParseDate.parsedate(str)[0..4], 0].flatten))
|
152
|
+
rescue => e
|
153
|
+
puts(str.inspect)
|
154
|
+
raise e
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def time_to_str(time)
|
159
|
+
time.strftime("%m/%d/%Y %H:%M")
|
160
|
+
end
|
161
|
+
|
162
|
+
def run()
|
163
|
+
if @verbose
|
164
|
+
print "\n\nDO NOT CLOSE THIS WINDOW!\n\n"
|
165
|
+
end
|
166
|
+
while (true)
|
167
|
+
if @crontabAge != File.mtime(@crontabFilename)
|
168
|
+
loadCrontab()
|
169
|
+
end
|
170
|
+
|
171
|
+
if $debug
|
172
|
+
testAndLaunch(Time.now)
|
173
|
+
else
|
174
|
+
# we do this to strip the seconds off for pure minute comparisons
|
175
|
+
now = str_to_time(time_to_str(Time.now))
|
176
|
+
|
177
|
+
lastrun_fn = 'cron.reminders.lastrun'
|
178
|
+
if File.exists?(lastrun_fn)
|
179
|
+
lastruntime = File.readlines(lastrun_fn)[0]
|
180
|
+
if lastruntime.nil?
|
181
|
+
File.delete(lastrun_fn)
|
182
|
+
next
|
183
|
+
end
|
184
|
+
lastrun = str_to_time(lastruntime.chomp)
|
185
|
+
else
|
186
|
+
# default to starting a week ago, that should be enough catchup
|
187
|
+
lastrun = now - (60 * 60 * 24 * 7)
|
188
|
+
end
|
189
|
+
nextrun = lastrun + (60)
|
190
|
+
catchup = false
|
191
|
+
if nextrun < now
|
192
|
+
catchup = true
|
193
|
+
time_do = nextrun
|
194
|
+
elsif nextrun == now
|
195
|
+
time_do = now
|
196
|
+
else
|
197
|
+
time_do = nil
|
198
|
+
end
|
199
|
+
if time_do
|
200
|
+
puts 'catching up ' + time_to_str(time_do) if catchup
|
201
|
+
#puts 'doing ' + time_to_str(time_do) if @verbose
|
202
|
+
testAndLaunch(time_do)
|
203
|
+
File.open(lastrun_fn, 'w') do |f| f.puts time_to_str(time_do) end
|
204
|
+
end
|
205
|
+
sleep (60) if !catchup
|
206
|
+
end
|
207
|
+
break if $debug
|
208
|
+
end
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
def do_sendmail(to, from, subj, body, msg_id)
|
213
|
+
smtp = MoSmtp.new
|
214
|
+
smtp.subj = subj
|
215
|
+
smtp.body = body
|
216
|
+
smtp.extra_headers = ["In-Reply-To: #{msg_id}", "References: #{msg_id}"]
|
217
|
+
smtp.sendmail
|
218
|
+
end
|
219
|
+
|
220
|
+
|
221
|
+
if __FILE__ == $0
|
222
|
+
begin
|
223
|
+
$debug = if_switch('-d')
|
224
|
+
$wiki_path = get_switch('-wp')
|
225
|
+
raise 'no wikiPath specified' if !$wiki_path
|
226
|
+
$wiki_conf = ClWikiConfiguration.new
|
227
|
+
$wiki_conf.useIndex = ClWikiConfiguration::USE_INDEX_NO
|
228
|
+
crontabFilename = 'c:/Dev/svn.momo/cweb/wikirep/UrgentToDo.txt';
|
229
|
+
Cron.new(crontabFilename, true).run()
|
230
|
+
rescue Exception => e
|
231
|
+
msgsummary = e.message + "\n" + e.backtrace.join("\n")
|
232
|
+
File.open('cron.reminders.err.txt', 'a+') do |f|
|
233
|
+
f.puts Time.now.to_s
|
234
|
+
f.puts msgsummary
|
235
|
+
end
|
236
|
+
do_sendmail('chrismo@clabs.org', 'chrismo@clabs.org', 'cron.reminders err',
|
237
|
+
msgsummary, "remindererr@clabs.org")
|
238
|
+
puts msgsummary
|
239
|
+
end
|
240
|
+
system 'pause'
|
241
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'ftools'
|
2
|
+
|
3
|
+
files = File.readlines('pagestomove.txt')
|
4
|
+
srcdir = 'W:/WikiRepository/fotwiki'
|
5
|
+
destdir = File.join(srcdir, 'DocuTIMEEmpACT', 'IncidentBase')
|
6
|
+
files.collect! do |fn| File.join(srcdir, fn.chomp!) + '.txt' end
|
7
|
+
files.each do |fn|
|
8
|
+
File.copy fn, fn + '.bak'
|
9
|
+
filecontent = File.readlines(fn)
|
10
|
+
destfn = File.join(destdir, File.basename(fn))
|
11
|
+
File.open(destfn, 'w+') do |fout|
|
12
|
+
fout.puts filecontent
|
13
|
+
end
|
14
|
+
File.open(fn, 'w+') do |fout|
|
15
|
+
fout.puts 'see //DocuTIMEEmpACT/IncidentBase/' + File.basename(fn, '.txt')
|
16
|
+
end
|
17
|
+
puts 'destfn: ' + destfn
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
# note: this works for easy moves - but with the hierarchy
|
22
|
+
# complications in terms of links inside the content, a good
|
23
|
+
# first move would be to convert to absolute paths in all
|
24
|
+
# wiki pages referenced in content of pages being moved.
|
25
|
+
# Then replace any links in moving content appropriately.
|
26
|
+
|
27
|
+
# see clwikipage.rb.convert_relative_wikinames_to_absolute
|
@@ -0,0 +1,56 @@
|
|
1
|
+
20000627LasVegasNv
|
2
|
+
20010313ArlingtonTx
|
3
|
+
20010320ArlingtonTx
|
4
|
+
20010327CorporateGateway
|
5
|
+
20010402CorporateGateway
|
6
|
+
20010410CorporateGateway
|
7
|
+
20010416ArlingtonTx
|
8
|
+
20010423CorporateGateway
|
9
|
+
20010425CorporateGateway
|
10
|
+
20010605CorporateGateway
|
11
|
+
20010608LasVegasNv
|
12
|
+
20010626OverlandPark
|
13
|
+
20010723WhitePlains
|
14
|
+
20010807ArlingtonTx
|
15
|
+
20010821LasVegasNv
|
16
|
+
20010904LasVegasNv
|
17
|
+
20010917ArlingtonTx
|
18
|
+
20011002LasVegasNv
|
19
|
+
20011119LasVegasNv
|
20
|
+
20011127LasVegasNv
|
21
|
+
20011127CorporateGateway
|
22
|
+
20011128WhitePlains
|
23
|
+
20020205Dfw01Sql
|
24
|
+
20020211LasVegasNv
|
25
|
+
20020326WhitePlains
|
26
|
+
20020416LasVegasNv
|
27
|
+
20020506LasVegasNv
|
28
|
+
20020515WhitePlains
|
29
|
+
20020528LasVegasNv
|
30
|
+
20020708CorporateGateway
|
31
|
+
20020715ArlingtonTx
|
32
|
+
20020715CorporateGateway
|
33
|
+
20020722LasVegasNv
|
34
|
+
20020729WhitePlains
|
35
|
+
20020729CorporateGateway
|
36
|
+
20020730WhitePlains
|
37
|
+
20020828CorporateGateway
|
38
|
+
20020909CorporateGateway
|
39
|
+
20020911WhitePlains
|
40
|
+
20020916OverlandPark
|
41
|
+
20020917KalamazooMi
|
42
|
+
20020918KalamazooMi
|
43
|
+
20020924KalamazooMi
|
44
|
+
20020930KalamazooMi
|
45
|
+
20021001KalamazooMi
|
46
|
+
20021105CorporateGateway
|
47
|
+
20021119MemphisTn
|
48
|
+
20021202OverlandPark
|
49
|
+
20021202bOverlandPark
|
50
|
+
20021204CorporateGateway
|
51
|
+
20021216CorporateSears
|
52
|
+
20021216bCorporateSears
|
53
|
+
20021217KalamazooMi
|
54
|
+
20021217ArlingtonTx
|
55
|
+
20021218CorporateSears
|
56
|
+
20021223ArlingtonTx
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# $Id: clWiki.rb,v 1.2 2005/02/19 04:39:10 chrismo Exp $
|
2
|
+
=begin
|
3
|
+
---------------------------------------------------------------------------
|
4
|
+
Copyright (c) 2001-2004, Chris Morris
|
5
|
+
All rights reserved.
|
6
|
+
|
7
|
+
Redistribution and use in source and binary forms, with or without
|
8
|
+
modification, are permitted provided that the following conditions are met:
|
9
|
+
|
10
|
+
1. Redistributions of source code must retain the above copyright notice,
|
11
|
+
this list of conditions and the following disclaimer.
|
12
|
+
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright
|
14
|
+
notice, this list of conditions and the following disclaimer in the
|
15
|
+
documentation and/or other materials provided with the distribution.
|
16
|
+
|
17
|
+
3. Neither the names Chris Morris, cLabs nor the names of contributors to
|
18
|
+
this software may be used to endorse or promote products derived from this
|
19
|
+
software without specific prior written permission.
|
20
|
+
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
22
|
+
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
23
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
24
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
25
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
26
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
27
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
28
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
29
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
30
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
31
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
|
+
--------------------------------------------------------------------------
|
33
|
+
(based on BSD Open Source License)
|
34
|
+
=end
|
35
|
+
|
36
|
+
CLWIKI_PATH = "C:/Apache/Apache2/htdocs/clwiki/"
|
37
|
+
CLWIKI_URL = '/clwiki/clwikicgi.rb'
|
38
|
+
$: << CLWIKI_PATH
|
39
|
+
|
40
|
+
require 'clwikipage'
|
41
|
+
require 'clwikiconf'
|
42
|
+
|
43
|
+
class ClWikiConvertor < BaseConvertor
|
44
|
+
handles "txt"
|
45
|
+
|
46
|
+
def convert_html(file_entry, f, all_entries)
|
47
|
+
ClWikiConfiguration.load_xml(File.join(CLWIKI_PATH, $defaultConfFile))
|
48
|
+
$wiki_conf.cgifn = CLWIKI_URL
|
49
|
+
page_name = file_entry.file_name.sub($wiki_path, '')
|
50
|
+
page_name.sub!($wikiPageExt, '')
|
51
|
+
page = ClWikiPage.new(page_name)
|
52
|
+
page.read_content(false)
|
53
|
+
title = page_name.split('/')[-1]
|
54
|
+
title.gsub!(/([^A-Z])([A-Z])/, '\1 \2')
|
55
|
+
title.gsub!(/([^0-9])([0-9])/, '\1 \2')
|
56
|
+
title.gsub!(/_/, ' ')
|
57
|
+
title = "<a href='#{$wiki_conf.cgifn}?page=#{page_name}'>#{title}</a>"
|
58
|
+
body = page.content
|
59
|
+
HTMLEntry.new(title, body, self)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
@@ -0,0 +1,58 @@
|
|
1
|
+
$LOAD_PATH << '..'
|
2
|
+
require 'clwikipage'
|
3
|
+
require 'cl/util/console'
|
4
|
+
require 'cl/util/smtp'
|
5
|
+
|
6
|
+
PageDepth = Struct.new("PageDepth", :name, :depth)
|
7
|
+
|
8
|
+
def read_page(pageName)
|
9
|
+
content = ''
|
10
|
+
@stack.push PageDepth.new(pageName, 0)
|
11
|
+
while !@stack.empty?
|
12
|
+
pageDepth = @stack.shift
|
13
|
+
@depth = pageDepth.depth
|
14
|
+
pageName = pageDepth.name
|
15
|
+
|
16
|
+
if @depth <= @depthLimit
|
17
|
+
content << "\n" + pageName + "\n" + ("=" * pageName.length) + "\n"
|
18
|
+
page = ClWikiPage.new(pageName, @wikiPath)
|
19
|
+
page.read_raw_content
|
20
|
+
formatter = ClWikiPageFormatter.new(page.raw_content, pageName)
|
21
|
+
content << formatter.formatLinks do |word|
|
22
|
+
if formatter.isWikiName?(word)
|
23
|
+
wikiPageName = word
|
24
|
+
wikiPageName = '/' + wikiPageName if wikiPageName[0..0] != '/'
|
25
|
+
if !@visited.include?(wikiPageName)
|
26
|
+
@visited << wikiPageName
|
27
|
+
@stack.push PageDepth.new(wikiPageName, @depth + 1)
|
28
|
+
end
|
29
|
+
wikiPageName
|
30
|
+
else
|
31
|
+
word
|
32
|
+
end
|
33
|
+
end
|
34
|
+
content << "\n"
|
35
|
+
end
|
36
|
+
@stack.delete_if { |pgd| pgd.name =~ /journal/i }
|
37
|
+
end
|
38
|
+
content
|
39
|
+
end
|
40
|
+
|
41
|
+
def show_help
|
42
|
+
puts '-pn Page name. Must be full path.'
|
43
|
+
puts '-wp Wiki path.'
|
44
|
+
end
|
45
|
+
|
46
|
+
@visited = []
|
47
|
+
@stack = []
|
48
|
+
@depthLimit = 2
|
49
|
+
@depth = 0
|
50
|
+
pageName = get_switch('-pn')
|
51
|
+
@wikiPath = get_switch('-wp')
|
52
|
+
content = read_page(pageName)
|
53
|
+
puts content
|
54
|
+
puts
|
55
|
+
File.open('singlepage.out.txt', 'w+') do |f| f.puts content end
|
56
|
+
|
57
|
+
|
58
|
+
|