Class: ExistDB::SystemProperties
- Inherits:
-
Object
- Object
- ExistDB::SystemProperties
- Defined in:
- lib/existdb.rb
Class Method Summary collapse
- .autocreate_config_files ⇒ Object
- .autocreate_data_directory ⇒ Object
- .data_directory ⇒ Object
- .home_directory ⇒ Object
- .init ⇒ Object
- .log_directory ⇒ Object
Class Method Details
.autocreate_config_files ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/existdb.rb', line 33 def autocreate_config_files # Copy the config files to the places where eXist will eXpect them. # the log4j.xml file should be on your classpath to ensure proper logging [ 'conf.xml', 'log4j.xml' ].each do |config_file| src = "#{File.dirname(__FILE__)}/../#{config_file}" dest = "#{home_directory}/#{config_file}" FileUtils.copy(src, dest) if not File.exists?(dest) end end |
.autocreate_data_directory ⇒ Object
43 44 45 |
# File 'lib/existdb.rb', line 43 def autocreate_data_directory FileUtils.mkdir_p data_directory end |
.data_directory ⇒ Object
24 25 26 |
# File 'lib/existdb.rb', line 24 def data_directory home_directory + '/data' end |
.home_directory ⇒ Object
16 17 18 |
# File 'lib/existdb.rb', line 16 def home_directory defined?(EXIST_HOME) && EXIST_HOME || ENV['EXIST_HOME'] || '/var/spool/existdb' end |
.init ⇒ Object
28 29 30 31 |
# File 'lib/existdb.rb', line 28 def init java.lang.System.setProperty('exist.home', home_directory) java.lang.System.setProperty('exist.logdir', log_directory) end |
.log_directory ⇒ Object
20 21 22 |
# File 'lib/existdb.rb', line 20 def log_directory defined?(EXIST_LOG) && EXIST_LOG || ENV['EXIST_LOG'] || '/var/log/existdb' end |