-
Notifications
You must be signed in to change notification settings - Fork 154
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
[meme] Split data.rb into multiple files per class #482
Conversation
+4k -4k memes aside... If we're moving all these into This is going to need to be integration test spec'd and a lot of require checkings done. Also, I would request this move into a 4.0 branch, not master, so this can be done longer term. As for what was left in As for the groups you proposed, I would prefer seeing them go in their own files. A file for each class. This is a very common project structure and I think discordrb can really benefit from something like this. |
No, I don't want such a large breaking change just because of the code scaffolding. While I know namespace-by-path is a practice, I don't think it makes sense for us. I want this merged "quickly" to improve developer QOL above all. On that note;
I don't see any reason why this can't be I have no problem with master being unstable, it should be expected. People relying on master should be watching the repo and/or pinning to commits. And again, I don't want to hold back doing this just because of infrastructure things that don't affect the end user (specs/integration). Let's "move fast and break things"
Eh, I don't see why modules should get special treatment. They should be in Anyway, Everything else (helper methods/constants) that remains moving to
I thought about this, but like all of these objects are just straight JSON-mapped objects. They have tiny/zero behavior footprint and will always be considered with the rest of their counterpart classes. |
Also a thought I just had If we don't like
I would be perfectly okay with
class Embed
class Author
end
class Footer
end
end We do this in other places, and this is very unlikely to be a breaking change that affects anyone as these are read-only classes that referencing them directly doesn't have many use cases. |
Some updates on this in prep for the next release 🎉
(I realized we already had a precedent for mixins: Now I think I'd like to leave |
Move utility methods to discordrb.rb Move IDObject to id_object.rb Move PermissionsCalculator to permissions.rb Move ColourRGB to colour_rgb.rb
Follow up to #482. I created new files accordingly but looks like I forgot to remove the relevant specs from `data_spec.rb`.
WIP
Not much to say here, but this isn't done quite yet.
In data.rb, there are several utility classes / mixins I decided to leave behind. These are more "helpers" than "data objects". So we have a few choices: leave them there, split them into files under lib/discordrb/, or move them into lib/discordrb.rb together. I would prefer the last I think. Once we decide, I will move the requires into more proper places.
I also elected to keep some classes and modules logically together. (Embed* objects, etc)
TODO:
Closes #390