-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Jruby built-in global variables #466
Comments
As a workaround for rubocop noobs (like me), you can bracket the reference as so to get by: # rubocop : disable AvoidGlobalVars
$CLASSPATH << File.expand_path('../../classes', __FILE__)
# rubocop : enable AvoidGlobalVars |
Is there a list of the JRuby specific global vars somewhere? |
Yea, I couldn't find one either. The only one I'm using is How about it, @headius? |
Hmm...I don't know if we have compiled a list, but there's not many. A quick scan of all "$..." strings in JRuby gave me this list: $CLASSPATH = mutable JRuby-local classpath array When using BSF to script Java: $bsf And when ant support is loaded: $project We also define all the aliases in English.rb immediately at startup ($LOADED_FEATURES, etc). |
Thanks, @headius! I hope someday MRI will follow your lead and also define the aliases by default. |
Looks awesome, thanks! This might be a typo though. |
The white list of global variables accepted by the global variable cop should either be configurable or include standard globals from jruby:
The text was updated successfully, but these errors were encountered: