-
Notifications
You must be signed in to change notification settings - Fork 32
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
Update controller.rb #77
Conversation
fixed to produce a valid path for a file in a jar root
What about "" (empty string)? Also we might want "/" to work also, do you have any opinions @enebo ? |
I tried that before. File.join("","file.txt") => "/file.txt" so no good. |
I'm sorry what I missed something what is this accomplishing ? Is this about not being able to load the fxml file ? |
yes, when running from a jar, for a .fxml file living in the jar root, defined by the second argument of fxml_root in mair script with ("fxml_root filesystem/path", ".") |
@jjgh any commits you push to the branch your PR was on will automatically be added to the PR. |
ok, I see, in my case I used : fxml_root File.dirname(FILE), 'src/lib' the way I packed things up my code is under /src at root of jar, the only thing right on root is JarMain.class which would be part of warbler's packaging src/bin I suppose it provides for more flexibility to be able to grab fxml file from root, but I generally would not want to pack that way and its certainly not the defaults warbler likes |
ah, no, I was saying should we check for "" and "/" and if so don't append either? |
if you are asking to me, yea that is what I tried to say when you first asked :) |
Sure , I'm also suggesting it due to warbler
|
HEH, "/". The pedantic side of me realizes that is someone wants their fxml in / of their machine it will stop working if they are trying to load from a jar file :) I would say the check should be a reasonably named method or there should be a simple comment explaining the rationale. I guess I don't care one way or the other on "/". |
Actually, when I think about it, "" should do this, but "." and "/" should (eventually) do file paths. |
Yeah I guess that was the gist of my pedantry... |
@jjgh mind making "" do jars and "." and "/" do files? (I can fix it myself if you don't mind, though I might not be able to do it given the immense scale of your patch 😉 ) |
Did I get it right?
Did I get any close to what you asked? :)
Thanks for merging it, it was my first commit into a big open source project! Great :) |
fixed to return a valid path for a file in the root of a jar