ru.Bee 1.11 → 1.11.1
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/rubee/models/sequel_object.rb +7 -5
- data/lib/rubee.rb +1 -1
- data/lib/tests/models/user_model_test.rb +2 -2
- data/lib/tests/test.db +0 -0
- data/readme.md +28 -8
- 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: b6c1764a41eaa86619270fbaf3077cb5fc55b8d9c6b4f4edac37c2ac7f584fb7
|
|
4
|
+
data.tar.gz: e298000985901fea481a623fd1a08759b6be441251dba2efd78d0120f1ee16f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d11f20305783059eef64fa35530e2c6861ff708db527e6ff628b8d735b833d3ec565ce7bbeb4faa9ac0fb98d7868007c8c8728804ecd07adf37a49fc7f665c20
|
|
7
|
+
data.tar.gz: 91b9a63e9bc18c4be04d6e11b097607c01733921b6ba9e33134ea0ee07780fbdf4352083e76f901f741856048732f2a55b8998451a735260aa61da05df80644c
|
|
@@ -4,7 +4,7 @@ module Rubee
|
|
|
4
4
|
using ChargedString
|
|
5
5
|
using ChargedHash
|
|
6
6
|
|
|
7
|
-
before :
|
|
7
|
+
before :update, :save, :set_timestamps
|
|
8
8
|
|
|
9
9
|
def destroy(cascade: false, **_options)
|
|
10
10
|
if cascade
|
|
@@ -43,13 +43,15 @@ module Rubee
|
|
|
43
43
|
true
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
-
def assign_attributes(args={})
|
|
47
|
-
self.class.dataset.columns do |attr|
|
|
48
|
-
|
|
46
|
+
def assign_attributes(args = {})
|
|
47
|
+
self.class.dataset.columns.each do |attr|
|
|
48
|
+
if args[attr.to_sym]
|
|
49
|
+
send("#{attr}=", args[attr.to_sym])
|
|
50
|
+
end
|
|
49
51
|
end
|
|
50
52
|
end
|
|
51
53
|
|
|
52
|
-
def update(args={})
|
|
54
|
+
def update(args = {})
|
|
53
55
|
assign_attributes(args)
|
|
54
56
|
args.merge!(updated:)
|
|
55
57
|
found_hash = self.class.dataset.where(id:)
|
data/lib/rubee.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Rubee
|
|
|
16
16
|
JS_DIR = File.join(APP_ROOT, LIB, 'js') unless defined?(JS_DIR)
|
|
17
17
|
CSS_DIR = File.join(APP_ROOT, LIB, 'css') unless defined?(CSS_DIR)
|
|
18
18
|
ROOT_PATH = File.expand_path(File.join(__dir__, '..')) unless defined?(ROOT_PATH)
|
|
19
|
-
VERSION = '1.11'
|
|
19
|
+
VERSION = '1.11.1'
|
|
20
20
|
|
|
21
21
|
require_relative 'rubee/router'
|
|
22
22
|
require_relative 'rubee/logger'
|
|
@@ -140,14 +140,14 @@ describe 'User model' do
|
|
|
140
140
|
end
|
|
141
141
|
end
|
|
142
142
|
|
|
143
|
-
describe 'when udpate existing user with no
|
|
143
|
+
describe 'when udpate existing user with no arguments' do
|
|
144
144
|
it 'update updated field' do
|
|
145
145
|
user = User.new(email: 'ok-test@test.com', password: '123')
|
|
146
146
|
user.save
|
|
147
147
|
updated_field_before_update = user.updated
|
|
148
148
|
|
|
149
149
|
user.update
|
|
150
|
-
_(user.updated > updated_field_before_update).must_equal(true)
|
|
150
|
+
_(user.reload.updated > updated_field_before_update).must_equal(true)
|
|
151
151
|
end
|
|
152
152
|
end
|
|
153
153
|
end
|
data/lib/tests/test.db
CHANGED
|
Binary file
|
data/readme.md
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
# <img src="lib/images/rubee.svg" alt="RUBEE" height="40"> ... RUBEE
|
|
10
10
|
|
|
11
|
-
Rubee is a Ruby-based framework designed to streamline the development of modular monolith applications. \
|
|
11
|
+
Rubee is a Ruby-based web framework designed to streamline the development of modular monolith web applications. \
|
|
12
|
+
Under the hood, it leverages the power of Ruby and Rack backed by Puma, offering a clean, efficient, and flexible architecture. \
|
|
12
13
|
It offers a structured approach to building scalable, maintainable, and React-ready projects, \
|
|
13
14
|
making it an ideal choice for developers seeking a balance between monolithic simplicity and modular flexibility.
|
|
14
15
|
|
|
@@ -24,8 +25,8 @@ Want to explore how it built? https://github.com/nucleom42/rubee-site
|
|
|
24
25
|
## Stress tested
|
|
25
26
|
|
|
26
27
|
```bash
|
|
27
|
-
wrk -t4 -c100 -d30s https://rubee.
|
|
28
|
-
Running 30s test @ https://rubee.
|
|
28
|
+
wrk -t4 -c100 -d30s https://rubee.dedyn.io/docs
|
|
29
|
+
Running 30s test @ https://rubee.dedyn.io/docs
|
|
29
30
|
4 threads and 100 connections
|
|
30
31
|
Thread Stats Avg Stdev Max +/- Stdev
|
|
31
32
|
Latency 304.95ms 33.22ms 551.86ms 90.38%
|
|
@@ -44,6 +45,24 @@ Transfer/sec: 140.07KB
|
|
|
44
45
|
|
|
45
46
|
This demonstrates RUBEE’s efficient architecture and suitability for lightweight deployments — even on low-power hardware.
|
|
46
47
|
|
|
48
|
+
## Comparison
|
|
49
|
+
Here below is a **short web frameworks comparison** built with Ruby, so you can evaluate your choice with RUBEE.
|
|
50
|
+
|
|
51
|
+
**Disclaimer:**
|
|
52
|
+
The comparison is based on a very generic and subjective information open in the Internet and is not a real benchmark. The comparison is aimed to give you a general idea of the differences between the frameworks and Rubee and not to compare the frameworks directly.
|
|
53
|
+
|
|
54
|
+
| Feature / Framework | **Rubee** | Rails | Sinatra | Hanami | Padrino | Grape |
|
|
55
|
+
|---------------------|-----------|-------|---------|--------|---------|-------|
|
|
56
|
+
| **React readiness** | Built-in React integration (route generator can scaffold React components that fetch data via controllers) | React via webpacker/importmap, but indirect | No direct React support | Can integrate React | Can integrate via JS pipelines | API-focused, no React support |
|
|
57
|
+
| **Routing style** | Explicit, file-based routes with clear JSON/HTML handling | DSL, routes often implicit inside controllers | Explicit DSL, inline in code | Declarative DSL | Rails-like DSL | API-oriented DSL |
|
|
58
|
+
| **Modularity** | Lightweight core, pluggable projects | One project by default, but can be extended with repsecrive gem | Very modular (small DSL) | Designed for modularity | Semi-modular, still Rails-like | Modular (mount APIs) |
|
|
59
|
+
| **Startup / Load speed** | Very fast (minimal boot time, designed for modern Ruby) | Not very fast, especially on large apps | Very fast | Medium (slower than Sinatra, faster than Rails) | Similar to Rails (heavier) | Fast |
|
|
60
|
+
| **Ecosystem** | 🌱 Early-stage, focused on modern simplicity, but easily expandable over bundler | Huge ecosystem, gems, community | Large ecosystem, many gems work | Small, growing | Small, less active | Small, niche |
|
|
61
|
+
| **Learning curve** | Simple, explicit, minimal DSL | Steep (lots of conventions & magic) | Very low (DSL fits in one file) | Medium, more concepts (repositories, entities) | Similar to Rails, easier in parts | Low (API-only) |
|
|
62
|
+
| **Customizability** | High (explicit over implicit, hooks & generators) | Limited without monkey-patching | Very high (you control flow) | High, modular architecture | Medium | High (designed for APIs) |
|
|
63
|
+
| **Target use case** | Modern full-stack apps with React frontends or APIs, may be well suite if you prefer modular monolith over microservices | Large, full-stack, mature apps | Small apps, microservices | Modular apps, DDD | Rails-like but modular | APIs & microservices |
|
|
64
|
+
| **Early adopters support** | Personal early adopters support via fast extending and fixing | Not available | Not known | Not known | Not known | Not known |
|
|
65
|
+
|
|
47
66
|
## Content
|
|
48
67
|
|
|
49
68
|
- [Installation](#installation)
|
|
@@ -64,16 +83,16 @@ This demonstrates RUBEE’s efficient architecture and suitability for lightweig
|
|
|
64
83
|
- [Modular](#modualar-application)
|
|
65
84
|
- [Logger](#logger)
|
|
66
85
|
|
|
67
|
-
You can read it on the demo [site](https://rubee.dedyn.io/)
|
|
86
|
+
You can read it on the demo: [site](https://rubee.dedyn.io/)
|
|
68
87
|
|
|
69
|
-
🚧 The doc site is on
|
|
70
|
-
Please refer to
|
|
88
|
+
🚧 The doc site is on update mode now. We are working on it.
|
|
89
|
+
Please refer to the documentation shown below.
|
|
71
90
|
|
|
72
91
|
## Features
|
|
73
92
|
|
|
74
93
|
Lightweight – A minimal footprint focused on serving Ruby applications efficiently.
|
|
75
94
|
<br>
|
|
76
|
-
Modular – A modular approach to application development. Build modular
|
|
95
|
+
Modular – A modular approach to application development. Build modular monolith app with ease by attaching
|
|
77
96
|
as many subprojects as you need.
|
|
78
97
|
<br>
|
|
79
98
|
Contract-driven – Define your API contracts in a simple, declarative way, then generate all the boilerplate you need.
|
|
@@ -818,7 +837,8 @@ Starting from ver 1.11 hooks are able to be pinned to class methods.
|
|
|
818
837
|
|
|
819
838
|
```ruby
|
|
820
839
|
class AnyClass
|
|
821
|
-
|
|
840
|
+
include Rubee::Hookable
|
|
841
|
+
before :print_world, :print_hello, class_methods: true # you can use class method as a handler
|
|
822
842
|
|
|
823
843
|
class << self
|
|
824
844
|
def print_world
|