Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2009-10-28 00:25:15 -05:00
commit df509623ed
3 changed files with 22 additions and 1 deletions

View file

@ -59,6 +59,7 @@ require_dependency 'instiki_errors'
#require 'jcode'
require 'caching_stuff'
require 'logging_stuff'
#Additional Mime-types
mime_types = YAML.load_file(File.join(File.dirname(__FILE__), 'mime_types.yml'))

20
lib/logging_stuff.rb Normal file
View file

@ -0,0 +1,20 @@
class Logger
class LogDevice
private
def shift_log_age
#For Passenger, restart the server when rotating log files.
FileUtils.touch Rails.root.join("tmp", "restart.txt") if defined?(PhusionPassenger)
(@shift_age-3).downto(0) do |i|
if FileTest.exist?("#{@filename}.#{i}")
File.rename("#{@filename}.#{i}", "#{@filename}.#{i+1}")
end
end
@dev.close
File.rename("#{@filename}", "#{@filename}.0")
@dev = create_logfile(@filename)
return true
end
end
end

View file

@ -177,7 +177,7 @@ class UrlGenerator < AbstractUrlGenerator
def wikilink_for(mode, name, text, web_address)
web = Web.find_by_address(web_address)
action = web.published? && !(web == @web && ![:publish, :s5].include?(mode) ) ? 'published' : 'show'
action = web.published? && (web != @web || [:publish, :s5].include?(mode) ) ? 'published' : 'show'
href = @controller.url_for :controller => 'wiki', :web => web_address, :action => action,
:id => name, :only_path => true
%{<a class="existingWikiWord" href="#{href}">#{text}</a>}