rails-ai-context 4.5.0 → 4.5.1

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: 41d06a29e3165804283c9dcef76e2c1ee5625ef5ac236931fa492d76172062b6
4
- data.tar.gz: 8f2f81c3186b2d16fa9c4ea2b84721fd519d437b4cbd8fb99a3978e45723a189
3
+ metadata.gz: 9f75359acda5dcf480e297948934c7be7500fb3af5ff9daacd952a77105186e8
4
+ data.tar.gz: 17bfbc76237408f30a51d2b67bf4a5a8ed72b437bf03824bc41a937bd600477b
5
5
  SHA512:
6
- metadata.gz: 94ee0d646375d50942d8d3ea186a3f5faea8795f1fee1588f63304a06ab283db79e8dd07a1460284279b9edeac9bc3604e9208b847dda6ef144f9d5e68c5df2b
7
- data.tar.gz: 838c87226b6027f62aa045c3eebd2842f82434db0b6a9fa2f20234bde75a9e0f4d6407fe4d510e129c0e192141b15a75fec5c9d0d3620a2991c2860db7ad5e42
6
+ metadata.gz: 4cbe45e0efb3f6fc078cebd82dc0e1f6ac7246c6ea9ad53928c5588d1ddd1b937911e805f2d88f268c226d0277423860efbf860911cec5c8f1fb39c9d21d474f
7
+ data.tar.gz: bef426277ceda95f46d3bad899e188c6716b5d838af0b02b5d40349d3944b5a951cbe47889762b23b58b962e96fb7cd229ff2e775dedb1f35a2feb0342a8203a
data/exe/rails-ai-context CHANGED
@@ -1,6 +1,15 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ # Standalone mode: the RubyGems exe wrapper activates our gem and all transitive
5
+ # dependencies BEFORE this script runs. When inside a Rails app, Bundler.setup
6
+ # may need different versions of those deps (e.g., bigdecimal 4.1.0 activated here
7
+ # but Gemfile.lock wants 4.0.1). Clear non-default gem activations so Bundler can
8
+ # resolve cleanly. The $LOAD_PATH entries remain (Bundler.setup replaces them anyway).
9
+ if defined?(Gem) && Gem.respond_to?(:loaded_specs)
10
+ Gem.loaded_specs.delete_if { |_, spec| !spec.default_gem? }
11
+ end
12
+
4
13
  require "thor"
5
14
  require "yaml"
6
15
 
@@ -381,21 +390,24 @@ class RailsAiContextCLI < Thor
381
390
  exit 1
382
391
  end
383
392
 
384
- # Load gem + dependencies BEFORE Rails boot.
393
+ # Save $LOAD_PATH before Rails boot.
385
394
  # Bundler.setup (in config/boot.rb) strips $LOAD_PATH to Gemfile-only gems.
386
- # In standalone mode (gem not in Gemfile), this would remove our gem and mcp.
387
- # Loading first ensures Zeitwerk's autoload paths (absolute, not $LOAD_PATH-
388
- # dependent) are configured, and we can restore stripped paths after boot.
389
- require "mcp"
390
- require "rails_ai_context"
395
+ # In standalone mode (gem not in Gemfile), this removes our gem and mcp paths.
396
+ # We restore them after boot so lazy requires (mcp, etc.) still resolve.
397
+ #
398
+ # We do NOT require mcp or rails_ai_context before boot — that would activate
399
+ # gem versions that conflict with Bundler's resolution (e.g., bigdecimal).
400
+ # Instead, paths are restored and gems load lazily using Bundler-resolved deps.
391
401
  pre_boot_paths = $LOAD_PATH.dup
392
402
 
393
403
  require config_path
394
404
 
395
- # Restore dependency paths that Bundler.setup stripped (standalone mode).
405
+ # Restore paths that Bundler.setup stripped (standalone mode).
396
406
  # For Gemfile users, this is a no-op — no paths were removed.
397
407
  (pre_boot_paths - $LOAD_PATH).each { |p| $LOAD_PATH << p }
398
408
 
409
+ require "rails_ai_context"
410
+
399
411
  RailsAiContext::Configuration.auto_load!
400
412
  end
401
413
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAiContext
4
- VERSION = "4.5.0"
4
+ VERSION = "4.5.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-ai-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0
4
+ version: 4.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - crisnahine