ace-support-config 0.10.2 → 0.16.3
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/CHANGELOG.md +106 -0
- data/README.md +16 -1
- data/docs/demo/ace-config-bootstrap-root-files.tape.yml +31 -0
- data/docs/demo/ace-config-getting-started.tape.yml +3 -3
- data/docs/usage.md +52 -5
- data/lib/ace/support/config/cli.rb +56 -12
- data/lib/ace/support/config/molecules/project_config_scanner.rb +1 -1
- data/lib/ace/support/config/molecules/setup_doctor_reporter.rb +270 -0
- data/lib/ace/support/config/organisms/config_synchronizer.rb +197 -0
- data/lib/ace/support/config/organisms/setup_doctor.rb +1069 -0
- data/lib/ace/support/config/version.rb +1 -1
- data/lib/ace/support/config.rb +3 -1
- metadata +6 -3
- data/lib/ace/support/config/organisms/config_initializer.rb +0 -116
data/lib/ace/support/config.rb
CHANGED
|
@@ -22,12 +22,14 @@ require_relative "config/molecules/yaml_loader"
|
|
|
22
22
|
require_relative "config/molecules/config_finder"
|
|
23
23
|
require_relative "config/molecules/file_config_resolver"
|
|
24
24
|
require_relative "config/molecules/project_config_scanner"
|
|
25
|
+
require_relative "config/molecules/setup_doctor_reporter"
|
|
25
26
|
|
|
26
27
|
# Load organisms (depend on molecules)
|
|
27
28
|
require_relative "config/organisms/config_resolver"
|
|
28
29
|
require_relative "config/organisms/virtual_config_resolver"
|
|
29
|
-
require_relative "config/organisms/
|
|
30
|
+
require_relative "config/organisms/config_synchronizer"
|
|
30
31
|
require_relative "config/organisms/config_diff"
|
|
32
|
+
require_relative "config/organisms/setup_doctor"
|
|
31
33
|
require_relative "config/models/config_templates"
|
|
32
34
|
|
|
33
35
|
module Ace
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ace-support-config
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.16.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michal Czyz
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-04-
|
|
10
|
+
date: 2026-04-26 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: ace-support-fs
|
|
@@ -66,6 +66,7 @@ files:
|
|
|
66
66
|
- LICENSE
|
|
67
67
|
- README.md
|
|
68
68
|
- Rakefile
|
|
69
|
+
- docs/demo/ace-config-bootstrap-root-files.tape.yml
|
|
69
70
|
- docs/demo/ace-config-getting-started.tape.yml
|
|
70
71
|
- docs/usage.md
|
|
71
72
|
- exe/ace-config
|
|
@@ -84,10 +85,12 @@ files:
|
|
|
84
85
|
- lib/ace/support/config/molecules/config_finder.rb
|
|
85
86
|
- lib/ace/support/config/molecules/file_config_resolver.rb
|
|
86
87
|
- lib/ace/support/config/molecules/project_config_scanner.rb
|
|
88
|
+
- lib/ace/support/config/molecules/setup_doctor_reporter.rb
|
|
87
89
|
- lib/ace/support/config/molecules/yaml_loader.rb
|
|
88
90
|
- lib/ace/support/config/organisms/config_diff.rb
|
|
89
|
-
- lib/ace/support/config/organisms/config_initializer.rb
|
|
90
91
|
- lib/ace/support/config/organisms/config_resolver.rb
|
|
92
|
+
- lib/ace/support/config/organisms/config_synchronizer.rb
|
|
93
|
+
- lib/ace/support/config/organisms/setup_doctor.rb
|
|
91
94
|
- lib/ace/support/config/organisms/virtual_config_resolver.rb
|
|
92
95
|
- lib/ace/support/config/version.rb
|
|
93
96
|
homepage: https://github.com/cs3b/ace/tree/main/ace-support-config
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "fileutils"
|
|
4
|
-
require "pathname"
|
|
5
|
-
require_relative "../models/config_templates"
|
|
6
|
-
|
|
7
|
-
module Ace
|
|
8
|
-
module Support
|
|
9
|
-
module Config
|
|
10
|
-
module Organisms
|
|
11
|
-
class ConfigInitializer
|
|
12
|
-
def initialize(force: false, dry_run: false, global: false, verbose: false)
|
|
13
|
-
@force = force
|
|
14
|
-
@dry_run = dry_run
|
|
15
|
-
@global = global
|
|
16
|
-
@verbose = verbose
|
|
17
|
-
@copied_files = []
|
|
18
|
-
@skipped_files = []
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def init_all
|
|
22
|
-
puts "Initializing all ace-* gem configurations..." if @verbose
|
|
23
|
-
|
|
24
|
-
Models::ConfigTemplates.all_gems.each do |gem_name|
|
|
25
|
-
init_gem(gem_name)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
print_summary
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def init_gem(gem_name)
|
|
32
|
-
gem_name = normalize_gem_name(gem_name)
|
|
33
|
-
|
|
34
|
-
unless Models::ConfigTemplates.gem_exists?(gem_name)
|
|
35
|
-
puts "Warning: No configuration found for #{gem_name}"
|
|
36
|
-
return
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
puts "\nInitializing #{gem_name}..." if @verbose
|
|
40
|
-
|
|
41
|
-
source_dir = Models::ConfigTemplates.example_dir_for(gem_name)
|
|
42
|
-
target_dir = target_directory
|
|
43
|
-
|
|
44
|
-
unless File.exist?(source_dir)
|
|
45
|
-
puts "Warning: No .ace-defaults directory found for #{gem_name}"
|
|
46
|
-
return
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
show_config_docs_if_needed(gem_name, target_dir)
|
|
50
|
-
copy_config_files(source_dir, target_dir)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
private
|
|
54
|
-
|
|
55
|
-
def normalize_gem_name(name)
|
|
56
|
-
name.start_with?("ace-") ? name : "ace-#{name}"
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def target_directory
|
|
60
|
-
@global ? File.expand_path("~/.ace") : ".ace"
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def show_config_docs_if_needed(gem_name, target_dir)
|
|
64
|
-
config_subdir = gem_name.sub("ace-", "")
|
|
65
|
-
existing_configs = Dir.glob("#{target_dir}/#{config_subdir}/**/*").reject { |f| File.directory?(f) }
|
|
66
|
-
|
|
67
|
-
return if existing_configs.any? || @dry_run
|
|
68
|
-
|
|
69
|
-
docs_file = Models::ConfigTemplates.docs_file_for(gem_name)
|
|
70
|
-
puts "\n#{File.read(docs_file)}\n" if docs_file && File.exist?(docs_file)
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def copy_config_files(source_dir, target_dir)
|
|
74
|
-
Dir.glob("#{source_dir}/**/*").each do |source_file|
|
|
75
|
-
next if File.directory?(source_file)
|
|
76
|
-
|
|
77
|
-
relative_path = Pathname.new(source_file).relative_path_from(Pathname.new(source_dir))
|
|
78
|
-
target_file = File.join(target_dir, relative_path.to_s)
|
|
79
|
-
|
|
80
|
-
copy_file(source_file, target_file)
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def copy_file(source, target)
|
|
85
|
-
if File.exist?(target) && !@force
|
|
86
|
-
@skipped_files << target
|
|
87
|
-
puts " Skipped: #{target} (already exists)" if @verbose
|
|
88
|
-
return
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
if @dry_run
|
|
92
|
-
puts " Would copy: #{source} -> #{target}"
|
|
93
|
-
else
|
|
94
|
-
FileUtils.mkdir_p(File.dirname(target))
|
|
95
|
-
FileUtils.cp(source, target)
|
|
96
|
-
@copied_files << target
|
|
97
|
-
puts " Copied: #{target}" if @verbose
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
def print_summary
|
|
102
|
-
return if @dry_run
|
|
103
|
-
|
|
104
|
-
puts "\nConfiguration initialization complete:"
|
|
105
|
-
puts " Files copied: #{@copied_files.size}"
|
|
106
|
-
puts " Files skipped: #{@skipped_files.size}"
|
|
107
|
-
|
|
108
|
-
if @skipped_files.any? && !@force
|
|
109
|
-
puts "\nUse --force to overwrite existing files"
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
end
|