instiki 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +174 -165
- data/README +68 -68
- data/app/controllers/admin_controller.rb +94 -94
- data/app/controllers/application.rb +135 -131
- data/app/controllers/file_controller.rb +129 -129
- data/app/controllers/wiki_controller.rb +354 -354
- data/app/helpers/application_helper.rb +68 -68
- data/app/models/author.rb +3 -3
- data/app/models/chunks/category.rb +33 -33
- data/app/models/chunks/chunk.rb +86 -86
- data/app/models/chunks/engines.rb +61 -54
- data/app/models/chunks/include.rb +41 -41
- data/app/models/chunks/literal.rb +31 -31
- data/app/models/chunks/nowiki.rb +28 -28
- data/app/models/chunks/test.rb +18 -18
- data/app/models/chunks/uri.rb +182 -182
- data/app/models/chunks/wiki.rb +141 -141
- data/app/models/file_yard.rb +58 -58
- data/app/models/page.rb +112 -112
- data/app/models/page_lock.rb +22 -22
- data/app/models/page_set.rb +89 -89
- data/app/models/revision.rb +123 -123
- data/app/models/web.rb +182 -176
- data/app/models/wiki_content.rb +207 -207
- data/app/models/wiki_service.rb +233 -233
- data/app/models/wiki_words.rb +23 -23
- data/app/views/admin/create_system.rhtml +83 -83
- data/app/views/admin/create_web.rhtml +69 -69
- data/app/views/admin/edit_web.rhtml +137 -136
- data/app/views/file/file.rhtml +18 -18
- data/app/views/file/import.rhtml +22 -22
- data/app/views/layouts/default.rhtml +86 -85
- data/app/views/markdown_help.rhtml +12 -12
- data/app/views/mixed_help.rhtml +6 -6
- data/app/views/navigation.rhtml +30 -30
- data/app/views/rdoc_help.rhtml +12 -12
- data/app/views/textile_help.rhtml +24 -24
- data/app/views/wiki/authors.rhtml +11 -11
- data/app/views/wiki/edit.rhtml +39 -39
- data/app/views/wiki/export.rhtml +12 -12
- data/app/views/wiki/feeds.rhtml +14 -14
- data/app/views/wiki/list.rhtml +64 -64
- data/app/views/wiki/locked.rhtml +23 -23
- data/app/views/wiki/login.rhtml +14 -14
- data/app/views/wiki/new.rhtml +31 -31
- data/app/views/wiki/page.rhtml +115 -115
- data/app/views/wiki/print.rhtml +14 -14
- data/app/views/wiki/published.rhtml +9 -9
- data/app/views/wiki/recently_revised.rhtml +26 -26
- data/app/views/wiki/revision.rhtml +103 -103
- data/app/views/wiki/rollback.rhtml +36 -36
- data/app/views/wiki/rss_feed.rhtml +22 -22
- data/app/views/wiki/search.rhtml +38 -38
- data/app/views/wiki/tex.rhtml +22 -22
- data/app/views/wiki/tex_web.rhtml +34 -34
- data/app/views/wiki/web_list.rhtml +18 -18
- data/app/views/wiki_words_help.rhtml +9 -9
- data/config/environment.rb +82 -82
- data/config/environments/development.rb +5 -5
- data/config/environments/production.rb +4 -4
- data/config/environments/test.rb +17 -17
- data/config/routes.rb +18 -18
- data/lib/active_record_stub.rb +31 -31
- data/lib/bluecloth_tweaked.rb +1127 -0
- data/lib/diff.rb +444 -444
- data/lib/instiki_errors.rb +14 -14
- data/lib/rdocsupport.rb +151 -151
- data/lib/redcloth_for_tex.rb +736 -736
- data/natives/osx/desktop_launcher/AppDelegate.h +18 -18
- data/natives/osx/desktop_launcher/AppDelegate.mm +109 -109
- data/natives/osx/desktop_launcher/Credits.html +15 -15
- data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/classes.nib +12 -12
- data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/info.nib +24 -24
- data/natives/osx/desktop_launcher/Info.plist +12 -12
- data/natives/osx/desktop_launcher/Instiki.xcode/project.pbxproj +592 -592
- data/natives/osx/desktop_launcher/Instiki_Prefix.pch +7 -7
- data/natives/osx/desktop_launcher/MakeDMG.sh +9 -9
- data/natives/osx/desktop_launcher/main.mm +14 -14
- data/natives/osx/desktop_launcher/version.plist +16 -16
- data/public/404.html +5 -5
- data/public/500.html +5 -5
- data/public/dispatch.rb +9 -9
- data/public/javascripts/edit_web.js +52 -52
- data/public/javascripts/prototype.js +336 -336
- data/public/stylesheets/instiki.css +222 -222
- data/script/breakpointer +4 -4
- data/script/server +93 -93
- metadata +4 -3
data/app/views/wiki/tex.rhtml
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
\documentclass[12pt,titlepage]{article}
|
2
|
-
|
3
|
-
\usepackage[danish]{babel} %danske tekster
|
4
|
-
\usepackage[OT1]{fontenc} %rigtige danske bogstaver...
|
5
|
-
\usepackage{a4}
|
6
|
-
\usepackage{graphicx}
|
7
|
-
\usepackage{ucs}
|
8
|
-
\usepackage[utf8x]{inputenc}
|
9
|
-
\input epsf
|
10
|
-
|
11
|
-
%-------------------------------------------------------------------
|
12
|
-
|
13
|
-
\begin{document}
|
14
|
-
|
15
|
-
\sloppy
|
16
|
-
|
17
|
-
%-------------------------------------------------------------------
|
18
|
-
|
19
|
-
\section*{<%= @page.name %>}
|
20
|
-
|
21
|
-
<%= @tex_content %>
|
22
|
-
|
1
|
+
\documentclass[12pt,titlepage]{article}
|
2
|
+
|
3
|
+
\usepackage[danish]{babel} %danske tekster
|
4
|
+
\usepackage[OT1]{fontenc} %rigtige danske bogstaver...
|
5
|
+
\usepackage{a4}
|
6
|
+
\usepackage{graphicx}
|
7
|
+
\usepackage{ucs}
|
8
|
+
\usepackage[utf8x]{inputenc}
|
9
|
+
\input epsf
|
10
|
+
|
11
|
+
%-------------------------------------------------------------------
|
12
|
+
|
13
|
+
\begin{document}
|
14
|
+
|
15
|
+
\sloppy
|
16
|
+
|
17
|
+
%-------------------------------------------------------------------
|
18
|
+
|
19
|
+
\section*{<%= @page.name %>}
|
20
|
+
|
21
|
+
<%= @tex_content %>
|
22
|
+
|
23
23
|
\end{document}
|
@@ -1,35 +1,35 @@
|
|
1
|
-
\documentclass[12pt,titlepage]{article}
|
2
|
-
|
3
|
-
\usepackage{fancyhdr}
|
4
|
-
\pagestyle{fancy}
|
5
|
-
|
6
|
-
\fancyhead[LE,RO]{}
|
7
|
-
\fancyhead[LO,RE]{\nouppercase{\bfseries \leftmark}}
|
8
|
-
\fancyfoot[C]{\thepage}
|
9
|
-
|
10
|
-
\usepackage[danish]{babel} %danske tekster
|
11
|
-
\usepackage{a4}
|
12
|
-
\usepackage{graphicx}
|
13
|
-
\usepackage{ucs}
|
14
|
-
\usepackage[utf8]{inputenc}
|
15
|
-
\input epsf
|
16
|
-
|
17
|
-
|
18
|
-
%-------------------------------------------------------------------
|
19
|
-
|
20
|
-
\title{<%= @web_name %>}
|
21
|
-
|
22
|
-
\begin{document}
|
23
|
-
|
24
|
-
\maketitle
|
25
|
-
|
26
|
-
\tableofcontents
|
27
|
-
\pagebreak
|
28
|
-
|
29
|
-
\sloppy
|
30
|
-
|
31
|
-
%-------------------------------------------------------------------
|
32
|
-
|
33
|
-
<%= @tex_content %>
|
34
|
-
|
1
|
+
\documentclass[12pt,titlepage]{article}
|
2
|
+
|
3
|
+
\usepackage{fancyhdr}
|
4
|
+
\pagestyle{fancy}
|
5
|
+
|
6
|
+
\fancyhead[LE,RO]{}
|
7
|
+
\fancyhead[LO,RE]{\nouppercase{\bfseries \leftmark}}
|
8
|
+
\fancyfoot[C]{\thepage}
|
9
|
+
|
10
|
+
\usepackage[danish]{babel} %danske tekster
|
11
|
+
\usepackage{a4}
|
12
|
+
\usepackage{graphicx}
|
13
|
+
\usepackage{ucs}
|
14
|
+
\usepackage[utf8]{inputenc}
|
15
|
+
\input epsf
|
16
|
+
|
17
|
+
|
18
|
+
%-------------------------------------------------------------------
|
19
|
+
|
20
|
+
\title{<%= @web_name %>}
|
21
|
+
|
22
|
+
\begin{document}
|
23
|
+
|
24
|
+
\maketitle
|
25
|
+
|
26
|
+
\tableofcontents
|
27
|
+
\pagebreak
|
28
|
+
|
29
|
+
\sloppy
|
30
|
+
|
31
|
+
%-------------------------------------------------------------------
|
32
|
+
|
33
|
+
<%= @tex_content %>
|
34
|
+
|
35
35
|
\end{document}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
<% @title = "Wiki webs" %>
|
2
|
-
|
3
|
-
<ul>
|
4
|
-
<% @webs.each do |web| %>
|
5
|
-
<li>
|
6
|
-
<% if web.published %>
|
7
|
-
<%= link_to_page 'HomePage', web, web.name, :mode => 'publish' %>
|
8
|
-
(read-only) /
|
9
|
-
<%= link_to_page 'HomePage', web, 'editable version', :mode => 'show' %> (requires login)
|
10
|
-
<% else %>
|
11
|
-
<%= link_to_page 'HomePage', web, web.name, :mode => 'show' %>
|
12
|
-
<% end %>
|
13
|
-
<div class="byline" style="margin-bottom: 0px">
|
14
|
-
<%= web.pages.length %> pages by <%= web.authors.length %> authors
|
15
|
-
</div>
|
16
|
-
</li>
|
17
|
-
<% end %>
|
18
|
-
</ul>
|
1
|
+
<% @title = "Wiki webs" %>
|
2
|
+
|
3
|
+
<ul>
|
4
|
+
<% @webs.each do |web| %>
|
5
|
+
<li>
|
6
|
+
<% if web.published %>
|
7
|
+
<%= link_to_page 'HomePage', web, web.name, :mode => 'publish' %>
|
8
|
+
(read-only) /
|
9
|
+
<%= link_to_page 'HomePage', web, 'editable version', :mode => 'show' %> (requires login)
|
10
|
+
<% else %>
|
11
|
+
<%= link_to_page 'HomePage', web, web.name, :mode => 'show' %>
|
12
|
+
<% end %>
|
13
|
+
<div class="byline" style="margin-bottom: 0px">
|
14
|
+
<%= web.pages.length %> pages by <%= web.authors.length %> authors
|
15
|
+
</div>
|
16
|
+
</li>
|
17
|
+
<% end %>
|
18
|
+
</ul>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<h3>Wiki words</h3>
|
2
|
-
<p style="border-top: 1px dotted #ccc; margin-top: 0px">
|
3
|
-
Two or more uppercase words stuck together (camel case) or any phrase surrounded by double
|
4
|
-
brackets is a wiki word. A camel-case wiki word can be escaped by putting \ in front of it.
|
5
|
-
</p>
|
6
|
-
<p>
|
7
|
-
Wiki words: <i>HomePage, ThreeWordsTogether, [[C++]], [[Let's play again!]]</i><br/>
|
8
|
-
Not wiki words: <i>IBM, School</i>
|
9
|
-
</p>
|
1
|
+
<h3>Wiki words</h3>
|
2
|
+
<p style="border-top: 1px dotted #ccc; margin-top: 0px">
|
3
|
+
Two or more uppercase words stuck together (camel case) or any phrase surrounded by double
|
4
|
+
brackets is a wiki word. A camel-case wiki word can be escaped by putting \ in front of it.
|
5
|
+
</p>
|
6
|
+
<p>
|
7
|
+
Wiki words: <i>HomePage, ThreeWordsTogether, [[C++]], [[Let's play again!]]</i><br/>
|
8
|
+
Not wiki words: <i>IBM, School</i>
|
9
|
+
</p>
|
data/config/environment.rb
CHANGED
@@ -1,82 +1,82 @@
|
|
1
|
-
if RUBY_VERSION < '1.8.1'
|
2
|
-
puts 'Instiki requires Ruby 1.8.1+'
|
3
|
-
exit
|
4
|
-
end
|
5
|
-
|
6
|
-
# Enable UTF-8 support
|
7
|
-
$KCODE = 'u'
|
8
|
-
require 'jcode'
|
9
|
-
|
10
|
-
RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/../') unless defined? RAILS_ROOT
|
11
|
-
RAILS_ENV = ENV['RAILS_ENV'] || 'production' unless defined? RAILS_ENV
|
12
|
-
|
13
|
-
unless defined? ADDITIONAL_LOAD_PATHS
|
14
|
-
# Mocks first.
|
15
|
-
ADDITIONAL_LOAD_PATHS = ["#{RAILS_ROOT}/test/mocks/#{RAILS_ENV}"]
|
16
|
-
|
17
|
-
# Then model subdirectories.
|
18
|
-
ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"])
|
19
|
-
ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/components/[_a-z]*"])
|
20
|
-
|
21
|
-
# Followed by the standard includes.
|
22
|
-
ADDITIONAL_LOAD_PATHS.concat %w(
|
23
|
-
app
|
24
|
-
app/models
|
25
|
-
app/controllers
|
26
|
-
app/helpers
|
27
|
-
app/apis
|
28
|
-
components
|
29
|
-
config
|
30
|
-
lib
|
31
|
-
vendor
|
32
|
-
vendor/rails/railties
|
33
|
-
vendor/rails/railties/lib
|
34
|
-
vendor/rails/actionpack/lib
|
35
|
-
vendor/rails/activesupport/lib
|
36
|
-
vendor/rails/activerecord/lib
|
37
|
-
vendor/rails/actionmailer/lib
|
38
|
-
vendor/rails/actionwebservice/lib
|
39
|
-
vendor/madeleine-0.7.1/lib
|
40
|
-
vendor/RedCloth-3.0.3/lib
|
41
|
-
vendor/rubyzip-0.5.
|
42
|
-
).map { |dir| "#{File.expand_path(File.join(RAILS_ROOT, dir))}"
|
43
|
-
}.delete_if { |dir| not File.exist?(dir) }
|
44
|
-
|
45
|
-
# Prepend to $LOAD_PATH
|
46
|
-
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) }
|
47
|
-
end
|
48
|
-
|
49
|
-
# Require Rails libraries.
|
50
|
-
require 'rubygems' unless File.directory?("#{RAILS_ROOT}/vendor/rails")
|
51
|
-
|
52
|
-
require 'active_support'
|
53
|
-
require 'action_controller'
|
54
|
-
|
55
|
-
require_dependency 'instiki_errors'
|
56
|
-
require_dependency 'active_record_stub'
|
57
|
-
|
58
|
-
# Environment specific configuration
|
59
|
-
require_dependency "environments/#{RAILS_ENV}"
|
60
|
-
|
61
|
-
# Configure defaults if the included environment did not.
|
62
|
-
unless defined? RAILS_DEFAULT_LOGGER
|
63
|
-
RAILS_DEFAULT_LOGGER = Logger.new(STDERR)
|
64
|
-
ActionController::Base.logger ||= RAILS_DEFAULT_LOGGER
|
65
|
-
if defined? INSTIKI_DEBUG_LOG and INSTIKI_DEBUG_LOG
|
66
|
-
RAILS_DEFAULT_LOGGER.level = Logger::DEBUG
|
67
|
-
ActionController::Base.logger.level = Logger::DEBUG
|
68
|
-
else
|
69
|
-
RAILS_DEFAULT_LOGGER.level = Logger::INFO
|
70
|
-
ActionController::Base.logger.level = Logger::INFO
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
ActionController::Base.template_root ||= "#{RAILS_ROOT}/app/views/"
|
75
|
-
ActionController::Routing::Routes.reload
|
76
|
-
Controllers = Dependencies::LoadingModule.root(
|
77
|
-
File.join(RAILS_ROOT, 'app', 'controllers'),
|
78
|
-
File.join(RAILS_ROOT, 'components')
|
79
|
-
)
|
80
|
-
|
81
|
-
require 'wiki_service'
|
82
|
-
Socket.do_not_reverse_lookup = true
|
1
|
+
if RUBY_VERSION < '1.8.1'
|
2
|
+
puts 'Instiki requires Ruby 1.8.1+'
|
3
|
+
exit
|
4
|
+
end
|
5
|
+
|
6
|
+
# Enable UTF-8 support
|
7
|
+
$KCODE = 'u'
|
8
|
+
require 'jcode'
|
9
|
+
|
10
|
+
RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/../') unless defined? RAILS_ROOT
|
11
|
+
RAILS_ENV = ENV['RAILS_ENV'] || 'production' unless defined? RAILS_ENV
|
12
|
+
|
13
|
+
unless defined? ADDITIONAL_LOAD_PATHS
|
14
|
+
# Mocks first.
|
15
|
+
ADDITIONAL_LOAD_PATHS = ["#{RAILS_ROOT}/test/mocks/#{RAILS_ENV}"]
|
16
|
+
|
17
|
+
# Then model subdirectories.
|
18
|
+
ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"])
|
19
|
+
ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/components/[_a-z]*"])
|
20
|
+
|
21
|
+
# Followed by the standard includes.
|
22
|
+
ADDITIONAL_LOAD_PATHS.concat %w(
|
23
|
+
app
|
24
|
+
app/models
|
25
|
+
app/controllers
|
26
|
+
app/helpers
|
27
|
+
app/apis
|
28
|
+
components
|
29
|
+
config
|
30
|
+
lib
|
31
|
+
vendor
|
32
|
+
vendor/rails/railties
|
33
|
+
vendor/rails/railties/lib
|
34
|
+
vendor/rails/actionpack/lib
|
35
|
+
vendor/rails/activesupport/lib
|
36
|
+
vendor/rails/activerecord/lib
|
37
|
+
vendor/rails/actionmailer/lib
|
38
|
+
vendor/rails/actionwebservice/lib
|
39
|
+
vendor/madeleine-0.7.1/lib
|
40
|
+
vendor/RedCloth-3.0.3/lib
|
41
|
+
vendor/rubyzip-0.5.8/lib
|
42
|
+
).map { |dir| "#{File.expand_path(File.join(RAILS_ROOT, dir))}"
|
43
|
+
}.delete_if { |dir| not File.exist?(dir) }
|
44
|
+
|
45
|
+
# Prepend to $LOAD_PATH
|
46
|
+
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) }
|
47
|
+
end
|
48
|
+
|
49
|
+
# Require Rails libraries.
|
50
|
+
require 'rubygems' unless File.directory?("#{RAILS_ROOT}/vendor/rails")
|
51
|
+
|
52
|
+
require 'active_support'
|
53
|
+
require 'action_controller'
|
54
|
+
|
55
|
+
require_dependency 'instiki_errors'
|
56
|
+
require_dependency 'active_record_stub'
|
57
|
+
|
58
|
+
# Environment specific configuration
|
59
|
+
require_dependency "environments/#{RAILS_ENV}"
|
60
|
+
|
61
|
+
# Configure defaults if the included environment did not.
|
62
|
+
unless defined? RAILS_DEFAULT_LOGGER
|
63
|
+
RAILS_DEFAULT_LOGGER = Logger.new(STDERR)
|
64
|
+
ActionController::Base.logger ||= RAILS_DEFAULT_LOGGER
|
65
|
+
if defined? INSTIKI_DEBUG_LOG and INSTIKI_DEBUG_LOG
|
66
|
+
RAILS_DEFAULT_LOGGER.level = Logger::DEBUG
|
67
|
+
ActionController::Base.logger.level = Logger::DEBUG
|
68
|
+
else
|
69
|
+
RAILS_DEFAULT_LOGGER.level = Logger::INFO
|
70
|
+
ActionController::Base.logger.level = Logger::INFO
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
ActionController::Base.template_root ||= "#{RAILS_ROOT}/app/views/"
|
75
|
+
ActionController::Routing::Routes.reload
|
76
|
+
Controllers = Dependencies::LoadingModule.root(
|
77
|
+
File.join(RAILS_ROOT, 'app', 'controllers'),
|
78
|
+
File.join(RAILS_ROOT, 'components')
|
79
|
+
)
|
80
|
+
|
81
|
+
require 'wiki_service'
|
82
|
+
Socket.do_not_reverse_lookup = true
|
@@ -1,5 +1,5 @@
|
|
1
|
-
Dependencies.mechanism = :require
|
2
|
-
ActionController::Base.consider_all_requests_local = true
|
3
|
-
ActionController::Base.perform_caching = false
|
4
|
-
BREAKPOINT_SERVER_PORT = 42531
|
5
|
-
INSTIKI_DEBUG_LOG = true unless defined? INSTIKI_DEBUG_LOG
|
1
|
+
Dependencies.mechanism = :require
|
2
|
+
ActionController::Base.consider_all_requests_local = true
|
3
|
+
ActionController::Base.perform_caching = false
|
4
|
+
BREAKPOINT_SERVER_PORT = 42531
|
5
|
+
INSTIKI_DEBUG_LOG = true unless defined? INSTIKI_DEBUG_LOG
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Dependencies.mechanism = :require
|
2
|
-
ActionController::Base.consider_all_requests_local = false
|
3
|
-
ActionController::Base.perform_caching = false
|
4
|
-
|
1
|
+
Dependencies.mechanism = :require
|
2
|
+
ActionController::Base.consider_all_requests_local = false
|
3
|
+
ActionController::Base.perform_caching = false
|
4
|
+
|
data/config/environments/test.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
Dependencies.mechanism = :require
|
2
|
-
ActionController::Base.consider_all_requests_local = true
|
3
|
-
ActionController::Base.perform_caching = false
|
4
|
-
|
5
|
-
require 'fileutils'
|
6
|
-
FileUtils.mkdir_p(RAILS_ROOT + "/log")
|
7
|
-
|
8
|
-
unless defined? TEST_LOGGER
|
9
|
-
timestamp = Time.now.strftime('%Y%m%d%H%M%S')
|
10
|
-
log_name = RAILS_ROOT + "/log/instiki_test.#{timestamp}.log"
|
11
|
-
$stderr.puts "To see the Rails log:\n less #{log_name}"
|
12
|
-
|
13
|
-
TEST_LOGGER = ActionController::Base.logger = Logger.new(log_name)
|
14
|
-
INSTIKI_DEBUG_LOG = true unless defined? INSTIKI_DEBUG_LOG
|
15
|
-
|
16
|
-
WikiService.storage_path = RAILS_ROOT + '/storage/test/'
|
17
|
-
end
|
1
|
+
Dependencies.mechanism = :require
|
2
|
+
ActionController::Base.consider_all_requests_local = true
|
3
|
+
ActionController::Base.perform_caching = false
|
4
|
+
|
5
|
+
require 'fileutils'
|
6
|
+
FileUtils.mkdir_p(RAILS_ROOT + "/log")
|
7
|
+
|
8
|
+
unless defined? TEST_LOGGER
|
9
|
+
timestamp = Time.now.strftime('%Y%m%d%H%M%S')
|
10
|
+
log_name = RAILS_ROOT + "/log/instiki_test.#{timestamp}.log"
|
11
|
+
$stderr.puts "To see the Rails log:\n less #{log_name}"
|
12
|
+
|
13
|
+
TEST_LOGGER = ActionController::Base.logger = Logger.new(log_name)
|
14
|
+
INSTIKI_DEBUG_LOG = true unless defined? INSTIKI_DEBUG_LOG
|
15
|
+
|
16
|
+
WikiService.storage_path = RAILS_ROOT + '/storage/test/'
|
17
|
+
end
|
data/config/routes.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
ActionController::Routing.draw do |map|
|
2
|
-
map.connect 'create_system', :controller => 'admin', :action => 'create_system'
|
3
|
-
map.connect 'create_web', :controller => 'admin', :action => 'create_web'
|
4
|
-
map.connect ':web/edit_web', :controller => 'admin', :action => 'edit_web'
|
5
|
-
map.connect 'remove_orphaned_pages', :controller => 'admin', :action => 'remove_orphaned_pages'
|
6
|
-
|
7
|
-
map.connect ':web/file/:id', :controller => 'file', :action => 'file'
|
8
|
-
map.connect ':web/pic/:id', :controller => 'file', :action => 'pic'
|
9
|
-
map.connect ':web/import/:id', :controller => 'file', :action => 'import'
|
10
|
-
|
11
|
-
map.connect ':web/login', :controller => 'wiki', :action => 'login'
|
12
|
-
map.connect 'web_list', :controller => 'wiki', :action => 'web_list'
|
13
|
-
map.connect ':web/web_list', :controller => 'wiki', :action => 'web_list'
|
14
|
-
map.connect ':web/:action/:id', :controller => 'wiki'
|
15
|
-
map.connect ':web/:action', :controller => 'wiki'
|
16
|
-
map.connect ':web', :controller => 'wiki', :action => 'index'
|
17
|
-
map.connect '', :controller => 'wiki', :action => 'index'
|
18
|
-
end
|
1
|
+
ActionController::Routing.draw do |map|
|
2
|
+
map.connect 'create_system', :controller => 'admin', :action => 'create_system'
|
3
|
+
map.connect 'create_web', :controller => 'admin', :action => 'create_web'
|
4
|
+
map.connect ':web/edit_web', :controller => 'admin', :action => 'edit_web'
|
5
|
+
map.connect 'remove_orphaned_pages', :controller => 'admin', :action => 'remove_orphaned_pages'
|
6
|
+
|
7
|
+
map.connect ':web/file/:id', :controller => 'file', :action => 'file'
|
8
|
+
map.connect ':web/pic/:id', :controller => 'file', :action => 'pic'
|
9
|
+
map.connect ':web/import/:id', :controller => 'file', :action => 'import'
|
10
|
+
|
11
|
+
map.connect ':web/login', :controller => 'wiki', :action => 'login'
|
12
|
+
map.connect 'web_list', :controller => 'wiki', :action => 'web_list'
|
13
|
+
map.connect ':web/web_list', :controller => 'wiki', :action => 'web_list'
|
14
|
+
map.connect ':web/:action/:id', :controller => 'wiki'
|
15
|
+
map.connect ':web/:action', :controller => 'wiki'
|
16
|
+
map.connect ':web', :controller => 'wiki', :action => 'index'
|
17
|
+
map.connect '', :controller => 'wiki', :action => 'index'
|
18
|
+
end
|
data/lib/active_record_stub.rb
CHANGED
@@ -1,31 +1,31 @@
|
|
1
|
-
# This project uses Railties, which has an external dependency on ActiveRecord
|
2
|
-
# Since ActiveRecord may not be present in Instiki runtime environment, this
|
3
|
-
# file provides a stub replacement for it
|
4
|
-
|
5
|
-
module ActiveRecord
|
6
|
-
class Base
|
7
|
-
|
8
|
-
# dependency in railties/lib/dispatcher.rb
|
9
|
-
def self.reset_column_information_and_inheritable_attributes_for_all_subclasses
|
10
|
-
# noop
|
11
|
-
end
|
12
|
-
|
13
|
-
# dependency in actionpack/lib/action_controller/benchmarking.rb
|
14
|
-
def self.connected?
|
15
|
-
false
|
16
|
-
end
|
17
|
-
|
18
|
-
# dependency in actionpack/lib/action_controller/benchmarking.rb
|
19
|
-
def self.connection
|
20
|
-
return ConnectionStub
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
|
25
|
-
module ConnectionStub
|
26
|
-
def self.reset_runtime
|
27
|
-
0
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
1
|
+
# This project uses Railties, which has an external dependency on ActiveRecord
|
2
|
+
# Since ActiveRecord may not be present in Instiki runtime environment, this
|
3
|
+
# file provides a stub replacement for it
|
4
|
+
|
5
|
+
module ActiveRecord
|
6
|
+
class Base
|
7
|
+
|
8
|
+
# dependency in railties/lib/dispatcher.rb
|
9
|
+
def self.reset_column_information_and_inheritable_attributes_for_all_subclasses
|
10
|
+
# noop
|
11
|
+
end
|
12
|
+
|
13
|
+
# dependency in actionpack/lib/action_controller/benchmarking.rb
|
14
|
+
def self.connected?
|
15
|
+
false
|
16
|
+
end
|
17
|
+
|
18
|
+
# dependency in actionpack/lib/action_controller/benchmarking.rb
|
19
|
+
def self.connection
|
20
|
+
return ConnectionStub
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
module ConnectionStub
|
26
|
+
def self.reset_runtime
|
27
|
+
0
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|