lib/masterview/initializer.rb in masterview-0.2.3 vs lib/masterview/initializer.rb in masterview-0.2.4
- old
+ new
@@ -446,11 +446,11 @@
@mv_code_base_dir = File.expand_path( File.dirname(__FILE__) )
builtin_directives_path = File.join( mv_code_base_dir, 'directives')
@mv_installation_dir = File.expand_path( "#{File.dirname(__FILE__)}/../.." )
#ISSUE: should probably also detect std console or breakpointer launch scripts [DJL 10-Jun-2006]
- @rails_runner_scripts_pattern = /server|dispatch|mongrel_rails/
+ @rails_runner_scripts_pattern = /server|dispatch|mongrel_rails|cgi/ #cgi picks up scgi and fcgi
@has_rails_context = (defined?(::RAILS_ROOT) != nil)
decide_if_running_rails
# only run if auto parsing and when launching server, check if need to update mv files
@@ -574,11 +574,15 @@
STDOUT.puts "...mv config initialized with default settings\n" if debug_TRACE_HACK
end
def decide_if_running_rails #:nodoc:
+ #old way using program name except that this needs to be maintained
@running_rails = has_rails_context && ($PROGRAM_NAME =~ rails_runner_scripts_pattern) != nil
+
+ # TODO could try checking if things are defined instead but what would we check for?? Something related to Dispatcher?
+ # @running_rails = has_rails_context && (defined?(::Dispatcher.dispatch)) != nil
end
# see if this app has the std file structure that indicates a rails application
def looks_like_rails_app? #:nodoc:
std_rails_directories = [ 'app', 'config', 'public' ]
@@ -699,9 +703,11 @@
#?? return if MasterView.const_defined?(:ConfigSettings) ??
load_config_settings
ensure_valid_settings
install_config_settings
# make a final check for running_rails? (in case config settings changed scripts spec)
+ # this logging didn't seem to work??
+ # @log_msg_q << [ :info, 'Program name = '+$PROGRAM_NAME ] # log the program that is starting
configuration.decide_if_running_rails
# keep a permananent record of how we got started
configuration.freeze
configuration.directive_paths.freeze
MasterView.const_set('ConfigSettings', configuration)