Padrino
Module: Padrino
- Extended by:
- Configuration, Loader
Overview
Manages current Padrino version for use in gem generation.
We put this in a separate file so you can get padrino version without include full padrino core.
Defined Under Namespace
Modules: Admin, ApplicationSetup, Cache, Configuration, Flash, Generators, Helpers, Loader, Mailer, Module, ParamsProtection, PathRouter, Performance, Reloader, Rendering, Routing, Tasks, Utils Classes: Application, AuthenticityToken, Filter, Logger, Mounter, Router, Server
Constant Summary
- PADRINO_IGNORE_CALLERS =
[ %r{lib/padrino-.*$}, %r{/padrino-.*/(lib|bin)}, %r{/bin/padrino$}, %r{/sinatra(/(base|main|show_?exceptions))?\.rb$}, %r{lib/tilt.*\.rb$}, %r{lib/rack.*\.rb$}, %r{lib/mongrel.*\.rb$}, %r{lib/shotgun.*\.rb$}, %r{bin/shotgun$}, %r{\(.*\)}, %r{shoulda/context\.rb$}, %r{mocha/integration}, %r{test/unit}, %r{rake_test_loader\.rb}, %r{custom_require\.rb$}, %r{active_support}, %r{/thor}, %r{/lib/bundler}, ]
- VERSION =
'0.13.2'
Class Attribute Summary
-
.mounted_root(*args) ⇒ String
The root to the mounted apps base directory.
Class Method Summary
-
.add_middleware(router) ⇒ Object
Creates Rack stack with the router added to the middleware chain. -
.after_load(&block) ⇒ Object
-
.application ⇒ Padrino::Router
The resulting rack builder mapping each 'mounted' application. -
.before_load(&block) ⇒ Object
-
.bin(*args) ⇒ Boolean
This method return the correct location of padrino bin or exec it using Kernel#system with the given args. -
.bin_gen(*args) ⇒ Object
This method return the correct location of padrino-gen bin or exec it using Kernel#system with the given args. -
.cache ⇒ Object
Returns the caching engine. -
.cache=(value) ⇒ Object
Set the caching engine. -
.clear_middleware! ⇒ Array
Clears all previously configured middlewares. -
.configure_apps { ... } ⇒ Object
Configure Global Project Settings for mounted apps. -
.env ⇒ Symbol
Helper method that return RACK_ENV. -
.gem(name, main_module) ⇒ Object
Registers a gem with padrino. -
.gems ⇒ Object
-
.global_configurations ⇒ Object
Stores global configuration blocks. -
.insert_mounted_app(mounter) ⇒ Object
Inserts a Mounter object into the mounted applications (avoids duplicates). -
.logger ⇒ Padrino::Logger
-
.logger=(value) ⇒ Object
Set the padrino logger. -
.middleware ⇒ Array<Array<Class, Array, Proc>>
A Rack::Builder object that allows to add middlewares in front of all Padrino applications. -
.modules ⇒ Object
-
.mount(name, options = {}) ⇒ Object
Mounts a new sub-application onto Padrino project. -
.mounted_apps ⇒ Array
The mounted padrino applications (MountedApp objects). -
.perf_memusage_command ⇒ Object
-
.root(*args) ⇒ String
Helper method for file references. -
.ruby_command ⇒ String
Return the path to the ruby interpreter taking into account multiple installations and windows extensions. -
.run!(options = {}) ⇒ Object
Runs the Padrino apps as a self-hosted server using: thin, mongrel, or WEBrick in that order. -
.set_encoding ⇒ NilClass
SetEncoding.default_internal
andEncoding.default_external
toEncoding::UFT_8
. -
.use(mw, *args) { ... } ⇒ Object
Convenience method for adding a Middleware to the whole padrino app. -
.version ⇒ String
The current Padrino version.
Methods included from Loader
after_load, before_load, called_from, clear!, dependency_paths, load!, loaded?, precompile_all_routes!, reload!, require_dependencies
Methods included from Configuration
Class Attribute Details
.mounted_root(*args) ⇒ String
Returns the root to the mounted apps base directory.
Class Method Details
.add_middleware(router) ⇒ Object
Creates Rack stack with the router added to the middleware chain.
.after_load(&block) ⇒ Object
.application ⇒ Padrino::Router
The resulting rack builder mapping each 'mounted' application.
.before_load(&block) ⇒ Object
.bin(*args) ⇒ Boolean
This method return the correct location of padrino bin or exec it using Kernel#system with the given args.
.bin_gen(*args) ⇒ Object
This method return the correct location of padrino-gen bin or exec it using Kernel#system with the given args.
.cache ⇒ Object
Returns the caching engine.
.cache=(value) ⇒ Object
Set the caching engine.
.clear_middleware! ⇒ Array
Clears all previously configured middlewares.
.configure_apps { ... } ⇒ Object
Configure Global Project Settings for mounted apps. These can be overloaded in each individual app's own personal configuration. This can be used like:
.env ⇒ Symbol
Helper method that return RACK_ENV.
.gem(name, main_module) ⇒ Object
Registers a gem with padrino. This relieves the caller from setting up loadpaths by itself and enables Padrino to look up apps in gem folder.
The name given has to be the proper gem name as given in the gemspec.
.gems ⇒ Object
.global_configurations ⇒ Object
Stores global configuration blocks.
.insert_mounted_app(mounter) ⇒ Object
Inserts a Mounter object into the mounted applications (avoids duplicates).
.logger ⇒ Padrino::Logger
.logger=(value) ⇒ Object
Set the padrino logger.
.middleware ⇒ Array<Array<Class, Array, Proc>>
A Rack::Builder object that allows to add middlewares in front of all Padrino applications.
.modules ⇒ Object
.mount(name, options = {}) ⇒ Object
Mounts a new sub-application onto Padrino project.
.mounted_apps ⇒ Array
Returns the mounted padrino applications (MountedApp objects)
.perf_memusage_command ⇒ Object
.root(*args) ⇒ String
Helper method for file references.
.ruby_command ⇒ String
Return the path to the ruby interpreter taking into account multiple installations and windows extensions.
.run!(options = {}) ⇒ Object
Runs the Padrino apps as a self-hosted server using: thin, mongrel, or WEBrick in that order.
.set_encoding ⇒ NilClass
Set Encoding.default_internal
and Encoding.default_external
to Encoding::UFT_8
.
Please note that in 1.9.2
with some template engines like haml
you should turn off Encoding.default_internal to prevent problems.
.use(mw, *args) { ... } ⇒ Object
Convenience method for adding a Middleware to the whole padrino app.
.version ⇒ String
The current Padrino version.
© 2010–2016 Padrino
Licensed under the MIT License.
http://www.rubydoc.info/github/padrino/padrino-framework/Padrino