-
Notifications
You must be signed in to change notification settings - Fork 109
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
require_relative
of "salt" in asciidoctor-diagram.rb
#434
Comments
The location of those files is part of the public API of the gem. Moving them around would be a backwards incompatible change. Maybe one day in a 3.0 release. |
From a bystander perspective, it seems like moving this require would be pretty safe since it is specific to a diagram type. One idea would be to change it, see if anyone reports it as a problem, and be ready to revert it if so. Just an idea. |
The documentation states you can either require The alternative solution is that the split script that's being developed deals with this special case. There's another special case with structurizr which uses code from other extensions to do the actual rendering. |
Disregard my comment. I looked at the main script and now I see what you mean. From the report, I thought that it was requiring something globally it wasn't using. That's not the case. It is requiring every diagram extension as it should. You are right that if you want individual a la carte extensions, then you need to require them one-by-one. |
Yes, that's how I currently have it. The according bug and the patch/script can be seen here.
I do not understand which file you are referring to. I did not mean to suggest that any file be moved. Only that the line
is moved from the top-level |
@mojavelinux the main issue I have with this request and the discussion in #376 is that I'm not sure what this would actually solve. All of the extensions can be required even if the tools they depend on are not present on the system. It's only when a document actually uses a block type that you will get an error stating that some tool is missing. It's perfectly feasible to split the gem into one per diagram type, but that means I now have to release a cluster of extensions instead of just one. The overhead of managing all those release numbers is what I want to avoid because the benefit seems rather limited. |
@pepijnve for the record, I don't mean to exaggerate the problem and I accepted your decision in #376. All I'm trying to achieve right now is a bit of clean-up for those who care about not having unnecessary files installed. Most people probably don't care about it, but if I can strike a balance between a sufficiently clean/low-effort downstream patch which improves the situation and effectiveness, it would be a nice-to-have. I just suspected said line is accidentally misplaced in the top-level file and, if moved into the right place, would also help me with the patch. That's all. Feel free to close if you don't see any merit. The additional PS: Unrelated to this issue, but w.r.t. #376, if there were something like "compile time" configuration, then it would make a natural solution for either installing or not-installing different document-types, without releasing them all separately. My downstream patch is pretty much that: A poor-man's ./configure to enable/disable different features. |
That's a reasonable design/assumption from my perspective. I would continue to focus on allowing the path to the tools be controlled using variables (AsciiDoc attributes or environment variables). If the tool cannot be found, logging a warning (or error) is the right way to communicate the requirement IMO.
I would not like that either, and I doubt users would. It's just unnecessary abstraction. It's better to be pluggable than to be modular. |
If the salt diagram type ends up requiring the plantuml diagram type (which it appear to), then I suppose it could be moved around so that requiring the plantuml diagram type also requires the salt diagram type. However, if there's a need to require plantuml without requiring salt, then you have just introduced the opposite problem. |
I'm going to close this issue since the assumption was that this was accidental, while it is not. The convention is that requiring |
I'm trying to patch asciidoctor-diagram to only install the diagram types which are requested through and supported by the package manager on Gentoo. What I did so far is delete the according directory and
.rb
file in/lib/asciidoctor-diagram
, the spec-file, and therequire_relative
inasciidoctor-diagram.rb
.What doesn't play well with that logic is the mention of "salt" in the requires, because it isn't a diagram-type per se and only a requirement of PlantUML, but treated like a (unconditional) dependency of asciidoctor-diagram.
Could the
require
of "salt" be moved from the top level of asciidoctor-diagram into the PlantUML specific files?The text was updated successfully, but these errors were encountered: