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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92c437f85656f59bd6c5877a58cfcf49702947681eeac69beed82841980960a4
4
- data.tar.gz: 3a474089bcabba3772a516c3c8580cefd27af3fbfed2ade1cce7bded48fb855b
3
+ metadata.gz: 85e62f3d407792c3b06e76d12b38e287487344b4d109277eb6cae3bfcb55b284
4
+ data.tar.gz: 95572c747deabfce33f1e9c2940a6bdbef46df117f72c98c2b0fdfd059e2e03d
5
5
  SHA512:
6
- metadata.gz: ff69ba97d358c76aa80452900ae37a0dc73bca4311d3d11962b053154443caebce68fe1414f220a6071b59f8a164c490f99ec41545148fd64b5c63c18c8b1186
7
- data.tar.gz: ab67ffdb07ba5e4761900357eeb3e43c8c6555104ba93a0dbd1dfd220bd72b8b380744eca2cd0f998eb0af9edd03a9cb5a79226c23f0820fd70924893f83b607
6
+ metadata.gz: 6e8899e47ef9547ee9ded144bb5b7495bbc01e27811449094db0b243d0e1dbe68a39fac88d7f88d9cee071537326d35fb33f7a71e39021409282dc2a1a2a5b7b
7
+ data.tar.gz: 56a7047d1fb1394a053142a6b15057dd82661e9794b7156d618c4e6815cb94a57be1442fa8b3cca4eea88be4dbf6f4d66e3eae817048391a035b412d36ba89f1
@@ -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.engines local: false
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
- LESLI_ENGINES.each do |engine|
60
+ lesli_gems.each do |lesli_gem|
34
61
 
35
62
  # skip if engine is not installed
36
- next unless Object.const_defined?(engine)
63
+ next unless Object.const_defined?(lesli_gem)
37
64
 
38
65
  # convert engine name to Ruby object
39
- engine_instance = "#{engine}".constantize
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
- engine_local_path = Rails.root.join("engines", engine)
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?(engine_local_path)
75
+ next unless File.exist?(gem_local_path)
49
76
  end
50
77
 
51
- gem_specification = Gem::Specification.find_by_name(engine.underscore)
78
+ gem_specification = Gem::Specification.find_by_name(lesli_gem.underscore)
52
79
 
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
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
- ENGINES
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
- private
101
+ LESLI_GEMS = %w[
102
+ LesliDate
103
+ LesliView
104
+ LesliAssets
105
+ LesliSystem
106
+ ]
84
107
 
85
108
  LESLI_ENGINES = %w[
86
109
  Lesli
@@ -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.5"
5
+ BUILD = "1767506624"
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.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: 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: []