-
Notifications
You must be signed in to change notification settings - Fork 15
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
Stream IOs #18
Stream IOs #18
Conversation
Don't wait for jq to finish
Adds -V --version cli command
Add ability to change default array element name Add oq and jq version to help message
@asterite would you mind giving this a review if you get a minute? |
@Blacksmoke16 Sure! I'll do it later today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just added one suggestion.
Eventually if I have time I can try to see if I can write code to handle YAML aliases and anchors. Sounds like something fun and challenging that I would enjoy, but it all depends on whether I'll have time to do it.
|
||
private def self.parse_args(args : NamedTuple) : Tuple(String, Bool, String, String) | ||
{ | ||
args["indent"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wow, I didn't remember you could access a named tuple with a string, I though only symbol was valid.
@@ -0,0 +1,88 @@ | |||
module OQ::Converters::Xml | |||
@@at_root : Bool = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a smell, it means you can't call methods of this module concurrently. Is there a way to pass this at_root
value to all methods that need it so it's not shared at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I could probably just pass it between the methods versus making it a class var.
EDIT: Or maybe it would be worth making these structs and using an initializer. Which could also be useful for setting ivars for the arg values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I edited my comment and some part was gone. I forgot to say that this is probably a minor issue because this is a one-shot app meaning that you won't be running this concurrently, but it's still a good design pattern to avoid sharing stuff.
I thought about making it a class/struct but you'd still have the same problem that if someone uses that instance concurrently then the @at_root
instance var would cause conflicts. I think there's no other way around passing it between methods. And instead of passing a lot of args you can consider creating a class holding these shared things and passing that instead.
But again, this is probably not needed for this kind of app 😊
Description
Resolves #14
Resolves #15
Resolves #17
Resolves #19
oq
to more easily support additional formats..deserialize
forXml
converter will follow later.oq
much much more memory efficient as nothing is loaded into memory.Big shoutout to @asterite for the gist that made this PR possible.
TODO
#text
keys againjq
features still work