Skip to content

Conversation

@TheBlackArroVV
Copy link

After trying to run it locally I found out, that an original error about the unavailability to run a file is not descriptive. So, I decided to add an error to make it more obvious.

@ZimbiX
Copy link
Member

ZimbiX commented Nov 23, 2024

Resolves #280 and #282.

imo the begin block should be removed so that errors from the require path or required code can be shown normally. And perhaps requiring using the full path to the given file.

@TheBlackArroVV
Copy link
Author

Hi, @ZimbiX,
Can you elaborate a bit about wdym? If you you mean just rendering a standard LoadError I think it's not gonna help with a problem I had, it would still be unclear how it should be used

@ZimbiX
Copy link
Member

ZimbiX commented Nov 26, 2024

Something like:

args.each do |file|
  require whatever_method_returns_a_full_file_path(file)
end

That way, all forms of relative file path can be accepted. Then if an exception is raised due to the given file not existing, that should be pretty easy to understand already, I'd think.

Edit: Looks like File.expand_path or File.realpath does the trick

@TheBlackArroVV
Copy link
Author

@ZimbiX, got it, makes sense
Can you check now?

@TheBlackArroVV
Copy link
Author

Hey, @ZimbiX,
Cam you take a look?

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

Successfully merging this pull request may close these issues.

2 participants