brainiac 0.0.10 → 0.0.11

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: 5a092aa729b54067193a5515a8064bcf4ecd70f09862091ec60dfd79e747960e
4
- data.tar.gz: 841ea49e26c9c609ce6cc4bcf15056bf1e87cffc4420366731dd155e9b64462c
3
+ metadata.gz: f759330dabb075b9985fbcd292cee6ea95f169f9f77f4a4e768f1000fe472881
4
+ data.tar.gz: 4e07d91b5eb2bbee9626e7cf451675e5fdbd91d5e86026fa2196b829e138afb0
5
5
  SHA512:
6
- metadata.gz: 9a41b37fd88744a88043317f8d543a2cf05841cfa774a55311c6e5afe9ee52ebe262ec41ed6bca0386f61c05c2310d8d1fd0244f75804434be9c97b93a41f573
7
- data.tar.gz: af3152d1cb96fce507cb71b29140bab7a3fb23f76eb845207e80a4b48bbab5f5f2377817b929938731fa660598bcb3e936c6b1d9c9b8cca4e2a89f7738435231
6
+ metadata.gz: 78b88c78560ed966abce36c296f373754fe0da6291b1fc1ff036b1a25df0e1ce51e15e1786eb7b8adb369244ed63f66d6181e4775b173cf2c8437955251c9a2a
7
+ data.tar.gz: 8c2da39a481413178e67becfdae89709d28d247463abc3e3c3cbbcc1db8920bb780709a6dfbe7755e3b70cf036330f47516b977762cec6293a19976ebbc5e192
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brainiac (0.0.10)
4
+ brainiac (0.0.11)
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.10)
87
+ brainiac (0.0.11)
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
@@ -2277,6 +2277,96 @@ when "completions"
2277
2277
  puts File.read(completion_file)
2278
2278
  end
2279
2279
 
2280
+ when "update", "upgrade"
2281
+ name = ARGV.shift
2282
+
2283
+ if name
2284
+ # Update a specific plugin: brainiac update <plugin_name>
2285
+ name = name.sub(/^brainiac-/, "")
2286
+ gem_name = "brainiac-#{name}"
2287
+
2288
+ # Verify plugin is installed
2289
+ plugins_file = File.join(BRAINIAC_DIR, "plugins.json")
2290
+ plugins_config = if File.exist?(plugins_file)
2291
+ JSON.parse(File.read(plugins_file))
2292
+ else
2293
+ { "plugins" => [] }
2294
+ end
2295
+
2296
+ plugin_entry = (plugins_config["plugins"] || []).find { |p| (p.is_a?(Hash) ? p["name"] : p.to_s) == name }
2297
+
2298
+ if plugin_entry && plugin_entry.is_a?(Hash) && plugin_entry["path"]
2299
+ puts "Plugin '#{name}' is installed from a local path: #{plugin_entry["path"]}"
2300
+ puts "Local plugins are updated via git pull in their source directory."
2301
+ exit 0
2302
+ end
2303
+
2304
+ unless plugin_entry
2305
+ puts "Plugin '#{name}' is not installed."
2306
+ puts " Install it first: brainiac install #{name}"
2307
+ exit 1
2308
+ end
2309
+
2310
+ # Get current version before update
2311
+ current_version = begin
2312
+ spec = Gem::Specification.find_by_name(gem_name)
2313
+ spec.version.to_s
2314
+ rescue Gem::MissingSpecError
2315
+ nil
2316
+ end
2317
+
2318
+ puts "Updating #{gem_name}..."
2319
+ system("gem install #{gem_name}")
2320
+ unless $CHILD_STATUS.success?
2321
+ puts ""
2322
+ puts "Failed to update #{gem_name}."
2323
+ exit 1
2324
+ end
2325
+
2326
+ # Show version change
2327
+ Gem::Specification.reset
2328
+ new_version = begin
2329
+ spec = Gem::Specification.find_by_name(gem_name)
2330
+ spec.version.to_s
2331
+ rescue Gem::MissingSpecError
2332
+ "unknown"
2333
+ end
2334
+
2335
+ if current_version && current_version == new_version
2336
+ puts "✓ #{gem_name} is already at the latest version (#{new_version})"
2337
+ else
2338
+ puts "✓ Updated #{gem_name}: #{current_version || "new"} → #{new_version}"
2339
+ puts " Restart the server to activate: brainiac restart"
2340
+ end
2341
+ else
2342
+ # Update brainiac itself: brainiac update
2343
+ current_version = BRAINIAC_VERSION
2344
+
2345
+ puts "Updating brainiac gem..."
2346
+ system("gem install brainiac")
2347
+ unless $CHILD_STATUS.success?
2348
+ puts ""
2349
+ puts "Failed to update brainiac."
2350
+ exit 1
2351
+ end
2352
+
2353
+ # Show version change
2354
+ Gem::Specification.reset
2355
+ new_version = begin
2356
+ spec = Gem::Specification.find_by_name("brainiac")
2357
+ spec.version.to_s
2358
+ rescue Gem::MissingSpecError
2359
+ "unknown"
2360
+ end
2361
+
2362
+ if current_version == new_version
2363
+ puts "✓ brainiac is already at the latest version (#{new_version})"
2364
+ else
2365
+ puts "✓ Updated brainiac: #{current_version} → #{new_version}"
2366
+ puts " Restart the server to apply: brainiac restart"
2367
+ end
2368
+ end
2369
+
2280
2370
  when "install"
2281
2371
  name = ARGV.shift
2282
2372
  unless name
@@ -3004,6 +3094,8 @@ when "help", "--help", "-h", nil
3004
3094
  brainiac projects default <key> Set the default project
3005
3095
  brainiac show <key> Show project configuration
3006
3096
  brainiac plugin new <name> Generate a new plugin gem skeleton
3097
+ brainiac update Update brainiac to the latest version
3098
+ brainiac update <plugin> Update an installed plugin to the latest version
3007
3099
  brainiac install <plugin> Install a Brainiac plugin (gem-based handler)
3008
3100
  brainiac uninstall <plugin> Remove an installed plugin
3009
3101
  brainiac plugins List installed plugins
@@ -3024,6 +3116,7 @@ when "help", "--help", "-h", nil
3024
3116
  plugin new <name> Generate a new plugin gem skeleton
3025
3117
  install <name> Install a plugin (gem install brainiac-<name>)
3026
3118
  uninstall <name> Remove a plugin
3119
+ update [name] Update brainiac or a specific plugin
3027
3120
  plugins List installed plugins
3028
3121
 
3029
3122
  Card Map Commands:
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Brainiac
4
4
  # @return [String] the current gem version
5
- VERSION = "0.0.10"
5
+ VERSION = "0.0.11"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainiac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis