lesli_system 1.0.4 → 1.0.5
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/lesli_system/engines.rb +59 -36
- data/lib/lesli_system/version.rb +2 -2
- data/lib/lesli_system.rb +4 -0
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 85e62f3d407792c3b06e76d12b38e287487344b4d109277eb6cae3bfcb55b284
|
|
4
|
+
data.tar.gz: 95572c747deabfce33f1e9c2940a6bdbef46df117f72c98c2b0fdfd059e2e03d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e8899e47ef9547ee9ded144bb5b7495bbc01e27811449094db0b243d0e1dbe68a39fac88d7f88d9cee071537326d35fb33f7a71e39021409282dc2a1a2a5b7b
|
|
7
|
+
data.tar.gz: 56a7047d1fb1394a053142a6b15057dd82661e9794b7156d618c4e6815cb94a57be1442fa8b3cca4eea88be4dbf6f4d66e3eae817048391a035b412d36ba89f1
|
data/lib/lesli_system/engines.rb
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
module LesliSystem
|
|
3
3
|
class Engines
|
|
4
4
|
ENGINES = {}
|
|
5
|
+
GEMS = {}
|
|
5
6
|
|
|
6
7
|
# engine("LesliAdmin")
|
|
7
8
|
# engine("LesliAdmin", "name")
|
|
@@ -21,66 +22,88 @@ module LesliSystem
|
|
|
21
22
|
return ENGINES[engine]
|
|
22
23
|
end
|
|
23
24
|
|
|
25
|
+
def self.engines local:true
|
|
26
|
+
return ENGINES unless ENGINES.empty?
|
|
27
|
+
|
|
28
|
+
engines_and_gems(:engine, LESLI_ENGINES, local:local)
|
|
29
|
+
|
|
30
|
+
ENGINES["Root"] = {
|
|
31
|
+
:code => "root",
|
|
32
|
+
:name => "Root",
|
|
33
|
+
:path => "/",
|
|
34
|
+
:version => "1.0.0",
|
|
35
|
+
:summary => "",
|
|
36
|
+
:description => "",
|
|
37
|
+
:metadata => [],
|
|
38
|
+
:build => "0000000",
|
|
39
|
+
:dir => Rails.root.to_s
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
ENGINES
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def self.gems
|
|
46
|
+
return GEMS unless GEMS.empty?
|
|
47
|
+
engines_and_gems(:gem, LESLI_GEMS)
|
|
48
|
+
GEMS
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
private
|
|
52
|
+
|
|
24
53
|
# Lesli::System.engines()
|
|
25
54
|
# Lesli::System.engines(:local => true)
|
|
26
|
-
def self.
|
|
27
|
-
|
|
28
|
-
return ENGINES unless ENGINES.empty?
|
|
55
|
+
def self.engines_and_gems engine_or_gem, lesli_gems, local: false
|
|
29
56
|
|
|
30
57
|
# due we do not know the engine mounted path we have to look up for it every
|
|
31
58
|
# time we load the html view so we can use the dynamic route from the main rails app
|
|
32
59
|
# we use this in the url plugin
|
|
33
|
-
|
|
60
|
+
lesli_gems.each do |lesli_gem|
|
|
34
61
|
|
|
35
62
|
# skip if engine is not installed
|
|
36
|
-
next unless Object.const_defined?(
|
|
63
|
+
next unless Object.const_defined?(lesli_gem)
|
|
37
64
|
|
|
38
65
|
# convert engine name to Ruby object
|
|
39
|
-
|
|
66
|
+
gem_instance = "#{lesli_gem}".constantize
|
|
40
67
|
|
|
41
68
|
# check if engines installed locally are required
|
|
42
69
|
if local
|
|
43
70
|
|
|
44
71
|
# build the path were engines should be installed
|
|
45
|
-
|
|
72
|
+
gem_local_path = Rails.root.join("engines", lesli_gem)
|
|
46
73
|
|
|
47
74
|
# do not include engines if not is locally installed
|
|
48
|
-
next unless File.exist?(
|
|
75
|
+
next unless File.exist?(gem_local_path)
|
|
49
76
|
end
|
|
50
77
|
|
|
51
|
-
gem_specification = Gem::Specification.find_by_name(
|
|
78
|
+
gem_specification = Gem::Specification.find_by_name(lesli_gem.underscore)
|
|
52
79
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
:
|
|
58
|
-
:
|
|
59
|
-
:
|
|
60
|
-
:
|
|
61
|
-
:
|
|
62
|
-
:
|
|
63
|
-
:
|
|
80
|
+
path = (engine_or_gem == :engine) ? gem_instance::Engine.routes.find_script_name({}) : nil
|
|
81
|
+
|
|
82
|
+
# Define the shared data structure
|
|
83
|
+
gem_data = {
|
|
84
|
+
code: lesli_gem.underscore,
|
|
85
|
+
name: lesli_gem,
|
|
86
|
+
path: path,
|
|
87
|
+
version: gem_instance::VERSION,
|
|
88
|
+
summary: gem_specification.summary,
|
|
89
|
+
description: gem_specification.description,
|
|
90
|
+
metadata: gem_specification.metadata,
|
|
91
|
+
build: gem_instance::BUILD,
|
|
92
|
+
dir: gem_specification.gem_dir
|
|
64
93
|
}
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# also include the rails main_app
|
|
68
|
-
ENGINES["Root"] = {
|
|
69
|
-
:code => "root",
|
|
70
|
-
:name => "Root",
|
|
71
|
-
:path => "/",
|
|
72
|
-
:version => "1.0.0",
|
|
73
|
-
:summary => "",
|
|
74
|
-
:description => "",
|
|
75
|
-
:metadata => [],
|
|
76
|
-
:build => "0000000",
|
|
77
|
-
:dir => Rails.root.to_s
|
|
78
|
-
}
|
|
79
94
|
|
|
80
|
-
|
|
95
|
+
# Assign to the correct constant
|
|
96
|
+
target_collection = (engine_or_gem == :engine) ? ENGINES : GEMS
|
|
97
|
+
target_collection[lesli_gem] = gem_data
|
|
98
|
+
end
|
|
81
99
|
end
|
|
82
100
|
|
|
83
|
-
|
|
101
|
+
LESLI_GEMS = %w[
|
|
102
|
+
LesliDate
|
|
103
|
+
LesliView
|
|
104
|
+
LesliAssets
|
|
105
|
+
LesliSystem
|
|
106
|
+
]
|
|
84
107
|
|
|
85
108
|
LESLI_ENGINES = %w[
|
|
86
109
|
Lesli
|
data/lib/lesli_system/version.rb
CHANGED
data/lib/lesli_system.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lesli_system
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Lesli Development Team
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: |
|
|
14
13
|
LesliSystem provides shared, reusable system-level components for The Lesli Framework.
|
|
@@ -34,7 +33,6 @@ metadata:
|
|
|
34
33
|
homepage_uri: https://www.lesli.dev/
|
|
35
34
|
changelog_uri: https://github.com/LesliTech/LesliSystem
|
|
36
35
|
source_code_uri: https://github.com/LesliTech/LesliSystem
|
|
37
|
-
post_install_message:
|
|
38
36
|
rdoc_options: []
|
|
39
37
|
require_paths:
|
|
40
38
|
- lib
|
|
@@ -49,8 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
49
47
|
- !ruby/object:Gem::Version
|
|
50
48
|
version: '0'
|
|
51
49
|
requirements: []
|
|
52
|
-
rubygems_version: 3.
|
|
53
|
-
signing_key:
|
|
50
|
+
rubygems_version: 3.7.1
|
|
54
51
|
specification_version: 4
|
|
55
52
|
summary: Core System Utilities for The Lesli Framework.
|
|
56
53
|
test_files: []
|