ru.Bee 2.7.1 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/config.ru +6 -1
- data/lib/db/test.db +0 -0
- data/lib/rubee/configuration.rb +10 -0
- data/lib/rubee.rb +9 -3
- data/readme.md +32 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6dae50d53499025c3bb722a77239ffaf3c7ef566dbe58e665986b62148bcbf60
|
|
4
|
+
data.tar.gz: 012e74d3c4c3cb488462689bcd0ba0b5c56488cf77da19e3c98caf3682847b26
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d22033e1be9a7583e872582bff2455715964d934905789b99065a702284b8bd8831f6bf4d2fc20c354c8a828e188cfa130b5396d443056bda1179cca9634e92
|
|
7
|
+
data.tar.gz: f7941cc128ac31cea3c98da487fdff20da3f01acfb14bfe3d1dcba4fa2a0a7fb6ade7404af5d5bca98746689cdb42f53b9ce7fec59540e74a745de35e27d2b7e
|
data/lib/config.ru
CHANGED
data/lib/db/test.db
CHANGED
|
Binary file
|
data/lib/rubee/configuration.rb
CHANGED
|
@@ -106,6 +106,16 @@ module Rubee
|
|
|
106
106
|
@configuraiton[args[:app].to_sym][args[:env].to_sym][:pubsub_container] = args[:pubsub_container]
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
+
def middlewares=(args)
|
|
110
|
+
args[:app] ||= :app
|
|
111
|
+
@configuraiton[args[:app].to_sym][args[:env].to_sym][:middlewares] = args[:middlewares]
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def middlewares(**args)
|
|
115
|
+
args[:app] ||= :app
|
|
116
|
+
@configuraiton[args[:app].to_sym][ENV['RACK_ENV']&.to_sym || :development][:middlewares] || []
|
|
117
|
+
end
|
|
118
|
+
|
|
109
119
|
def pubsub_container(**args)
|
|
110
120
|
args[:app] ||= :app
|
|
111
121
|
@configuraiton[args[:app].to_sym][ENV['RACK_ENV']&.to_sym || :development][:pubsub_container] || ::Rubee::PubSub::Redis.instance
|
data/lib/rubee.rb
CHANGED
|
@@ -20,7 +20,7 @@ module Rubee
|
|
|
20
20
|
RUBEE_SUPPORT = { "Rubee::Support::Hash" => Hash, "Rubee::Support::String" => String }
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
VERSION = '2.7.
|
|
23
|
+
VERSION = '2.7.3'
|
|
24
24
|
|
|
25
25
|
require_relative 'rubee/router'
|
|
26
26
|
require_relative 'rubee/logger'
|
|
@@ -33,9 +33,11 @@ module Rubee
|
|
|
33
33
|
include Singleton
|
|
34
34
|
using(ChargedString)
|
|
35
35
|
|
|
36
|
-
def
|
|
37
|
-
# autoload rb files
|
|
36
|
+
def initialize
|
|
38
37
|
Autoload.call
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def call(env)
|
|
39
41
|
# init rack request
|
|
40
42
|
request = Rack::Request.new(env)
|
|
41
43
|
# Add default path for assets
|
|
@@ -63,6 +65,10 @@ module Rubee
|
|
|
63
65
|
controller.send(action)
|
|
64
66
|
end
|
|
65
67
|
|
|
68
|
+
def middlewares
|
|
69
|
+
Rubee::Configuration.middlewares
|
|
70
|
+
end
|
|
71
|
+
|
|
66
72
|
private
|
|
67
73
|
|
|
68
74
|
def register_assets_routes
|
data/readme.md
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|

|
|
6
6
|

|
|
7
7
|
|
|
8
|
-
<img width="
|
|
8
|
+
<img width="358" height="131" alt="Screen Shot 2026-03-10 at 6 26 04 PM" src="https://github.com/user-attachments/assets/9f156847-590d-43c2-b432-728e6cc2eacc" />
|
|
9
|
+
<br />
|
|
10
|
+
<img width="200" alt="Screenshot 2026-03-11 at 3 42 16 PM" src="https://github.com/user-attachments/assets/f2df9bc7-cda9-4d91-83d5-deedd499999b" />
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
ru.Bee is a Ruby-based web framework designed to streamline the development of modular monolith web applications.
|
|
11
14
|
Under the hood, it leverages the power of Ruby and Rack backed by Puma, offering a clean, efficient, and flexible architecture.
|
|
@@ -92,6 +95,8 @@ The comparison is based on generic and subjective information available on the i
|
|
|
92
95
|
- [Logger](#logger)
|
|
93
96
|
- [WebSocket](#websocket)
|
|
94
97
|
- [Bee assistant](#bee-assistant)
|
|
98
|
+
- [Middleware integration](#middleware-integration)
|
|
99
|
+
|
|
95
100
|
|
|
96
101
|
You can read the full docs on the demo site: [rubee.dedyn.io](https://rubee.dedyn.io/)
|
|
97
102
|
|
|
@@ -1247,7 +1252,7 @@ gem 'sidekiq'
|
|
|
1247
1252
|
# config/base_configuration.rb
|
|
1248
1253
|
Rubee::Configuration.setup(env = :development) do |config|
|
|
1249
1254
|
config.database_url = { url: "sqlite://db/development.db", env: }
|
|
1250
|
-
config.async_adapter = { async_adapter: SidekiqAsync, env: }
|
|
1255
|
+
config.async_adapter = { async_adapter: Rubee::SidekiqAsync, env: }
|
|
1251
1256
|
end
|
|
1252
1257
|
```
|
|
1253
1258
|
|
|
@@ -1553,6 +1558,31 @@ If you are interested in contributing to ru.Bee, please read the [Contributing](
|
|
|
1553
1558
|
Feel free to open an [issue](https://github.com/nucleom42/rubee/issues) if you spot one.
|
|
1554
1559
|
Have an idea or want to discuss something? Open a [discussion](https://github.com/nucleom42/rubee/discussions).
|
|
1555
1560
|
|
|
1561
|
+
## Middleware integration
|
|
1562
|
+
|
|
1563
|
+
ru.Bee is rack based framework, so you can use register and use middleware for your application.
|
|
1564
|
+
1. Create a middleware
|
|
1565
|
+
```ruby
|
|
1566
|
+
# app/inits/middlewares/my_middleware.rb
|
|
1567
|
+
class MyMiddleware
|
|
1568
|
+
def initialize(app)
|
|
1569
|
+
@app = app
|
|
1570
|
+
end
|
|
1571
|
+
|
|
1572
|
+
def call(env)
|
|
1573
|
+
Logger.info("Middleware called")
|
|
1574
|
+
@app.call(env)
|
|
1575
|
+
end
|
|
1576
|
+
end
|
|
1577
|
+
```
|
|
1578
|
+
2. Register the middleware in the `config/base_configuration.rb`
|
|
1579
|
+
```ruby
|
|
1580
|
+
# config/base_configuration.rb
|
|
1581
|
+
require_relative 'inits/middlewares/my_middleware'
|
|
1582
|
+
|
|
1583
|
+
config.middlewares = { middlewares: [MyMiddleware], env: }
|
|
1584
|
+
```
|
|
1585
|
+
|
|
1556
1586
|
## Roadmap
|
|
1557
1587
|
|
|
1558
1588
|
Please refer to the [Roadmap](https://github.com/nucleom42/rubee/blob/main/roadmap.md).
|