Padrino::Loader
Module: Padrino::Loader
- Included in:
- Padrino
Instance Method Summary
-
#after_load { ... } ⇒ Array<Proc>
Hooks to be called after a load/reload. -
#before_load { ... } ⇒ Array<Proc>
Hooks to be called before a load/reload. -
#called_from ⇒ Object
This adds the ability to instantiate load! after Application definition. -
#clear! ⇒ NilClass
Clear the padrino env. -
#dependency_paths ⇒ Array<String>
Returns default list of path globs to load as dependencies. -
#load! ⇒ Boolean
Requires necessary dependencies as well as application files from root lib and models. -
#loaded? ⇒ Boolean
Determines whether Padrino was loaded with load!. -
#precompile_all_routes! ⇒ Object
Precompiles all routes if :precompile_routes is set to true. -
#reload! ⇒ Object
Method for reloading required applications and their files. -
#require_dependencies(*paths) ⇒ Object
Attempts to require all dependency libs that we need.
Instance Method Details
#after_load { ... } ⇒ Array<Proc>
Hooks to be called after a load/reload.
#before_load { ... } ⇒ Array<Proc>
Hooks to be called before a load/reload.
#called_from ⇒ Object
This adds the ability to instantiate Padrino.load! after Application definition.
#clear! ⇒ NilClass
Clear the padrino env.
#dependency_paths ⇒ Array<String>
Returns default list of path globs to load as dependencies. Appends custom dependency patterns to the be loaded for Padrino.
#load! ⇒ Boolean
Requires necessary dependencies as well as application files from root lib and models.
#loaded? ⇒ Boolean
Determines whether Padrino was loaded with Padrino.load!.
#precompile_all_routes! ⇒ Object
Precompiles all routes if :precompile_routes is set to true
#reload! ⇒ Object
Method for reloading required applications and their files.
#require_dependencies(*paths) ⇒ Object
Attempts to require all dependency libs that we need. If you use this method we can perform correctly a Padrino.reload! Another good thing that this method are dependency check, for example:
# models # \-- a.rb => require something of b.rb # \-- b.rb
In the example above if we do:
Dir["/models/*.rb"].each { |r| require r }
We get an error, because we try to require first a.rb
that need something of b.rb
.
With this method we don't have this problem.
© 2010–2016 Padrino
Licensed under the MIT License.
http://www.rubydoc.info/github/padrino/padrino-framework/Padrino/Loader