lesli 5.0.23 → 5.1.0
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/app/assets/stylesheets/lesli/application.css +1 -192
- data/app/controllers/lesli/abouts_controller.rb +1 -1
- data/app/controllers/lesli/{items → item}/activities_controller.rb +1 -1
- data/app/controllers/lesli/item/discussions_controller.rb +126 -0
- data/app/controllers/lesli/item/tasks_controller.rb +126 -0
- data/app/helpers/lesli/customization_helper.rb +1 -1
- data/app/helpers/lesli/html_helper.rb +1 -1
- data/app/models/concerns/lesli/item/activities.rb +106 -0
- data/app/models/concerns/lesli/item/discussions.rb +92 -0
- data/app/models/concerns/lesli/item/tasks.rb +95 -0
- data/app/models/lesli/account.rb +1 -0
- data/app/models/lesli/{items → item}/activity.rb +5 -13
- data/app/models/lesli/item/discussion.rb +10 -0
- data/{lib/lesli/r_spec.rb → app/models/lesli/item/task.rb} +9 -10
- data/app/views/lesli/partials/_application-lesli-header.html.erb +12 -0
- data/config/initializers/lesli_migration_helpers.rb +2 -2
- data/db/migrate/v1/0000000210_create_lesli_users.rb +1 -1
- data/lib/generators/lesli/base_generator.rb +172 -0
- data/lib/generators/lesli/controller/controller_generator.rb +40 -0
- data/lib/generators/lesli/controller/templates/controller.rb.tt +86 -0
- data/lib/generators/lesli/install/install_generator.rb +1 -1
- data/lib/generators/lesli/model/model_generator.rb +44 -0
- data/lib/generators/lesli/model/templates/model.rb.tt +16 -0
- data/lib/generators/lesli/scaffold/scaffold_generator.rb +47 -0
- data/lib/generators/lesli/service/service_generator.rb +40 -0
- data/lib/generators/lesli/service/templates/service.rb.tt +44 -0
- data/lib/generators/lesli/views/templates/_form.html.erb.tt +22 -0
- data/lib/generators/lesli/views/templates/index.html.erb.tt +17 -0
- data/lib/generators/lesli/views/templates/new.html.erb.tt +4 -0
- data/lib/generators/lesli/views/templates/show.html.erb.tt +22 -0
- data/lib/generators/lesli/views/views_generator.rb +106 -0
- data/lib/lesli/engine.rb +1 -23
- data/lib/lesli/router.rb +42 -43
- data/lib/lesli/version.rb +2 -2
- data/lib/migrate/common.rb +1 -1
- data/lib/migrate/items/activity_structure.rb +11 -5
- data/lib/migrate/items/discussion_structure.rb +9 -3
- data/lib/migrate/items/{action_structure.rb → task_structure.rb} +12 -6
- data/lib/migrate/shared/catalog_structure.rb +16 -0
- data/lib/tasks/lesli/db.rake +9 -0
- data/readme.md +1 -1
- metadata +58 -79
- data/app/assets/config/lesli_manifest.js +0 -42
- data/app/assets/images/lesli/brand/app-auth.svg +0 -9
- data/app/assets/images/lesli/brand/app-icon.svg +0 -48
- data/app/assets/images/lesli/brand/app-logo.png +0 -0
- data/app/assets/images/lesli/brand/app-logo.svg +0 -4
- data/app/assets/images/lesli/brand/favicon.png +0 -0
- data/app/assets/images/lesli/brand/favicon.svg +0 -61
- data/app/assets/images/lesli/brand/login-background.jpg +0 -0
- data/app/assets/images/lesli/brand/register-background.jpg +0 -0
- data/app/assets/javascripts/lesli/application.js +0 -1
- data/app/controllers/lesli/items/actions_controller.rb +0 -122
- data/app/controllers/lesli/items/discussions_controller.rb +0 -93
- data/app/models/lesli/items/action.rb +0 -15
- data/app/models/lesli/items/discussion.rb +0 -15
- data/config/importmap.rb +0 -1
- data/db/structure/00000000_locations.json +0 -32
- data/db/structure/00000020_catalogs.json +0 -0
- data/db/structure/00000201_workflows.json +0 -17
- data/db/structure/00000202_workflow_statuses.json +0 -24
- data/db/structure/00000203_workflow_associations.json +0 -14
- data/db/structure/00000204_workflow_actions.json +0 -39
- data/db/structure/00000205_workflow_checks.json +0 -27
- data/db/structure/00000300_custom_fields.json +0 -8
- data/db/structure/00000301_custom_fields.json +0 -38
- data/db/structure/00000401_custom_validations.json +0 -14
- data/db/structure/00000402_custom_validation_rules.json +0 -23
- data/db/structure/00000403_custom_validation_fields.json +0 -14
- data/lib/generators/application_lesli_generator_base.rb +0 -164
- data/lib/generators/lesli/spec/USAGE +0 -8
- data/lib/generators/lesli/spec/spec_generator.rb +0 -22
- data/lib/generators/lesli/spec/templates/spec-factory.template +0 -17
- data/lib/generators/lesli/spec/templates/spec-model.template +0 -70
- data/lib/generators/lesli/view/USAGE +0 -8
- data/lib/generators/lesli/view/templates/spec-factory.template +0 -17
- data/lib/generators/lesli/view/templates/spec-model.template +0 -70
- data/lib/generators/lesli/view/view_generator.rb +0 -22
- data/lib/scss/_apps.scss +0 -94
- data/lib/scss/application.scss +0 -34
- data/lib/tasks/lesli/docs.rake +0 -47
- data/lib/tasks/lesli/git.rake +0 -70
- data/lib/tasks/lesli/github.rake +0 -89
- data/lib/test/config.rb +0 -111
- data/lib/test/helpers/response_integration_helper.rb +0 -46
- data/lib/test/lesli.rb +0 -61
|
@@ -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/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
|
-
}
|
data/lib/scss/application.scss
DELETED
|
@@ -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";
|
data/lib/tasks/lesli/docs.rake
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
|
|
3
|
-
Lesli
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2023, 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 https://www.lesli.tech
|
|
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
|
-
namespace :lesli do
|
|
35
|
-
namespace :docs do
|
|
36
|
-
|
|
37
|
-
desc "Drop, create, migrate, seed & prepare the Lesli database (development only)"
|
|
38
|
-
task :build => :environment do |task, args|
|
|
39
|
-
build()
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# Drop the Lesli database (development only)
|
|
44
|
-
def build
|
|
45
|
-
|
|
46
|
-
end
|
|
47
|
-
end
|
data/lib/tasks/lesli/git.rake
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
|
|
3
|
-
Lesli
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2023, 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 https://www.lesli.tech
|
|
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
|
-
namespace :lesli do
|
|
35
|
-
namespace :git do
|
|
36
|
-
|
|
37
|
-
desc "Commit pending changes from all engines"
|
|
38
|
-
task commit: :environment do
|
|
39
|
-
|
|
40
|
-
# default params
|
|
41
|
-
git_message = "add updates from development"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# execute command
|
|
45
|
-
commit git_message
|
|
46
|
-
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# Commit pending changes from all engines
|
|
51
|
-
def commit git_message
|
|
52
|
-
|
|
53
|
-
# for every installed engine
|
|
54
|
-
pp LesliSystem.engines(:local => true)
|
|
55
|
-
# LesliSystem.engines_local.each do |name, engine|
|
|
56
|
-
|
|
57
|
-
# engine_path = Rails.root.join("engines", name)
|
|
58
|
-
|
|
59
|
-
# pp name
|
|
60
|
-
|
|
61
|
-
# next
|
|
62
|
-
|
|
63
|
-
# next unless File.exist?(engine_path)
|
|
64
|
-
|
|
65
|
-
# L2.m("Working with: #{name}")
|
|
66
|
-
# system("cd ./engines/#{name} && git add --all && git commit -m \"#{ git_message }\"")
|
|
67
|
-
|
|
68
|
-
# end
|
|
69
|
-
end
|
|
70
|
-
end
|
data/lib/tasks/lesli/github.rake
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
|
|
3
|
-
Lesli
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2023, 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 https://www.lesli.tech
|
|
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
|
-
namespace :lesli do
|
|
35
|
-
namespace :github do
|
|
36
|
-
|
|
37
|
-
desc "Distribute github workflows and actions to all the installed enginess"
|
|
38
|
-
task :actions => :environment do |task, args|
|
|
39
|
-
actions()
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
# Distribute github workflows and actions to all the installed engines
|
|
45
|
-
def actions
|
|
46
|
-
L2.info "start"
|
|
47
|
-
|
|
48
|
-
# get all the available workflows
|
|
49
|
-
workflows = Dir.glob(Rails.root.join("engines", "Lesli", ".github", "workflows", "*"))
|
|
50
|
-
|
|
51
|
-
LesliSystem.engines(local:true).each do |name, engine|
|
|
52
|
-
|
|
53
|
-
engine = engine[1]
|
|
54
|
-
|
|
55
|
-
next if engine[:name] == "Lesli"
|
|
56
|
-
|
|
57
|
-
engine_path = Rails.root.join("engines", engine[:name])
|
|
58
|
-
|
|
59
|
-
next unless File.exist?(engine_path)
|
|
60
|
-
|
|
61
|
-
pp "working with #{engine[:name]}"
|
|
62
|
-
|
|
63
|
-
# remove github workflows folder if it exists
|
|
64
|
-
FileUtils.rm_rf engine_path.join(".github", "workflows")
|
|
65
|
-
|
|
66
|
-
# create github workflows folder if it does not exist
|
|
67
|
-
FileUtils.mkdir_p engine_path.join(".github", "workflows")
|
|
68
|
-
|
|
69
|
-
pp workflows
|
|
70
|
-
|
|
71
|
-
# work with every workflow file found on github actions repository
|
|
72
|
-
workflows.each do |file_path|
|
|
73
|
-
|
|
74
|
-
pp file_path
|
|
75
|
-
|
|
76
|
-
# get the name of the workflow file
|
|
77
|
-
filename = File.basename(file_path)
|
|
78
|
-
|
|
79
|
-
# get the content of the workflow file
|
|
80
|
-
workflow = File.read(file_path)
|
|
81
|
-
|
|
82
|
-
# write workflow file into engine
|
|
83
|
-
File.write(engine_path.join(".github", "workflows", filename), workflow)
|
|
84
|
-
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
L2.info "end"
|
|
88
|
-
end
|
|
89
|
-
end
|
data/lib/test/config.rb
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
|
|
3
|
-
Lesli
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2025, 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
|
-
# Configure Rails Environment
|
|
35
|
-
ENV["RAILS_ENV"] = "test"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# Workaround for color_pound_spec_reporter
|
|
39
|
-
MiniTest = Minitest unless defined?(MiniTest)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
# Load test frameworks
|
|
43
|
-
require "minitest/reporters"
|
|
44
|
-
require "color_pound_spec_reporter"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
# Load code coverage tools
|
|
48
|
-
require "simplecov"
|
|
49
|
-
require "simplecov-console"
|
|
50
|
-
require "simplecov-cobertura"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
# Add console stats and html generator
|
|
54
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
|
55
|
-
SimpleCov::Formatter::CoberturaFormatter,
|
|
56
|
-
SimpleCov::Formatter::Console
|
|
57
|
-
])
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
# limit the number of missing lines
|
|
61
|
-
SimpleCov::Formatter::Console.missing_len = 10
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
# configure the files to track and ignore
|
|
65
|
-
SimpleCov.start do
|
|
66
|
-
|
|
67
|
-
# remove to track files in these folders
|
|
68
|
-
add_filter "/test"
|
|
69
|
-
add_filter "/spec"
|
|
70
|
-
add_filter "/vendor"
|
|
71
|
-
|
|
72
|
-
add_group "Controllers", "app/controllers"
|
|
73
|
-
add_group "Helpers", "app/helpers"
|
|
74
|
-
add_group "Models", "app/models"
|
|
75
|
-
add_group "Jobs", "app/jobs"
|
|
76
|
-
add_group "Services", "app/services"
|
|
77
|
-
add_group "Operators", "app/operators"
|
|
78
|
-
add_group "Validators", "app/validators"
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
# Minimum expected coverage percentage
|
|
83
|
-
SimpleCov.minimum_coverage 40
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
# Load dummy app for unit testing
|
|
87
|
-
# Run tests across all the engines: LESLI_INTEGRATION_TEST=true rails test
|
|
88
|
-
# Run tests for the current engine: rails test
|
|
89
|
-
unless ENV["LESLI_INTEGRATION_TEST"]
|
|
90
|
-
require_relative "../../test/dummy/config/environment"
|
|
91
|
-
ActiveRecord::Migrator.migrations_paths = [ File.expand_path("../test/dummy/db/migrate", __dir__) ]
|
|
92
|
-
ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__)
|
|
93
|
-
require "rails/test_help"
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
# Load fixtures from the engine
|
|
98
|
-
if ActiveSupport::TestCase.respond_to?(:fixture_paths=)
|
|
99
|
-
ActiveSupport::TestCase.fixture_paths = [ File.expand_path("fixtures", __dir__) ]
|
|
100
|
-
ActionDispatch::IntegrationTest.fixture_paths = ActiveSupport::TestCase.fixture_paths
|
|
101
|
-
ActiveSupport::TestCase.file_fixture_path = File.expand_path("fixtures", __dir__) + "/files"
|
|
102
|
-
ActiveSupport::TestCase.fixtures :all
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
# Execute tests
|
|
107
|
-
Minitest::Reporters.use!([
|
|
108
|
-
Minitest::Reporters::DefaultReporter.new(color: true),
|
|
109
|
-
Minitest::Reporters::JUnitReporter.new("coverage/reports"),
|
|
110
|
-
ColorPoundSpecReporter.new
|
|
111
|
-
])
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
|
|
3
|
-
Lesli
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2025, 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
|
-
module ResponseIntegrationHelper
|
|
34
|
-
|
|
35
|
-
# return the body of a request response parsed as JSON
|
|
36
|
-
def response_json
|
|
37
|
-
JSON.parse(@response.body.blank? ? "{}" : @response.body)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# test a standard successful response for lesli 3
|
|
42
|
-
def expect_response_with_successful
|
|
43
|
-
assert_response(:success)
|
|
44
|
-
assert_equal("application/json; charset=utf-8", @response.content_type)
|
|
45
|
-
end
|
|
46
|
-
end
|
data/lib/test/lesli.rb
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
|
|
3
|
-
Lesli
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2025, 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
|
-
# Load test configuration and test helper modules
|
|
35
|
-
require Lesli::Engine.root.join("lib/test/config")
|
|
36
|
-
require Lesli::Engine.root.join("lib/test/helpers/response_integration_helper")
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
# Helpers for Integration tests (json api)
|
|
40
|
-
class LesliIntegrationTester < ActionDispatch::IntegrationTest
|
|
41
|
-
include ResponseIntegrationHelper
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
# Test for views & helpers(html)
|
|
46
|
-
class LesliViewTester < ActionView::TestCase
|
|
47
|
-
include Lesli::HtmlHelper
|
|
48
|
-
include Lesli::SystemHelper
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
L2.br(2)
|
|
53
|
-
|
|
54
|
-
# Notify to user...
|
|
55
|
-
L2.info(
|
|
56
|
-
"Running Lesli tests...",
|
|
57
|
-
"For a better result run test over a clean database",
|
|
58
|
-
"You can use rake dev:db:reset test before rspec."
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
L2.br(2)
|