I am doing a demo command line project in Ruby. The structure is like this:
/ROOT_DIR
init.rb
/SCRIPT_DIR
(other scripts and files)
I want users to only go into the application using init.rb
, but as it stands, anyone can go into the sub-folder and call other ruby scripts directly.
Questions:
- What ways can above scenario be prevented?
- If I was to use directory permissions, would it get reset when running the code from a Windows machine to on Linux machine?
- Is there anything that can be included in Ruby files itself to prevent it from being directly called from OS command line?