Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gems with extensions: Gem layout: confusing content #271

Open
igneus opened this issue Oct 17, 2020 · 1 comment
Open

Gems with extensions: Gem layout: confusing content #271

igneus opened this issue Oct 17, 2020 · 1 comment

Comments

@igneus
Copy link
Contributor

igneus commented Oct 17, 2020

The Gem layout section of the Gems with extensions page is quite confusing. So far I don't know enough about C extensions to improve the text myself, so I'm just opening an issue for it.

Some extensions will be partially written in C and partially written in ruby. If you are going to support multiple languages, such as C and Java extensions, you should put the C-specific ruby files under the ext/ directory as well in a lib/ directory.

What exactly does the portion highlighted by bold typeface mean? I'm also not sure if it is syntactically correct or not.

When the extension is built the files in ext/my_malloc/lib/ will be installed into the lib/ directory for you.

As a reader, I expect this paragraph, following immediately after an example directory listing, to refer to paths contained in the listing. But the listing does not include the directory ext/my_malloc/lib. I'm confused.

@deivid-rodriguez
Copy link
Member

I don't know of any example gem of what's being described there but it sounds like the intended meaning is that if your specific extension (say, a C-extension) needs specific ruby files, they should be placed inside a lib subfolder under ext, not inside the "main" lib/ folder.

Not being a native speaker, I'm not sure about the sentence, but maybe changing "directory" with "subdirectory" and adding a comma and an example, could make it better?

under the ext/ directory as well, in a lib/ subdirectory (e.g. ext/my_malloc/lib).

Regarding the listing, I guess the fix would be to add the directory to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants