Module: Ramverk
- Defined in:
- lib/ramverk.rb,
lib/ramverk/string.rb,
lib/ramverk/version.rb,
lib/ramverk/resolver.rb,
lib/ramverk/cli/command.rb,
lib/ramverk/configuration.rb,
lib/ramverk/cli/commands/base.rb,
lib/ramverk/middleware/static.rb,
lib/ramverk/cli/commands/server.rb,
lib/ramverk/middleware/reloader.rb,
lib/ramverk/cli/commands/console.rb,
lib/ramverk/configuration/middleware.rb,
lib/ramverk/middleware/request_logger.rb,
lib/ramverk/configuration/dynamic_groups.rb
Overview
Ramverk is a web application framework written in Ruby.
Defined Under Namespace
Modules: Cli, Middleware, String Classes: Configuration, Console, Server
Constant Summary collapse
- VERSION =
Current version number.
"0.11.0"
Class Method Summary collapse
-
.boot ⇒ true
Boot the project.
-
.configuration ⇒ Ramverk::Configuration
Project configuration.
-
.configure {|config| ... } ⇒ Object
Configure project within a block.
-
.env ⇒ Symbol
Get the current environment status.
-
.env?(environment, ...) ⇒ Boolean
Check if the given environment match the current.
-
.rack ⇒ #call
Rack compatible endpoint.
-
.rake? ⇒ Boolean
Check if the program is running via Rake.
Class Method Details
.boot ⇒ true
Boot the project.
54 55 56 57 58 59 |
# File 'lib/ramverk.rb', line 54 def self.boot raise "project has already been booted" if @booted configuration.boot @booted = true end |
.configuration ⇒ Ramverk::Configuration
Project configuration.
30 31 32 |
# File 'lib/ramverk.rb', line 30 def self.configuration @configuration end |
.configure {|config| ... } ⇒ Object
Configure project within a block.
42 43 44 |
# File 'lib/ramverk.rb', line 42 def self.configure yield configuration end |
.env ⇒ Symbol
Get the current environment status.
12 13 14 |
# File 'lib/ramverk.rb', line 12 def self.env (ENV["APP_ENV"] || ENV["RACK_ENV"] || :development).to_sym end |
.env?(environment, ...) ⇒ Boolean
Check if the given environment match the current.
23 24 25 |
# File 'lib/ramverk.rb', line 23 def self.env?(*environment) environment.include?(env) end |
.rack ⇒ #call
Rack compatible endpoint.
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/ramverk.rb', line 64 def self.rack boot unless @booted builder = Rack::Builder.new configuration.middleware.stack.each do |(mw, args, block)| builder.use mw, *args, &block end builder.run Resolver.new(configuration.apps).freeze builder.freeze end |
.rake? ⇒ Boolean
Check if the program is running via Rake.
80 81 82 |
# File 'lib/ramverk.rb', line 80 def self.rake? File.basename($PROGRAM_NAME) == "rake" end |