rails-worktrees 0.7.1 → 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: 36b6c2a6e2e481803b035ba28c575c1619ba5fb1d158f0e4c6e4180d69aeafee
4
- data.tar.gz: 9265e0459e03d34cbc4962b181bdd62836ddb4433c392d8aac43b65f445992a1
3
+ metadata.gz: 4ca5bda1caef0299d08ce62341cebeb9fe2cf35be6acb2c84438af5cfcb11f8e
4
+ data.tar.gz: c3278894ecf06ef752d15ff56ab64c47b56bdb2f0cf39e0773012ce71eda8823
5
5
  SHA512:
6
- metadata.gz: 7cfecdcffdaeb1e229332c1a8a20ed80f2600886a58deb4f2f9b186c70957f2b70224a950e1c9109b3d9d234db3c18fe7789074ba1109e58d6e1da35236e2923
7
- data.tar.gz: 977ebc76e219d9e31d05595852ab830355c6ca30f2617d2ead869b4d5ccce18b0bbc0360dd4e533aff6ffab53c7eee7c20480ec2f380881c69d5387e859526b0
6
+ metadata.gz: bdb2583a6e1f1e8785599a31907c5a69c50eed1a8ebc9909fa139a59d4dd0ae5df0e941403aff68b3742f3c5c565461021418320b7a98054e7c710b491f3405a
7
+ data.tar.gz: 9ee5cc2bbd46b0b1cf152576be8269ee03bc0b3f749c3d878ce01976a6166fb2de2d4862dd4789b45569161e3f04802cdb2864a2973514a11f9184f0923e3fd4
@@ -1 +1 @@
1
- {".":"0.7.1"}
1
+ {".":"0.7.3"}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
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
+
10
+ ## [0.7.2](https://github.com/asjer/rails-worktrees/compare/v0.7.1...v0.7.2) (2026-07-06)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **wt:** normalize non-UTF-8 locale values before bundler ([17e644b](https://github.com/asjer/rails-worktrees/commit/17e644b0b5f4e2174802baae9bc844b29f5ff36d))
16
+
3
17
  ## [0.7.1](https://github.com/asjer/rails-worktrees/compare/v0.7.0...v0.7.1) (2026-07-06)
4
18
 
5
19
 
@@ -17,8 +17,8 @@ export PATH
17
17
 
18
18
  wt_locale_needs_utf8() {
19
19
  case "${1:-}" in
20
- ""|C|POSIX) return 0 ;;
21
- *) return 1 ;;
20
+ *[._-][Uu][Tt][Ff]-8*|*[._-][Uu][Tt][Ff]8*) return 1 ;;
21
+ *) return 0 ;;
22
22
  esac
23
23
  }
24
24
 
@@ -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
@@ -137,7 +137,7 @@ module Rails
137
137
  def env_value(lines, key)
138
138
  line = lines.reverse.find { |entry| entry.start_with?("#{key}=") }
139
139
  value = line&.split('=', 2)&.last
140
- value unless value&.empty?
140
+ presence(value)
141
141
  end
142
142
 
143
143
  def dev_port_resolution
@@ -92,7 +92,7 @@ module Rails
92
92
  def env_value(lines, key)
93
93
  line = lines.reverse.find { |entry| entry.start_with?("#{key}=") }
94
94
  value = line&.split('=', 2)&.last
95
- value unless value&.empty?
95
+ value if value && !value.empty?
96
96
  end
97
97
 
98
98
  def allocate_dev_port
@@ -3,7 +3,6 @@ module Rails
3
3
  # Audits and prepares safe file-based maintenance updates for the current checkout.
4
4
  # rubocop:disable Metrics/ClassLength, Metrics/MethodLength, Metrics/AbcSize
5
5
  class ProjectMaintenance
6
- # rubocop:disable Style/RedundantStructKeywordInit
7
6
  Check = Struct.new(
8
7
  :identifier,
9
8
  :category,
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Worktrees
3
- VERSION = '0.7.1'.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.1
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asjer Querido