diff options
author | Josef Šimánek <josef.simanek@gmail.com> | 2022-12-17 14:34:49 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-12-20 13:15:02 +0900 |
commit | 8eb66180137e3cba030d43fba21980efa5f58bb3 (patch) | |
tree | c4fd3b0fb975aa7fb9d1b8311d637c83c894e5df /lib/bundler/cli/gem.rb | |
parent | eaf0157dd1ad6cfbecedd9ff4158954418c1331c (diff) | |
download | ruby-8eb66180137e3cba030d43fba21980efa5f58bb3.tar.gz |
[rubygems/rubygems] Turn `--ext` option into string. Deprecate usage without explicit value.
- this is preparation for onboarding Rust based extension gem generator
https://github.com/rubygems/rubygems/commit/d32801bdbc
Diffstat (limited to 'lib/bundler/cli/gem.rb')
-rw-r--r-- | lib/bundler/cli/gem.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index 135bfde038..584b28d67d 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -15,7 +15,7 @@ module Bundler "test-unit" => "3.0", }.freeze - attr_reader :options, :gem_name, :thor, :name, :target + attr_reader :options, :gem_name, :thor, :name, :target, :extension def initialize(options, gem_name, thor) @options = options @@ -28,7 +28,9 @@ module Bundler @name = @gem_name @target = SharedHelpers.pwd.join(gem_name) - validate_ext_name if options[:ext] + @extension = options[:ext] + + validate_ext_name if @extension end def run @@ -64,7 +66,7 @@ module Bundler :author => git_author_name.empty? ? "TODO: Write your name" : git_author_name, :email => git_user_email.empty? ? "TODO: Write your email address" : git_user_email, :test => options[:test], - :ext => options[:ext], + :ext => extension, :exe => options[:exe], :bundler_version => bundler_dependency_version, :git => use_git, @@ -188,7 +190,7 @@ module Bundler templates.merge!("exe/newgem.tt" => "exe/#{name}") if config[:exe] - if options[:ext] + if extension templates.merge!( "ext/newgem/extconf.rb.tt" => "ext/#{name}/extconf.rb", "ext/newgem/newgem.h.tt" => "ext/#{name}/#{underscored_name}.h", |