code completion relative to the root folder on Rubymine

Let's guess i have this structure

etc/my_file.rb

etc/my_file2.rb

test_cases/rest/my_testcase.rb

 

The root folder for the project is / and all runs are done from there so in run configuration, working directory i have: $MODULE_DIR$

The problem is when i try to require a file for example on my_test_case.rb: require './etc/my_file'

The auto completion gives me: require '../../etc/my_file'

Is it possible that Rubymine gives me in autocompletion './etc/my_file'?

Thanks

 

0
6 comments

Hello,

could you please specify why you think that this will be the correct completion. In addition, does your code work in case you do 'require' in this manner?

0
Avatar
Permanently deleted user

The absolute relative to root manner ./etc/my_file works perfectly. Our environment automatically run from the root folder of the project the tests and analize the code previously so we need it to be written like that, it is not a matter of which one is correct completion... I am just asking if it is possible to change the autocompletion.

0
Avatar
Permanently deleted user

For ecample if you move a file from one folder to another and you are using

require './etc/my_file'

then you don't need to change anything on the file

 

If you are using require '../../etc/my_file' then you need to change it to the new relative

0

Would it be possible to provide a working project sample with this structure and relative path in the script?

0

Hello,

thank you for the sample provided. In order to make it work you need to change the working directory for the corresponding Run configuration (setting it to the project root's path).

0

Please sign in to leave a comment.