0
@@ -13,6 +13,8 @@ module Merb
0
module GlobalHelpers; end
0
+ # Startup Merb by setting up the Config and starting the server.
0
# The config arguments to start Merb with. Defaults to +ARGV+.
0
@@ -26,6 +28,28 @@ module Merb
0
Merb.root = Merb::Config[:merb_root]
0
Merb::Server.start(Merb::Config[:port], Merb::Config[:cluster])
0
+ # Start the Merb environment, but only if it hasn't been loaded yet.
0
+ # argv<String, Hash>::
0
+ # The config arguments to start Merb with. Defaults to +ARGV+.
0
+ def start_environment(argv=ARGV)
0
+ unless (@started ||= false)
0
+ # Restart the Merb environment explicitly.
0
+ # argv<String, Hash>::
0
+ # The config arguments to restart Merb with. Defaults to +Merb::Config+.
0
+ def restart_environment(argv={})
0
+ start_environment(Merb::Config.to_hash.merge(argv))
0
attr_accessor :environment, :load_paths, :adapter
0
@@ -102,7 +126,7 @@ module Merb
0
Merb::Config[:log_file]
0
log_path / "merb_test.log"
0
- elsif !(Merb::Config[:daemonize] || Merb::Config[:cluster]
)
0
+ elsif !(Merb::Config[:daemonize] || Merb::Config[:cluster]
)
0
log_path / "merb.#{Merb::Config[:port]}.log"
0
@@ -170,14 +194,13 @@ module Merb
0
+ # Load all basic dependencies (selected BootLoaders only).
0
- # init_file<String>:: The file to load first.
0
- # options<Hash>:: Other options to pass on to the Merb config.
0
- def load_dependencies(init_file, options = {})
0
- Merb::Config.setup({:log_file => $stdout, :log_level => :warn,
0
- :init_file => init_file}.merge(options))
0
+ # options<Hash>:: Options to pass on to the Merb config.
0
+ def load_dependencies(options = {})
0
+ Merb::Config.setup({ :log_file => $stdout, :log_level => :warn, :log_auto_flush => true }.merge(options))
0
Merb::BootLoader::Logger.run
0
- Merb.logger.auto_flush = true
0
Merb::BootLoader::BuildFramework.run
0
Merb::BootLoader::Dependencies.run
0
Merb::BootLoader::BeforeAppRuns.run
0
@@ -214,6 +237,32 @@ module Merb
0
+ # Disables the given core components, like a Gem for example.
0
+ # *args:: One or more symbols of Merb internal components.
0
+ def disable(*components)
0
+ disabled_components.push *components
0
+ # Array:: All components that should be disabled.
0
+ def disabled_components=(components)
0
+ disabled_components.replace components
0
+ # Array:: All components that have been disabled.
0
+ def disabled_components
0
+ Merb::Config[:disabled_components] ||= []
0
+ # Boolean:: True if all components (or just one) are disabled.
0
+ def disabled?(*components)
0
+ components.all? { |c| disabled_components.include?(c) }
0
# Array:: All Rakefiles for plugins.
0
@@ -238,4 +287,4 @@ require 'merb-core/controller/mime'
0
require 'merb-core/vendor/facets'
0
# Set the environment if it hasn't already been set.
0
-Merb.environment ||= Merb::Config[:environment] || ($TESTING ? 'test' : 'development')
0
\ No newline at end of file
0
+Merb.environment ||= ENV['MERB_ENV'] || Merb::Config[:environment] || ($TESTING ? 'test' : 'development')
0
\ No newline at end of file
Comments
No one has commented yet.