Module: Cuba
- Defined in:
- lib/cuba/ron.rb,
lib/cuba.rb,
lib/cuba/version.rb
Overview
Based on Rum: github.com/chneukirchen/rum
Summary of changes
-
Only relevant captures are yielded.
-
The #extension matcher is used more like #path.
-
Miscellaneous coding style changes.
Defined Under Namespace
Classes: Ron
Constant Summary collapse
- VERSION =
"1.0.0"
Class Method Summary collapse
- .app ⇒ Object
- .call(env) ⇒ Object
- .define(&block) ⇒ Object
- .prototype ⇒ Object
- .reset! ⇒ Object
- .use(middleware, *args, &block) ⇒ Object
Class Method Details
.app ⇒ Object
10 11 12 |
# File 'lib/cuba.rb', line 10 def self.app @app ||= Rack::Builder.new end |
.call(env) ⇒ Object
26 27 28 |
# File 'lib/cuba.rb', line 26 def self.call(env) prototype.call(env) end |
.define(&block) ⇒ Object
18 19 20 |
# File 'lib/cuba.rb', line 18 def self.define(&block) app.run Cuba::Ron.new(&block) end |
.prototype ⇒ Object
22 23 24 |
# File 'lib/cuba.rb', line 22 def self.prototype @prototype ||= app.to_app end |
.reset! ⇒ Object
5 6 7 8 |
# File 'lib/cuba.rb', line 5 def self.reset! @app = nil @prototype = nil end |
.use(middleware, *args, &block) ⇒ Object
14 15 16 |
# File 'lib/cuba.rb', line 14 def self.use(middleware, *args, &block) app.use(middleware, *args, &block) end |