rails-worktrees 0.7.2 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de3eeef113e3b2f6fdc6774bc47c458e84bcc70d92f352dfb858012d6b50648b
4
- data.tar.gz: 98eeb91a38f511f1a4a4cc183bcbd60d3d5e995e40dfd1a33fed86a331d8a7f6
3
+ metadata.gz: 4ca5bda1caef0299d08ce62341cebeb9fe2cf35be6acb2c84438af5cfcb11f8e
4
+ data.tar.gz: c3278894ecf06ef752d15ff56ab64c47b56bdb2f0cf39e0773012ce71eda8823
5
5
  SHA512:
6
- metadata.gz: 577df7dbf705f4cc9d2b8f71baa4589fcc71ef948145b2ff242bd3dfa27829b78a3b557c3874f23251e0541d5ae2ba868066d70a991dcaa0b918fca060d9593b
7
- data.tar.gz: 11685a0f0ba79e3d09af74d9c01499582cf61f6a8cb21a54e94e76763ba0cf70bede1c0f0d0f76e1be0364c92043a91adef9cb3280e2cdc13ceb40047c07f479
6
+ metadata.gz: bdb2583a6e1f1e8785599a31907c5a69c50eed1a8ebc9909fa139a59d4dd0ae5df0e941403aff68b3742f3c5c565461021418320b7a98054e7c710b491f3405a
7
+ data.tar.gz: 9ee5cc2bbd46b0b1cf152576be8269ee03bc0b3f749c3d878ce01976a6166fb2de2d4862dd4789b45569161e3f04802cdb2864a2973514a11f9184f0923e3fd4
@@ -1 +1 @@
1
- {".":"0.7.2"}
1
+ {".":"0.7.3"}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.3](https://github.com/asjer/rails-worktrees/compare/v0.7.2...v0.7.3) (2026-07-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **wt:** add bundle fallback for wt bootstrap ([f5ab21e](https://github.com/asjer/rails-worktrees/commit/f5ab21ef1014ea2baaa67dca1ce085b6b70dfcd5))
9
+
3
10
  ## [0.7.2](https://github.com/asjer/rails-worktrees/compare/v0.7.1...v0.7.2) (2026-07-06)
4
11
 
5
12
 
@@ -62,4 +62,53 @@ if [ -n "$WT_MISE_CONFIG" ] && [ -z "${RAILS_WORKTREES_BOOTSTRAPPED:-}" ] && com
62
62
  fi
63
63
 
64
64
  export BUNDLE_GEMFILE="${BUNDLE_GEMFILE:-$WT_APP_ROOT/Gemfile}"
65
- exec ruby -rbundler/setup -e 'load Gem.bin_path("rails-worktrees", "wt")' -- "$@"
65
+ exec ruby /dev/fd/3 "$@" 3<<'RUBY'
66
+ def rails_worktrees_bootstrap_safe_invocation?(argv)
67
+ args = argv.map(&:to_s)
68
+ return true if args.empty?
69
+ return true if %w[-h --help -v --version].include?(args.first)
70
+ return true if %w[--env --print-env].include?(args.first)
71
+
72
+ command_args = args.reject { |arg| %w[--dry-run --skip-setup --env --print-env].include?(arg) }
73
+ command = command_args.first
74
+
75
+ return true if %w[setup doctor update].include?(command)
76
+ return false if %w[remove delete prune].include?(command)
77
+
78
+ command_args.length <= 1
79
+ end
80
+
81
+ def rails_worktrees_incomplete_bundle_message(error)
82
+ error.message.to_s.lines.first.to_s.strip
83
+ end
84
+
85
+ def rails_worktrees_load_without_bundler(original_error)
86
+ ENV.delete('BUNDLE_GEMFILE')
87
+ Gem.clear_paths if Gem.respond_to?(:clear_paths)
88
+ load Gem.bin_path('rails-worktrees', 'wt')
89
+ rescue Gem::Exception, LoadError => fallback_error
90
+ warn 'rails-worktrees: app bundle is incomplete and no fallback rails-worktrees executable could be loaded.'
91
+ warn " Bundler: #{rails_worktrees_incomplete_bundle_message(original_error)}"
92
+ warn " Fallback: #{fallback_error.class}: #{fallback_error.message}"
93
+ warn 'Run `bundle install` or install rails-worktrees outside the app bundle, then retry `bin/wt setup`.'
94
+ exit 1
95
+ end
96
+
97
+ begin
98
+ require 'bundler/setup'
99
+ load Gem.bin_path('rails-worktrees', 'wt')
100
+ rescue StandardError => error
101
+ raise unless defined?(Bundler::GemNotFound) && error.is_a?(Bundler::GemNotFound)
102
+
103
+ if rails_worktrees_bootstrap_safe_invocation?(ARGV)
104
+ warn 'rails-worktrees: app bundle is incomplete; falling back to the globally installed wt executable.'
105
+ warn " #{rails_worktrees_incomplete_bundle_message(error)}"
106
+ rails_worktrees_load_without_bundler(error)
107
+ end
108
+
109
+ warn 'rails-worktrees: cannot start wt because the app bundle is incomplete.'
110
+ warn " #{rails_worktrees_incomplete_bundle_message(error)}"
111
+ warn 'Run `bundle install` or `bin/wt setup` to install missing gems, then retry.'
112
+ exit 1
113
+ end
114
+ RUBY
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Worktrees
3
- VERSION = '0.7.2'.freeze
3
+ VERSION = '0.7.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-worktrees
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asjer Querido