brainiac 0.0.18 → 0.0.19
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/Gemfile.lock +2 -2
- data/bin/brainiac +67 -13
- data/lib/brainiac/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5f6394c1ba27e48f098ae99072714cfd9cc7ca1c2412b89f62380f5d72e59a7f
|
|
4
|
+
data.tar.gz: ad4cdf5660afddfcadd96456da668452ba5d663f98eafedf2bcbefb3ba328aaa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7af17dcf8b530ff9e34bb1338dcbb57006586e0e6fd142ef21268dfb042530db56b5e427a7b7537509c13dfd4fb548674d2509d67c0109e8d3ca240fcca7656e
|
|
7
|
+
data.tar.gz: 4bd7ad87450d7c404f55b48c6e556709c0bd7fd4fc45b3f7f4ed50b97f20553ac704327540d099136a57d6928466cf9fc1750d96ac1bb128a641accc32829378
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
brainiac (0.0.
|
|
4
|
+
brainiac (0.0.19)
|
|
5
5
|
puma (~> 7.2)
|
|
6
6
|
rackup (~> 2.3)
|
|
7
7
|
sinatra (~> 4.1)
|
|
@@ -84,7 +84,7 @@ DEPENDENCIES
|
|
|
84
84
|
CHECKSUMS
|
|
85
85
|
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
86
86
|
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
87
|
-
brainiac (0.0.
|
|
87
|
+
brainiac (0.0.19)
|
|
88
88
|
json (2.19.9) sha256=9b9025b7cdddafa38d316eca0b2358488e42d417045c1b90d216a9fefe46b79a
|
|
89
89
|
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
|
|
90
90
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
data/bin/brainiac
CHANGED
|
@@ -2392,7 +2392,10 @@ when "update", "upgrade"
|
|
|
2392
2392
|
puts "✓ #{gem_name} is already at the latest version (#{current_version})"
|
|
2393
2393
|
end
|
|
2394
2394
|
else
|
|
2395
|
-
# Update brainiac itself: brainiac update
|
|
2395
|
+
# Update brainiac itself + all installed plugins: brainiac update
|
|
2396
|
+
any_updated = false
|
|
2397
|
+
|
|
2398
|
+
# --- Update brainiac core ---
|
|
2396
2399
|
current_version = BRAINIAC_VERSION
|
|
2397
2400
|
|
|
2398
2401
|
puts "Updating brainiac gem..."
|
|
@@ -2404,22 +2407,73 @@ when "update", "upgrade"
|
|
|
2404
2407
|
exit 1
|
|
2405
2408
|
end
|
|
2406
2409
|
|
|
2407
|
-
# Parse installed version from gem install output
|
|
2408
2410
|
new_version = output[/Successfully installed brainiac-(\S+)/, 1]
|
|
2409
2411
|
|
|
2410
2412
|
if new_version
|
|
2411
2413
|
puts "✓ Updated brainiac: #{current_version} → #{new_version}"
|
|
2412
|
-
|
|
2413
|
-
if find_server_pid
|
|
2414
|
-
puts " Restarting server to apply..."
|
|
2415
|
-
wait_for_agents_to_finish
|
|
2416
|
-
stop_server
|
|
2417
|
-
sleep 2
|
|
2418
|
-
start_server(daemon: true)
|
|
2419
|
-
end
|
|
2414
|
+
any_updated = true
|
|
2420
2415
|
else
|
|
2421
2416
|
puts "✓ brainiac is already at the latest version (#{current_version})"
|
|
2422
2417
|
end
|
|
2418
|
+
|
|
2419
|
+
# --- Update all installed plugins ---
|
|
2420
|
+
plugins_file = File.join(BRAINIAC_DIR, "plugins.json")
|
|
2421
|
+
plugins_config = if File.exist?(plugins_file)
|
|
2422
|
+
JSON.parse(File.read(plugins_file))
|
|
2423
|
+
else
|
|
2424
|
+
{ "plugins" => [] }
|
|
2425
|
+
end
|
|
2426
|
+
|
|
2427
|
+
plugins = (plugins_config["plugins"] || []).reject do |p|
|
|
2428
|
+
entry = p.is_a?(Hash) ? p : { "name" => p.to_s }
|
|
2429
|
+
# Skip local-path plugins — they're updated via git
|
|
2430
|
+
entry["path"]
|
|
2431
|
+
end
|
|
2432
|
+
|
|
2433
|
+
if plugins.any?
|
|
2434
|
+
puts ""
|
|
2435
|
+
puts "Checking #{plugins.size} installed plugin(s) for updates..."
|
|
2436
|
+
puts ""
|
|
2437
|
+
|
|
2438
|
+
plugins.each do |p|
|
|
2439
|
+
entry = p.is_a?(Hash) ? p : { "name" => p.to_s }
|
|
2440
|
+
plugin_name = entry["name"]
|
|
2441
|
+
gem_name = entry["gem"] || "brainiac-#{plugin_name}"
|
|
2442
|
+
|
|
2443
|
+
plugin_current = begin
|
|
2444
|
+
spec = Gem::Specification.find_by_name(gem_name)
|
|
2445
|
+
spec.version.to_s
|
|
2446
|
+
rescue Gem::MissingSpecError
|
|
2447
|
+
nil
|
|
2448
|
+
end
|
|
2449
|
+
|
|
2450
|
+
plugin_output, plugin_status = Open3.capture2e("gem install #{gem_name}")
|
|
2451
|
+
|
|
2452
|
+
unless plugin_status.success?
|
|
2453
|
+
puts " ✗ #{gem_name}: failed to update"
|
|
2454
|
+
next
|
|
2455
|
+
end
|
|
2456
|
+
|
|
2457
|
+
plugin_new = plugin_output[/Successfully installed #{Regexp.escape(gem_name)}-(\S+)/, 1]
|
|
2458
|
+
|
|
2459
|
+
if plugin_new
|
|
2460
|
+
puts " ✓ #{gem_name}: #{plugin_current || "unknown"} → #{plugin_new}"
|
|
2461
|
+
any_updated = true
|
|
2462
|
+
else
|
|
2463
|
+
puts " ✓ #{gem_name}: already at latest (#{plugin_current})"
|
|
2464
|
+
end
|
|
2465
|
+
end
|
|
2466
|
+
end
|
|
2467
|
+
|
|
2468
|
+
# --- Restart server if anything was updated ---
|
|
2469
|
+
if any_updated && find_server_pid
|
|
2470
|
+
puts ""
|
|
2471
|
+
puts "Restarting server to apply updates..."
|
|
2472
|
+
wait_for_agents_to_finish
|
|
2473
|
+
stop_server
|
|
2474
|
+
sleep 2
|
|
2475
|
+
start_server(daemon: true)
|
|
2476
|
+
end
|
|
2423
2477
|
end
|
|
2424
2478
|
|
|
2425
2479
|
when "install"
|
|
@@ -3150,8 +3204,8 @@ when "help", "--help", "-h", nil
|
|
|
3150
3204
|
brainiac projects default <key> Set the default project
|
|
3151
3205
|
brainiac show <key> Show project configuration
|
|
3152
3206
|
brainiac plugin new <name> Generate a new plugin gem skeleton
|
|
3153
|
-
brainiac update Update brainiac
|
|
3154
|
-
brainiac update <plugin> Update
|
|
3207
|
+
brainiac update Update brainiac and all installed plugins
|
|
3208
|
+
brainiac update <plugin> Update a specific installed plugin
|
|
3155
3209
|
brainiac install <plugin> Install a Brainiac plugin (gem-based handler)
|
|
3156
3210
|
brainiac uninstall <plugin> Remove an installed plugin
|
|
3157
3211
|
brainiac plugins List installed plugins
|
|
@@ -3172,7 +3226,7 @@ when "help", "--help", "-h", nil
|
|
|
3172
3226
|
plugin new <name> Generate a new plugin gem skeleton
|
|
3173
3227
|
install <name> Install a plugin (gem install brainiac-<name>)
|
|
3174
3228
|
uninstall <name> Remove a plugin
|
|
3175
|
-
update [name] Update brainiac or a specific plugin
|
|
3229
|
+
update [name] Update brainiac + all plugins, or a specific plugin
|
|
3176
3230
|
plugins List installed plugins
|
|
3177
3231
|
|
|
3178
3232
|
Card Map Commands:
|
data/lib/brainiac/version.rb
CHANGED