Skip to content

Commit

Permalink
[Truffle] More complete logic for the verbosity level.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Nov 6, 2016
1 parent f625405 commit a092518
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
Expand Up @@ -845,8 +845,23 @@ private void initializeGlobalVariables() {

globals.put("$DEBUG", context.getInstanceConfig().isDebug());

Object value = context.warningsEnabled() ? context.isVerbose() : nilObject;
globals.put("$VERBOSE", value);
final Object verbose;

switch (context.getInstanceConfig().getVerbosity()) {
case NIL:
verbose = getNilObject();
break;
case FALSE:
verbose = false;
break;
case TRUE:
verbose = true;
break;
default:
throw new UnsupportedOperationException();
}

globals.put("$VERBOSE", verbose);

final DynamicObject defaultRecordSeparator = StringOperations.createString(context, StringOperations.encodeRope(CLI_RECORD_SEPARATOR, UTF8Encoding.INSTANCE));
node.freezeNode.executeFreeze(defaultRecordSeparator);
Expand Down

0 comments on commit a092518

Please sign in to comment.