lesli 5.0.24 → 5.1.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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/lesli/{item → items}/activities_controller.rb +1 -1
  3. data/app/controllers/lesli/{item → items}/discussions_controller.rb +3 -3
  4. data/app/controllers/lesli/{item → items}/tasks_controller.rb +3 -3
  5. data/app/helpers/lesli/customization_helper.rb +1 -1
  6. data/app/helpers/lesli/html_helper.rb +1 -1
  7. data/app/models/concerns/lesli/{item → items}/activities.rb +2 -2
  8. data/app/models/concerns/lesli/{item → items}/discussions.rb +2 -2
  9. data/app/models/concerns/lesli/{item → items}/tasks.rb +2 -2
  10. data/app/models/lesli/application_lesli_record.rb +1 -1
  11. data/app/models/lesli/{item → items}/activity.rb +1 -1
  12. data/app/models/lesli/{item → items}/discussion.rb +1 -1
  13. data/app/models/lesli/{item → items}/task.rb +1 -1
  14. data/app/views/lesli/partials/_application-lesli-assets.html.erb +2 -0
  15. data/config/brakeman.yml +2 -13
  16. data/lib/generators/lesli/base_generator.rb +172 -0
  17. data/lib/generators/lesli/controller/controller_generator.rb +40 -0
  18. data/lib/generators/lesli/controller/templates/controller.rb.tt +86 -0
  19. data/lib/generators/lesli/model/model_generator.rb +44 -0
  20. data/lib/generators/lesli/model/templates/model.rb.tt +16 -0
  21. data/lib/generators/lesli/scaffold/scaffold_generator.rb +47 -0
  22. data/lib/generators/lesli/service/service_generator.rb +40 -0
  23. data/lib/generators/lesli/service/templates/service.rb.tt +44 -0
  24. data/lib/generators/lesli/views/templates/_form.html.erb.tt +22 -0
  25. data/lib/generators/lesli/views/templates/index.html.erb.tt +17 -0
  26. data/lib/generators/lesli/views/templates/new.html.erb.tt +4 -0
  27. data/lib/generators/lesli/views/templates/show.html.erb.tt +22 -0
  28. data/lib/generators/lesli/views/views_generator.rb +106 -0
  29. data/lib/lesli/engine.rb +1 -23
  30. data/lib/lesli/router.rb +1 -1
  31. data/lib/lesli/version.rb +2 -2
  32. data/lib/migrate/common.rb +2 -2
  33. data/lib/migrate/items/activity_structure.rb +1 -1
  34. data/lib/migrate/items/attachment_structure.rb +1 -1
  35. data/lib/migrate/items/discussion_structure.rb +1 -1
  36. data/lib/migrate/items/subscriber_structure.rb +1 -1
  37. data/lib/migrate/items/task_structure.rb +1 -1
  38. data/lib/migrate/items/version_structure.rb +1 -1
  39. data/lib/tasks/lesli/db.rake +6 -6
  40. data/lib/tasks/lesli_tasks.rake +7 -32
  41. data/readme.md +3 -3
  42. metadata +57 -63
  43. data/app/assets/config/lesli_manifest.js +0 -42
  44. data/app/assets/images/lesli/brand/app-auth.svg +0 -9
  45. data/app/assets/images/lesli/brand/app-icon.svg +0 -48
  46. data/app/assets/images/lesli/brand/app-logo.png +0 -0
  47. data/app/assets/images/lesli/brand/app-logo.svg +0 -4
  48. data/app/assets/images/lesli/brand/favicon.png +0 -0
  49. data/app/assets/images/lesli/brand/favicon.svg +0 -61
  50. data/app/assets/images/lesli/brand/login-background.jpg +0 -0
  51. data/app/assets/images/lesli/brand/register-background.jpg +0 -0
  52. data/app/assets/javascripts/lesli/application.js +0 -1
  53. data/config/importmap.rb +0 -1
  54. data/lib/generators/application_lesli_generator_base.rb +0 -164
  55. data/lib/generators/lesli/spec/USAGE +0 -8
  56. data/lib/generators/lesli/spec/spec_generator.rb +0 -22
  57. data/lib/generators/lesli/spec/templates/spec-factory.template +0 -17
  58. data/lib/generators/lesli/spec/templates/spec-model.template +0 -70
  59. data/lib/generators/lesli/view/USAGE +0 -8
  60. data/lib/generators/lesli/view/templates/spec-factory.template +0 -17
  61. data/lib/generators/lesli/view/templates/spec-model.template +0 -70
  62. data/lib/generators/lesli/view/view_generator.rb +0 -22
  63. data/lib/lesli/r_spec.rb +0 -43
  64. data/lib/scss/_apps.scss +0 -94
  65. data/lib/scss/application.scss +0 -34
@@ -1,70 +0,0 @@
1
- =begin
2
- <%# TODO: Use the license file if no lesli.txt file found %>
3
- <%= File.read(Lesli::Engine.root.join("lesli.txt")).to_s.force_encoding("ASCII-8BIT") %>=end
4
-
5
- require "rails_helper"
6
- require Lesli::Engine.root.join("spec/support/testers/model")
7
-
8
- RSpec.describe <%= @model[:name]%>, type: :model do
9
-
10
- # Setup runs before each test
11
- let(:<%= @info[:engine_resource_code] %>) { FactoryBot.create(:<%= @info[:engine_resource_code] %>) }
12
-
13
- it "is valid with valid attributes" do
14
- expect(<%= @info[:engine_resource_code] %>).to be_valid
15
- end
16
-
17
- <% @model[:columns].each do |column| %>
18
- <% next if ["id", "created_at", "updated_at"].include?(column[:name]) %>
19
- <% if !column[:null] %>
20
- it "is valid with valid attributes" do
21
- <%= @info[:engine_resource_code] %>.<%= column[:name]%> = nil
22
- expect(<%= @info[:engine_resource_code] %>).not_to be_valid
23
- end
24
- <% end %>
25
- <% end %>
26
-
27
- =begin
28
-
29
-
30
- it "is invalid without a name" do
31
- account.name = nil
32
- expect(account).not_to be_valid
33
- end
34
-
35
- it "is invalid without an email" do
36
- account.email = nil
37
- expect(account).not_to be_valid
38
- end
39
-
40
- it "is invalid with a duplicate email" do
41
- account.save
42
- duplicate_account = Account.new(name: "Test Account 2", email: "test@example.com", balance: 50.0)
43
- expect(duplicate_account).not_to be_valid
44
- end
45
-
46
- it "is invalid without a balance" do
47
- account.balance = nil
48
- expect(account).not_to be_valid
49
- end
50
-
51
- it "is invalid with a negative balance" do
52
- account.balance = -1
53
- expect(account).not_to be_valid
54
- end
55
-
56
- # Test associations
57
- it "has many transactions" do
58
- expect(account).to respond_to(:transactions)
59
- end
60
-
61
- # Test custom methods
62
- describe "#update_balance" do
63
- it "updates the balance correctly" do
64
- account.save
65
- account.update_balance(50.0)
66
- expect(account.reload.balance).to eq(150.0)
67
- end
68
- end
69
- =end
70
- end
@@ -1,8 +0,0 @@
1
- Description:
2
- Explain the generator
3
-
4
- Example:
5
- bin/rails generate lesli:spec Lesli/Account
6
-
7
- This will create:
8
- what/will/it/create
@@ -1,17 +0,0 @@
1
- =begin
2
- <%# TODO: Use the license file if no lesli.txt file found %>
3
- <%= File.read(Lesli::Engine.root.join("lesli.txt")).to_s.force_encoding("ASCII-8BIT") %>=end
4
-
5
- FactoryBot.define do
6
- factory :<%= @info[:engine_resource_code] %>, class: <%= @info[:engine_resource] %> do
7
- name { Faker::Company.name }
8
-
9
- <% @model[:columns].each do |column| %>
10
- <%= column[:name] %> { <%= column[:faker] %> }<% end %>
11
-
12
- after(:create) do |account, evaluator|
13
- account.user = FactoryBot.create(:user, account_id: account.id)
14
- account.save
15
- end
16
- end
17
- end
@@ -1,70 +0,0 @@
1
- =begin
2
- <%# TODO: Use the license file if no lesli.txt file found %>
3
- <%= File.read(Lesli::Engine.root.join("lesli.txt")).to_s.force_encoding("ASCII-8BIT") %>=end
4
-
5
- require "rails_helper"
6
- require Lesli::Engine.root.join("spec/support/testers/model")
7
-
8
- RSpec.describe <%= @model[:name]%>, type: :model do
9
-
10
- # Setup runs before each test
11
- let(:<%= @info[:engine_resource_code] %>) { FactoryBot.create(:<%= @info[:engine_resource_code] %>) }
12
-
13
- it "is valid with valid attributes" do
14
- expect(<%= @info[:engine_resource_code] %>).to be_valid
15
- end
16
-
17
- <% @model[:columns].each do |column| %>
18
- <% next if ["id", "created_at", "updated_at"].include?(column[:name]) %>
19
- <% if !column[:null] %>
20
- it "is valid with valid attributes" do
21
- <%= @info[:engine_resource_code] %>.<%= column[:name]%> = nil
22
- expect(<%= @info[:engine_resource_code] %>).not_to be_valid
23
- end
24
- <% end %>
25
- <% end %>
26
-
27
- =begin
28
-
29
-
30
- it "is invalid without a name" do
31
- account.name = nil
32
- expect(account).not_to be_valid
33
- end
34
-
35
- it "is invalid without an email" do
36
- account.email = nil
37
- expect(account).not_to be_valid
38
- end
39
-
40
- it "is invalid with a duplicate email" do
41
- account.save
42
- duplicate_account = Account.new(name: "Test Account 2", email: "test@example.com", balance: 50.0)
43
- expect(duplicate_account).not_to be_valid
44
- end
45
-
46
- it "is invalid without a balance" do
47
- account.balance = nil
48
- expect(account).not_to be_valid
49
- end
50
-
51
- it "is invalid with a negative balance" do
52
- account.balance = -1
53
- expect(account).not_to be_valid
54
- end
55
-
56
- # Test associations
57
- it "has many transactions" do
58
- expect(account).to respond_to(:transactions)
59
- end
60
-
61
- # Test custom methods
62
- describe "#update_balance" do
63
- it "updates the balance correctly" do
64
- account.save
65
- account.update_balance(50.0)
66
- expect(account.reload.balance).to eq(150.0)
67
- end
68
- end
69
- =end
70
- end
@@ -1,22 +0,0 @@
1
-
2
-
3
- # ·
4
- require "#{Lesli::Engine.root}/lib/generators/application_lesli_generator_base.rb"
5
-
6
- module Lesli
7
- class ViewGenerator < ApplicationLesliGeneratorBase
8
- source_root File.expand_path("templates", __dir__)
9
-
10
- def generator
11
- L2.msg "Generating Lesli Model spec"
12
-
13
- pp @info;
14
- pp @model;
15
- pp @services;
16
- pp @rspec;
17
-
18
- #template("spec-factory.template", "#{(@info[:engine].constantize)::Engine.root.join('spec', 'factories', @info[:engine_resource_code])}.rb")
19
- template("spec-model.template", "#{(@info[:engine].constantize)::Engine.root.join('spec', 'models', @info[:engine_resource_code])}_spec.rb")
20
- end
21
- end
22
- end
data/lib/lesli/r_spec.rb DELETED
@@ -1,43 +0,0 @@
1
- =begin
2
-
3
- Lesli
4
-
5
- Copyright (c) 2024, Lesli Technologies, S. A.
6
-
7
- This program is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 3 of the License, or
10
- (at your option) any later version.
11
-
12
- This program is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with this program. If not, see http://www.gnu.org/licenses/.
19
-
20
- Lesli · Ruby on Rails SaaS Development Framework.
21
-
22
- Made with ♥ by LesliTech
23
- Building a better future, one line of code at a time.
24
-
25
- @contact hello@lesli.tech
26
- @website https://www.lesli.tech
27
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
28
-
29
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
30
- // ·
31
- =end
32
-
33
- # ·
34
- module Lesli
35
- module RSpec
36
- def self.testers_request
37
- Lesli::Engine.root.join("lib/rspec/testers/request")
38
- end
39
- def self.testers_model
40
- Lesli::Engine.root.join("lib/rspec/testers/model")
41
- end
42
- end
43
- end
data/lib/scss/_apps.scss DELETED
@@ -1,94 +0,0 @@
1
- /*
2
- Lesli
3
-
4
- Copyright (c) 2025, Lesli Technologies, S. A.
5
-
6
- This program is free software: you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation, either version 3 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with this program. If not, see http://www.gnu.org/licenses/.
18
-
19
- Lesli · Ruby on Rails SaaS Development Framework.
20
-
21
- Made with ♥ by LesliTech
22
- Building a better future, one line of code at a time.
23
-
24
- @contact hello@lesli.tech
25
- @website https://www.lesli.tech
26
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
27
-
28
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
29
- // ·
30
- */
31
-
32
-
33
- // ·
34
- @use "lesli-css/sass/helpers/shadow";
35
- @use "lesli-css/sass/helpers/breakpoint";
36
-
37
-
38
- // ·
39
- body.lesli.apps.show {
40
-
41
- .lesli-element-header {
42
- margin-bottom: 5rem !important;
43
- }
44
-
45
- .engines {
46
- gap: 24px;
47
- margin-inline-end: auto;
48
- margin-inline-start: auto;
49
-
50
- a {
51
- flex-basis: 318px;
52
- text-align: center;
53
- padding: 2rem .4rem 2.8rem;
54
- border: white 1px solid;
55
- border-radius: 6px;
56
- background-color: white;
57
- transition: all ease-in-out .2s;
58
-
59
- @include shadow.lesli-shadow();
60
-
61
- &:hover {
62
- border-color: var(--lesli-color-primary);
63
- transform: translateY(-2px);
64
- }
65
-
66
- &.is-active {
67
- background-color: #F0F4FF;
68
- border-color: var(--lesli-color-primary);
69
- }
70
-
71
- // engine logo
72
- svg {
73
- margin-right: .4rem;
74
- fill: var(--lesli-color-primary);
75
- }
76
-
77
- // engine description
78
- p {
79
- font-size: 14;
80
- font-family: "OpenSans";
81
- }
82
-
83
- // engine name
84
- span {
85
- font-weight: 600;
86
- font-size: 20px;
87
- }
88
-
89
- span, p {
90
- color: var(--lesli-color-primary);
91
- }
92
- }
93
- }
94
- }
@@ -1,34 +0,0 @@
1
- /*
2
- Lesli
3
-
4
- Copyright (c) 2025, Lesli Technologies, S. A.
5
-
6
- This program is free software: you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation, either version 3 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with this program. If not, see http://www.gnu.org/licenses/.
18
-
19
- Lesli · Ruby on Rails SaaS Development Framework.
20
-
21
- Made with ♥ by LesliTech
22
- Building a better future, one line of code at a time.
23
-
24
- @contact hello@lesli.tech
25
- @website https://www.lesli.tech
26
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
27
-
28
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
29
- // ·
30
- */
31
-
32
-
33
- // ·
34
- @use "apps";