lesli_system 1.0.4 → 1.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92c437f85656f59bd6c5877a58cfcf49702947681eeac69beed82841980960a4
4
- data.tar.gz: 3a474089bcabba3772a516c3c8580cefd27af3fbfed2ade1cce7bded48fb855b
3
+ metadata.gz: 3bae37158c58bc6627ed40053335a0a734aa13bc8202317a02cc24412cded3e1
4
+ data.tar.gz: 11f9dc18208c5e64dcb9f1ad35120b5f722ed796ba27c2a9ec12db6d98d98d91
5
5
  SHA512:
6
- metadata.gz: ff69ba97d358c76aa80452900ae37a0dc73bca4311d3d11962b053154443caebce68fe1414f220a6071b59f8a164c490f99ec41545148fd64b5c63c18c8b1186
7
- data.tar.gz: ab67ffdb07ba5e4761900357eeb3e43c8c6555104ba93a0dbd1dfd220bd72b8b380744eca2cd0f998eb0af9edd03a9cb5a79226c23f0820fd70924893f83b607
6
+ metadata.gz: d8231e4d9c3cd8d1e890d30c74d25cfbcfec394ea3c4d86d4d5ca50fac965019423c5dfc3c3c287696f34caa61c2352fd255a4df7a7b71ced1e82f7e4b1f49fe
7
+ data.tar.gz: 9d19a1f9dce3242860ad4450bf200d33eece668c63af750b3517f66ee2e4820e0164b66e5eeecaa58b67e1370eb7197e342444085f856415fff857e857a2c514
@@ -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,50 +22,11 @@ module LesliSystem
21
22
  return ENGINES[engine]
22
23
  end
23
24
 
24
- # Lesli::System.engines()
25
- # Lesli::System.engines(:local => true)
26
- def self.engines local: false
27
-
25
+ def self.engines
28
26
  return ENGINES unless ENGINES.empty?
29
27
 
30
- # due we do not know the engine mounted path we have to look up for it every
31
- # time we load the html view so we can use the dynamic route from the main rails app
32
- # we use this in the url plugin
33
- LESLI_ENGINES.each do |engine|
34
-
35
- # skip if engine is not installed
36
- next unless Object.const_defined?(engine)
37
-
38
- # convert engine name to Ruby object
39
- engine_instance = "#{engine}".constantize
28
+ engines_and_gems(:engine, LESLI_ENGINES)
40
29
 
41
- # check if engines installed locally are required
42
- if local
43
-
44
- # build the path were engines should be installed
45
- engine_local_path = Rails.root.join("engines", engine)
46
-
47
- # do not include engines if not is locally installed
48
- next unless File.exist?(engine_local_path)
49
- end
50
-
51
- gem_specification = Gem::Specification.find_by_name(engine.underscore)
52
-
53
- # engine completelly information
54
- ENGINES[engine] = {
55
- :code => engine.underscore,
56
- :name => engine,
57
- :path => engine_instance::Engine.routes.find_script_name({}),
58
- :version => engine_instance::VERSION,
59
- :summary => gem_specification.summary,
60
- :description => gem_specification.description,
61
- :metadata => gem_specification.metadata,
62
- :build => engine_instance::BUILD,
63
- :dir => gem_specification.gem_dir
64
- }
65
- end
66
-
67
- # also include the rails main_app
68
30
  ENGINES["Root"] = {
69
31
  :code => "root",
70
32
  :name => "Root",
@@ -80,8 +42,59 @@ module LesliSystem
80
42
  ENGINES
81
43
  end
82
44
 
45
+ def self.gems
46
+ return GEMS unless GEMS.empty?
47
+ engines_and_gems(:gem, LESLI_GEMS)
48
+ GEMS
49
+ end
50
+
83
51
  private
84
52
 
53
+ # Lesli::System.engines()
54
+ # Lesli::System.engines(:local => true)
55
+ def self.engines_and_gems engine_or_gem, lesli_gems
56
+
57
+ # due we do not know the engine mounted path we have to look up for it every
58
+ # time we load the html view so we can use the dynamic route from the main rails app
59
+ # we use this in the url plugin
60
+ lesli_gems.each do |lesli_gem|
61
+
62
+ # skip if engine is not installed
63
+ next unless Object.const_defined?(lesli_gem)
64
+
65
+ # convert engine name to Ruby object
66
+ gem_instance = "#{lesli_gem}".constantize
67
+
68
+ gem_specification = Gem::Specification.find_by_name(lesli_gem.underscore)
69
+
70
+ path = (engine_or_gem == :engine) ? gem_instance::Engine.routes.find_script_name({}) : nil
71
+
72
+ # Define the shared data structure
73
+ gem_data = {
74
+ code: lesli_gem.underscore,
75
+ name: lesli_gem,
76
+ path: path,
77
+ version: gem_instance::VERSION,
78
+ summary: gem_specification.summary,
79
+ description: gem_specification.description,
80
+ metadata: gem_specification.metadata,
81
+ build: gem_instance::BUILD,
82
+ dir: gem_specification.gem_dir
83
+ }
84
+
85
+ # Assign to the correct constant
86
+ target_collection = (engine_or_gem == :engine) ? ENGINES : GEMS
87
+ target_collection[lesli_gem] = gem_data
88
+ end
89
+ end
90
+
91
+ LESLI_GEMS = %w[
92
+ LesliDate
93
+ LesliView
94
+ LesliAssets
95
+ LesliSystem
96
+ ]
97
+
85
98
  LESLI_ENGINES = %w[
86
99
  Lesli
87
100
  LesliBell
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LesliSystem
4
- VERSION = "1.0.4"
5
- BUILD = "1754919086"
4
+ VERSION = "1.0.6"
5
+ BUILD = "1767508668"
6
6
  end
data/lib/lesli_system.rb CHANGED
@@ -15,4 +15,8 @@ module LesliSystem
15
15
  def self.engines(**kwargs)
16
16
  Engines.engines(**kwargs)
17
17
  end
18
+
19
+ def self.gems
20
+ Engines.gems
21
+ end
18
22
  end
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
4
+ version: 1.0.6
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: 2025-08-11 00:00:00.000000000 Z
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.4.19
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: []