This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
7 Replies Last post: Apr 28, 2014 8:25 PM by Oleg Sukhodolsky  
Scott Miller Newbie 4 posts since
Apr 26, 2014
Currently Being Moderated

Apr 26, 2014 12:24 AM

$ global variable is unresoved reference in multi-file application

Have a ruby application with multiple files.  Have some $ global variables defined in one of the files.Reference is found in file where defined, but in all other files it is marked as unresolved reference.More of an anyonance then an issue, but is there some way to resolve this?
Oleg Sukhodolsky JetBrains 843 posts since
Apr 4, 2012
Currently Being Moderated
Apr 26, 2014 4:26 PM in response to: Scott Miller
Re: $ global variable is unresoved reference in multi-file application

Hi,

 

do you require the file which defines this vars in other files?

 

Regards, Oleg.

Oleg Sukhodolsky JetBrains 843 posts since
Apr 4, 2012
Currently Being Moderated
Apr 27, 2014 3:25 AM in response to: Scott Miller
Re: $ global variable is unresoved reference in multi-file application

Hi,

 

I'm sure your code does work I just try to understand how the variable is supposed to become available in the particular script

to understand what RubyMine is missing.

 

Regards, Oleg.

 

P.S. we can not treat globals from one script as available in another for all cases because not everyone use them this way.

Oleg Sukhodolsky JetBrains 843 posts since
Apr 4, 2012
Currently Being Moderated
Apr 27, 2014 2:42 PM in response to: Scott Miller
Re: $ global variable is unresoved reference in multi-file application

Hi,

 

you are right untill you will call projectA_unit1.rb directrly.  And RubyMine can not be sure that this is not the case

We have some assumptions for Rails apps, but not for a regular Ruby apps.

 

Oleg.

Oleg Sukhodolsky JetBrains 843 posts since
Apr 4, 2012
Currently Being Moderated
Apr 28, 2014 8:25 PM in response to: Scott Miller
Re: $ global variable is unresoved reference in multi-file application

We will think what we can do here.

 

Regards, Oleg.

More Like This

  • Retrieving data ...