I have a question about native extension code.
I want to find if the gem is written with some extension code.
There is no subcommand for gem command to detect whether a remote
rubygem has some extension present. You need to look at the source code
of the rubygem. The command gem search YOUR_GEM -d might be helpful
here.
However, once you have a gem installed you can use the command gem specification which outputs a very detailed spec for the gem in yaml
format.
For the Ruby, it seems like if there is an ext folder under the gem
folder, it has native code.
It’s described in the rubygems guide, see here:
…
Are all the native extension code located under the ext folder?
Does gem with extensions always have extconf.rb?
It’s the convention, the guide says: The files for the extension should
go in the ext/ directory in a directory matching the extension’s name.
Also, if we look at the rake gem, there is a folder called examples. It
contains some .c files.