diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-03-22 14:09:12 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-03-22 14:09:12 +0900 |
| commit | af88ca4c076cde9a23ee68281994e1b443cf4e9b (patch) | |
| tree | f156c2cbbb9055fcdab96a6a5d7c40d8f2583eb0 | |
| parent | 235aa7ad63d8cf77043a2f62f3c3e30fd6af6c05 (diff) | |
Match `--with/--without` options against gem names
The simple names in `default_exclude_exts` do not match extension
paths under gems.
Extract each gem name from the gemspec file at the top level of each
gem directory. For example, if `ext` is `syslog-0.1.2/ext/syslog/`,
find out `syslog-0.1.2/syslog.gemspec` and take the base name `syslog`
without the suffix `.gemspec`.
| -rwxr-xr-x | ext/extmk.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb index ffd64209ae..6c7c7aeab7 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -517,6 +517,12 @@ cond = proc {|ext, *| incl, excl = Dir.glob("#{e}/**/extconf.rb", base: "#$top_srcdir/#{ext_prefix}").collect {|d| File.dirname(d) }.partition {|ext| + if @gemname + ext = ext[%r[\A[^/]+]] # extract gem name + Dir.glob("*.gemspec", base: "#$top_srcdir/#{ext_prefix}/#{ext}") do |g| + break ext = g if ext.start_with?("#{g.chomp!(".gemspec")}-") + end + end with_config(ext, &cond) } incl.sort! |
