Skip to content

Commit

Permalink
Merge pull request #18 from sadasant/master
Browse files Browse the repository at this point in the history
More control over the print_level
  • Loading branch information
xxuejie committed Oct 29, 2015
2 parents d09c7f5 + 80e0e2e commit 9f6952c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/gen_post.rb
Expand Up @@ -38,7 +38,10 @@ def convert_to_valid_loading_mode str
opts = opts || {};
// Default print level is errors only
this.print_level = opts.print_level || 1;
this.print_level = 1;
if (typeof opts.print_level === "number" && opts.print_level >= 0) {
this.print_level = opts.print_level;
}
this.mrb = _mrb_open();
_webruby_internal_setup(this.mrb);
};
Expand All @@ -49,6 +52,9 @@ def convert_to_valid_loading_mode str
WEBRUBY.prototype.run = function() {
_webruby_internal_run(this.mrb, this.print_level);
};
WEBRUBY.prototype.set_print_level = function(level) {
if (level >= 0) this.print_level = level;
};
__EOF__

if mode > 0
Expand Down

0 comments on commit 9f6952c

Please sign in to comment.