Skip to content

Commit

Permalink
Update --ext=rust to support compiling the native extension from so…
Browse files Browse the repository at this point in the history
…urce
  • Loading branch information
karreiro committed Apr 25, 2024
1 parent 469d89e commit 8e28b14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 0 additions & 3 deletions bundler/lib/bundler/templates/newgem/Gemfile.tt
Expand Up @@ -9,9 +9,6 @@ gem "rake", "~> 13.0"
<%- if config[:ext] -%>

gem "rake-compiler"
<%- if config[:ext] == 'rust' -%>
gem "rb_sys", "~> 0.9.63"
<%- end -%>
<%- end -%>
<%- if config[:test] -%>

Expand Down
8 changes: 4 additions & 4 deletions bundler/lib/bundler/templates/newgem/newgem.gemspec.tt
Expand Up @@ -37,15 +37,15 @@ Gem::Specification.new do |spec|
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
<%- if config[:ext] == 'c' -%>
<%- if config[:ext] == 'c' || config[:ext] == 'rust' -%>
spec.extensions = ["ext/<%= config[:underscored_name] %>/extconf.rb"]
<%- end -%>
<%- if config[:ext] == 'rust' -%>
spec.extensions = ["ext/<%= config[:underscored_name] %>/Cargo.toml"]
<%- end -%>

# Uncomment to register a new dependency of your gem
# spec.add_dependency "example-gem", "~> 1.0"
<%- if config[:ext] == 'rust' -%>
spec.add_dependency "rb_sys", "~> 0.9.97"
<%- end -%>

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
Expand Down

0 comments on commit 8e28b14

Please sign in to comment.