Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't auto-initialize Rubygame if ENV["RUBYGAME_NOINIT"] is "1".
If ENV["RUBYGAME_NOINIT"] is "1", "true", or "yes" (case insensitive),
Rubygame will not automatically call Rubygame.init or Rubygame.quit.
  • Loading branch information
jacius committed Mar 31, 2010
1 parent 73e26b9 commit 304eead
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/rubygame.rb
Expand Up @@ -89,5 +89,9 @@
require File.join( this_dir, "rubygame", "screen" )


Rubygame.init
at_exit { Rubygame.quit }
# Handle initialization automatically unless the RUBYGAME_NOINIT
# environmental variable is set to something truthy.
unless /^(1|t|true|y|yes)$/i =~ ENV["RUBYGAME_NOINIT"]
Rubygame.init
at_exit { Rubygame.quit }
end

0 comments on commit 304eead

Please sign in to comment.