ocran 1.4.0 → 1.4.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: bda746979fe3d0906ec129a11cc4b6d2bc7233f8d11eea4e3f4fb8f2aac9f8a4
4
- data.tar.gz: dfa8ef139ec3ea69e984de479d90cfb00268d29abba79b609dbe7915d0002fe6
3
+ metadata.gz: e5b96c7de7250942c3f67b874546b10ff2ef0cb193e91f96c7c9736369937277
4
+ data.tar.gz: ef03135551cce98a71c1eb546c0717ee82031e7a2b1eddf73bb63ba06017ed4e
5
5
  SHA512:
6
- metadata.gz: 60aab3f5becf047750ff2efcd5b9c05ecce6493d1e9f77f576dfc94f0864110ee881b91456404367b99912967e2c4cef596558c75cfcfa66aeb48a4308b63e91
7
- data.tar.gz: cde421042a8d660dfb16d7fae20c7217d63cdaf5f701777115da1a2535af311580a6a9483609229d5faf326718d76edd1856b207a20f3df52b7b9f20565494af
6
+ metadata.gz: ba4c9a62f6a0c0cbcf88b6b7307df3777872e8cfb9a9b4e40352d0b8941dae0cf79d518c8ba4deea1eee2226137ecdcaf7cd2c575e0737f56db9f8e68907ab44
7
+ data.tar.gz: a43d0bd6b7e17b2c8120182468ec9f594ec2707f2cef0a8e086c1c5e33646e3e76606d4b4d6a93725d0a0b1517f5a77c4b8f0391a6e2be6fc5bfb99507b20cec
data/CHANGELOG.txt CHANGED
@@ -1,3 +1,6 @@
1
+ === 1.4.1
2
+ - Fix kernel_require.rb packed at wrong path when rubygems-update is installed (e.g. via asdf on Linux/macOS). kernel_require.rb is now located relative to the actually-loaded rubygems.rb from $LOADED_FEATURES, falling back to rubylibdir for standard Ruby installations.
3
+
1
4
  === 1.4.0
2
5
  - Add Linux support: build and run self-extracting ELF executables on Linux. The stub compiles and runs natively on Linux using POSIX APIs.
3
6
  - Add macOS support: build and run self-extracting Mach-O executables on macOS.
@@ -100,12 +100,25 @@ module Ocran
100
100
  # Since https://github.com/rubygems/rubygems/commit/cad4cf16cf8fcc637d9da643ef97cf0be2ed63cb
101
101
  # rubygems/core_ext/kernel_require.rb is loaded via IO.read+eval rather than require,
102
102
  # so it never appears in $LOADED_FEATURES and must be added manually.
103
- # Use RbConfig::CONFIG["rubylibdir"] directly so the path is always correct,
104
- # regardless of Ruby version or platform path separator conventions.
103
+ # We check multiple candidate locations because the layout varies by Ruby setup:
104
+ # - Standard Ruby (including RubyInstaller on Windows): rubygems.rb lives in rubylibdir
105
+ # - Ruby with rubygems-update (e.g. asdf on Linux/macOS): rubygems.rb lives in site_ruby
106
+ # kernel_require.rb must be packed alongside the rubygems.rb that was actually loaded,
107
+ # because rubygems.rb uses require_relative to load it.
105
108
  kernel_require_rel = "rubygems/core_ext/kernel_require.rb"
106
109
  unless features.any? { |f| f.to_posix.end_with?(kernel_require_rel) }
107
- kernel_require_path = Pathname(RbConfig::CONFIG["rubylibdir"]) / kernel_require_rel
108
- features.push(kernel_require_path) if kernel_require_path.exist?
110
+ # Prefer the location alongside the actually-loaded rubygems.rb, fall back to rubylibdir
111
+ rubygems_feature = features.find { |f| f.to_posix.end_with?("/rubygems.rb") }
112
+ candidate_dirs = []
113
+ candidate_dirs << rubygems_feature.dirname if rubygems_feature
114
+ candidate_dirs << Pathname(RbConfig::CONFIG["rubylibdir"])
115
+ candidate_dirs.each do |base_dir|
116
+ kernel_require_path = base_dir / kernel_require_rel
117
+ if kernel_require_path.exist?
118
+ features.push(kernel_require_path)
119
+ break
120
+ end
121
+ end
109
122
  end
110
123
 
111
124
  # Convert all relative paths to absolute paths before building.
data/lib/ocran/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ocran
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocran
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andi Idogawa