ru.Bee 1.3.1 → 1.3.2
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 +10 -2
- data/lib/rubee.rb +1 -1
- data/lib/tests/test.db +0 -0
- data/readme.md +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5810b6eb69d752cea118184cc0fd70559a7b6c76024f3fa2cccca1eaedc7305e
|
4
|
+
data.tar.gz: 648ef60b8a9d94ec49c5cd8e31882873637660935097cadcca5124aad19198ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30c9cdc416a9875128b2ca186cf0a60ae9f85463f49492c625972d8a908a1acab524f024c926a2fcc05f519af3b5112f96bcc32a0953b756f57effdb7eaefe49
|
7
|
+
data.tar.gz: 21de68b11a410bd67aeea32707409ecc173b3af5dceab016675c41904cc6e452dcc889668c05ec1918e5a683049f02ebfce778fc3c0f2008e071ea49c8ffe5b1
|
@@ -21,11 +21,19 @@ module Rubee
|
|
21
21
|
def save
|
22
22
|
args = to_h.dup&.transform_keys(&:to_sym)
|
23
23
|
if args[:id]
|
24
|
-
|
24
|
+
begin
|
25
|
+
udpate(args)
|
26
|
+
rescue => _
|
27
|
+
return false
|
28
|
+
end
|
25
29
|
|
26
30
|
true
|
27
31
|
else
|
28
|
-
|
32
|
+
begin
|
33
|
+
created_object = self.class.create(args)
|
34
|
+
rescue => _
|
35
|
+
return false
|
36
|
+
end
|
29
37
|
self.id = created_object.id
|
30
38
|
|
31
39
|
true
|
data/lib/rubee.rb
CHANGED
@@ -8,7 +8,7 @@ module Rubee
|
|
8
8
|
APP_ROOT = File.expand_path(Dir.pwd) unless defined?(APP_ROOT)
|
9
9
|
IMAGE_DIR = File.join(APP_ROOT, 'images') unless defined?(IMAGE_DIR)
|
10
10
|
PROJECT_NAME = File.basename(APP_ROOT) unless defined?(PROJECT_NAME)
|
11
|
-
VERSION = '1.3.
|
11
|
+
VERSION = '1.3.1'
|
12
12
|
|
13
13
|
class Application
|
14
14
|
include Singleton
|
data/lib/tests/test.db
CHANGED
Binary file
|
data/readme.md
CHANGED
@@ -284,6 +284,9 @@ View in ruBee is just a plain html/erb file that can be rendered from the contro
|
|
284
284
|
|
285
285
|
You can use erb as a template engine in the views.
|
286
286
|
|
287
|
+
layout.erb is the parent template that is rendered first and then the child templates are rendered inside it.
|
288
|
+
Feel free to include you custom css and js files in the this file.
|
289
|
+
|
287
290
|
```ruby
|
288
291
|
# app/controllers/welcome_controller.rb
|
289
292
|
|
@@ -294,18 +297,18 @@ class WelcomeController < Rubee::BaseController
|
|
294
297
|
end
|
295
298
|
```
|
296
299
|
|
297
|
-
```
|
300
|
+
```erb
|
298
301
|
# app/views/welcome_header.erb
|
299
302
|
|
300
303
|
<h1>All set up and running!</h1>
|
301
304
|
```
|
302
305
|
|
303
|
-
```
|
306
|
+
```erb
|
304
307
|
# app/views/welcome_show.erb
|
305
308
|
|
306
309
|
<div class="container">
|
307
|
-
<%= render_template :welcome_header %> # you can easily
|
308
|
-
<p><%= locals[:object][:message] %></p> #
|
310
|
+
<%= render_template :welcome_header %> # you can easily attach erb temlate using render_template method
|
311
|
+
<p><%= locals[:object][:message] %></p> # displaying, passed in the controller object
|
309
312
|
</div>
|
310
313
|
```
|
311
314
|
## Object hooks
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ru.Bee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleg Saltykov
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-04-
|
10
|
+
date: 2025-04-08 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: bundler
|