Making Commands Platform Independent #703
SaidRasinlic
started this conversation in
Feature Requests
Replies: 1 comment
-
Anything that actually runs on windoze strikes me as a surprise: its errors don't! 🤣 Last time I checked, windoze claimed to have solved its incompatibility with everything (including itself) with WSL. Who would develop on windoze without it? 🧐 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Pagy Team,
I hope this message finds you well. I'm writing to bring to your attention an issue I encountered while using the Pagy gem on Windows operating systems. Currently, some Pagy commands are not platform-independent, leading to errors when attempting to run them on Windows.
Issue:
When attempting to run Pagy commands on Windows, such as pagy demo, I encountered the following error:
/Ruby32-x64/lib/ruby/gems/3.2.0/gems/pagy-8.4.0/lib -r pagy -o 0.0.0.0 -p 8000 -E showcase C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/pagy-8.4.0/apps/demo.ru -q (Errno::ENOENT) from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/pagy-8.4.0/bin/pagy:96:in <top (required)>'
Explanation:
The issue arises from the use of the exec method with inline environment variable assignment, which is not compatible with Windows Command Prompt or PowerShell.
Proposal:
I suggest making the Pagy commands platform-independent by using Ruby's built-in environment variable handling (ENV) and the system method. This approach will ensure consistent behavior across different platforms, including Windows.
Example:
Instead of:
at C:\Ruby32-x64\lib\ruby\gems\3.2.0\gems\pagy-8.4.0\bin\pagy on line :96
Use:
Benefits:
Thank you for considering my request. I believe that making Pagy commands platform-independent will enhance its value and accessibility to a wider audience of developers.
Best Regards,
Said R.
Beta Was this translation helpful? Give feedback.
All reactions