lib/zena.rb in zena-0.15.0 vs lib/zena.rb in zena-0.15.1
- old
+ new
@@ -1,34 +1,27 @@
# FIXME: ========== cleanup and remove ====================
require 'yaml'
require 'date'
require 'fileutils'
+require File.join(File.dirname(__FILE__), 'zena', 'info')
-AUTHENTICATED_PREFIX = "oo"
-SITES_ROOT = "#{RAILS_ROOT}/sites"
-PASSWORD_SALT = "jf93jfnvnas09093nas0923" # type anything here (but change this line !)
-ZENA_CALENDAR_LANGS = ["en", "fr"] # FIXME: build this dynamically from existing files
def has_executable(*list)
list.inject(true) do |s,e|
s && !(`which #{e} || echo 'no #{e}'` =~ /^no #{e}/)
end
end
ENABLE_LATEX = true && has_executable('pdflatex') # enable LateX post-rendering
ENABLE_FOP = true && has_executable('fop', 'xsltproc') # enable xsl-fo post-rendering
ENABLE_MATH = true && has_executable('latex', 'dvips', 'convert', 'gs')
ENABLE_ZENA_UP = false && has_executable('zena_up')
-ENABLE_XSENDFILE = false
UPLOAD_KEY = defined?(Mongrel) ? 'upload_id' : "X-Progress-ID"
require 'bricks/patcher'
module Zena
- VERSION = '0.15.0'
- REVISION = 1336
- ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
-
+ # VERSION is defined in root.rb
class << self
attr_accessor :tools_enabled
def add_load_paths(config = nil)
paths_to_add = (
Dir["#{Zena::ROOT}/vendor/gems/*/lib"] +
@@ -178,11 +171,11 @@
end
end
# test if DRB started
-unless RAILS_ENV == 'test' || File.exist?(File.join(File.dirname(__FILE__), '..', 'log', 'upload_progress_drb.pid'))
- puts "\n** WARNING: drb server not running. Upload progress will not work."
+if RAILS_ENV == 'production' && defined?(Mongrel) && !File.exist?(File.join(File.dirname(__FILE__), '..', 'log', 'upload_progress_drb.pid'))
+ puts "\n** WARNING: drb server not running. Upload progress will not work using Mongrel."
puts " * WARNING: you should start the drb server with 'lib/upload_progress_server.rb start'\n\n"
end
unless File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml'))
FileUtils.cp(File.join(Zena::ROOT, 'config', 'database_example.yml'), File.join(RAILS_ROOT, 'config', 'database.yml'))