lib/conf/argv.rb in rsence-pre-2.2.0.5 vs lib/conf/argv.rb in rsence-pre-2.2.0.7

- old
+ new

@@ -218,11 +218,11 @@ exit end end if valid_env?(@args[:env_path]) conf_file = File.expand_path( File.join( @args[:env_path], 'conf', 'config.yaml' ) ) - @args[:conf_files].push( conf_file ) unless @args[:conf_files].include?( conf_file ) + @args[:conf_files].unshift( conf_file ) unless @args[:conf_files].include?( conf_file ) else invalid_env end @startable = true end @@ -410,11 +410,11 @@ invalid_option(arg,chr) end end elsif valid_env?(arg) @args[:env_path] = File.expand_path(arg) - @args[:conf_files].push( File.expand_path( File.join( arg, 'conf', 'config.yaml' ) ) ) + @args[:conf_files].unshift( File.expand_path( File.join( arg, 'conf', 'config.yaml' ) ) ) else invalid_env( arg ) end end end @@ -423,11 +423,11 @@ exit end end if valid_env?(@args[:env_path]) conf_file = File.expand_path( File.join( @args[:env_path], 'conf', 'config.yaml' ) ) - @args[:conf_files].push( conf_file ) unless @args[:conf_files].include?( conf_file ) + @args[:conf_files].unshift( conf_file ) unless @args[:conf_files].include?( conf_file ) else invalid_env end require 'conf/default' config = Configuration.new(@args).config @@ -510,11 +510,11 @@ invalid_option(arg,chr) end end elsif valid_env?(arg) @args[:env_path] = File.expand_path(arg) - @args[:conf_files].push( File.expand_path( File.join( arg, 'conf', 'config.yaml' ) ) ) + @args[:conf_files].unshift( File.expand_path( File.join( arg, 'conf', 'config.yaml' ) ) ) else invalid_env( arg ) end end end @@ -523,11 +523,11 @@ exit end end if valid_env?(@args[:env_path]) conf_file = File.expand_path( File.join( @args[:env_path], 'conf', 'config.yaml' ) ) - @args[:conf_files].push( conf_file ) unless @args[:conf_files].include?( conf_file ) + @args[:conf_files].unshift( conf_file ) unless @args[:conf_files].include?( conf_file ) else invalid_env end require 'conf/default' config = Configuration.new(@args).config @@ -873,9 +873,58 @@ # RSence runtime configuration data # @return [Hash] the active configuration structure as defined by the {file:default_conf default configuration} and overridden by local configuration files. def self.config @@config end + + def self.transporter + @@transporter + end + def self.transporter=(transporter) + if class_variable_defined?(:'@@transporter') + warn "WARN: Transporter already set." + return + else + @@transporter = transporter + end + end + + def self.plugin_manager + @@plugin_manager + end + def self.plugin_manager=(plugin_manager) + if class_variable_defined?(:'@@plugin_manager') + warn "WARN: @@plugin_manager already set." + return + else + @@plugin_manager = plugin_manager + end + end + + def self.value_manager + @@value_manager + end + def self.value_manager=(value_manager) + if class_variable_defined?(:'@@value_manager') + warn "WARN: @@value_manager already set." + return + else + @@value_manager = value_manager + end + end + + def self.session_manager + @@session_manager + end + def self.session_manager=(session_manager) + if class_variable_defined?(:'@@session_manager') + warn "WARN: @@session_manager already set." + return + else + @@session_manager = session_manager + end + end + ## Riassence Daemon controls require 'daemon/daemon' puts "Starting RSence..." if self.args[:verbose] daemon = HTTPDaemon.new daemon.daemonize!