[X] I am providing a VALID code file that confirms the bug
[X] I am NOT posting any of the USELESS THINGS listed above
[X] I am aware that this issue will be automatically closed if the code file is missing or INVALID
💬 Description
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.
Improved usability: Pagy commands will work seamlessly on all supported platforms.
Increased accessibility: Developers using Windows for Ruby development will have full access to Pagy's features without encountering platform-specific issues.
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.
This is a "Feature request", not a bug and since it is very well structured, respectful and polite, it will not get just closed, but converted into a discussion.
👀 Before submitting...
🧐 REQUIREMENTS
💬 Description
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.