Module: Rage
- Defined in:
- lib/rage-rb.rb,
lib/rage/cli.rb,
lib/rage/version.rb
Defined Under Namespace
Modules: Cable, Deferred, Errors, Events, Ext, OpenAPI, Router Classes: Application, CLI, CLICodeGenerator, CLINewAppGenerator, CodeLoader, Configuration, Cookies, Cors, Env, FiberScheduler, FiberWrapper, JSONFormatter, LogProcessor, Logger, OriginValidator, ParamsParser, Reloader, Request, RequestId, Response, Session, SidekiqSession, Tasks, TextFormatter, UploadedFile
Constant Summary collapse
- VERSION =
"1.19.0"
Class Method Summary collapse
-
.application ⇒ Object
Builds the Rage application with the configured middlewares.
-
.cable ⇒ Rage::Cable
Shorthand to access Rage::Cable.
-
.config ⇒ Rage::Configuration
(also: configuration)
Access the Rage configuration.
-
.configure ⇒ Object
Configure Rage using a block.
-
.deferred ⇒ Rage::Deferred
Shorthand to access Rage::Deferred.
-
.env ⇒ Rage::Env
Access the current Rage environment.
-
.events ⇒ Rage::Events
Shorthand to access Rage::Events.
-
.groups ⇒ Object
Access the current Gem groups based on the Rage environment.
-
.load_middlewares(_) ⇒ Object
deprecated
Deprecated.
This method is deprecated and has been merged into
Rage.application. -
.load_tasks ⇒ Object
Load Rake tasks for the Rage application.
-
.logger ⇒ Rage::Logger
Access the Rage logger.
-
.multi_application ⇒ Object
Builds the Rage application which delegates Rails requests to
Rails.application. -
.openapi ⇒ Rage::OpenAPI
Shorthand to access Rage::OpenAPI.
-
.root ⇒ Pathname
Access the root path of the Rage application.
-
.routes ⇒ Rage::Router::DSL::Handler
Configure routes for the Rage application.
Class Method Details
.application ⇒ Object
Builds the Rage application with the configured middlewares.
10 11 12 |
# File 'lib/rage-rb.rb', line 10 def self.application with_middlewares(Application.new(__router), config.middleware.middlewares) end |
.cable ⇒ Rage::Cable
Shorthand to access Rage::Cable.
21 22 23 |
# File 'lib/rage-rb.rb', line 21 def self.cable Rage::Cable end |
.config ⇒ Rage::Configuration Also known as: configuration
Access the Rage configuration.
65 66 67 |
# File 'lib/rage-rb.rb', line 65 def self.config @config ||= Rage::Configuration.new end |
.configure ⇒ Object
Configure Rage using a block.
74 75 76 77 |
# File 'lib/rage-rb.rb', line 74 def self.configure(&) config.instance_eval(&) config.__finalize end |
.deferred ⇒ Rage::Deferred
Shorthand to access Rage::Deferred.
33 34 35 |
# File 'lib/rage-rb.rb', line 33 def self.deferred Rage::Deferred end |
.env ⇒ Rage::Env
Access the current Rage environment.
85 86 87 |
# File 'lib/rage-rb.rb', line 85 def self.env @__env ||= Rage::Env.new(ENV["RAGE_ENV"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development") end |
.events ⇒ Rage::Events
Shorthand to access Rage::Events.
39 40 41 |
# File 'lib/rage-rb.rb', line 39 def self.events Rage::Events end |
.groups ⇒ Object
Access the current Gem groups based on the Rage environment.
90 91 92 |
# File 'lib/rage-rb.rb', line 90 def self.groups [:default, Rage.env.to_sym] end |
.load_middlewares(_) ⇒ Object
This method is deprecated and has been merged into Rage.application.
Load middlewares into the Rage application.
108 109 110 |
# File 'lib/rage-rb.rb', line 108 def self.load_middlewares(_) puts "`Rage.load_middlewares` is deprecated and has been merged into `Rage.application`. Please remove this call." end |
.load_tasks ⇒ Object
Load Rake tasks for the Rage application.
142 143 144 |
# File 'lib/rage-rb.rb', line 142 def self.load_tasks Rage::Tasks.init end |
.logger ⇒ Rage::Logger
Access the Rage logger.
102 103 104 |
# File 'lib/rage-rb.rb', line 102 def self.logger @logger ||= config.logger end |
.multi_application ⇒ Object
Builds the Rage application which delegates Rails requests to Rails.application.
15 16 17 |
# File 'lib/rage-rb.rb', line 15 def self.multi_application Rage::Router::Util::Cascade.new(application, Rails.application) end |
.openapi ⇒ Rage::OpenAPI
Shorthand to access Rage::OpenAPI.
27 28 29 |
# File 'lib/rage-rb.rb', line 27 def self.openapi Rage::OpenAPI end |
.root ⇒ Pathname
Access the root path of the Rage application.
96 97 98 |
# File 'lib/rage-rb.rb', line 96 def self.root @root ||= Pathname.new("."). end |
.routes ⇒ Rage::Router::DSL::Handler
Configure routes for the Rage application.
49 50 51 |
# File 'lib/rage-rb.rb', line 49 def self.routes Rage::Router::DSL.new(__router) end |