Permalink
Browse files

[rant] only run stuff if executing the rant file directly

  • Loading branch information...
1 parent 94e5646 commit 978a2e758b3b678f9f336cc0ef54a7648716ce70 @geemus committed Apr 25, 2012
Showing with 9 additions and 5 deletions.
  1. +9 −5 rant.rb
View
14 rant.rb
@@ -129,10 +129,14 @@ def close
end
-rant = Rant.new
+if __FILE__ == $0
-while true
- rant.receive_message
-end
+ rant = Rant.new
+
+ while true
+ rant.receive_message
+ end
-rant.close
+ rant.close
+
+end

0 comments on commit 978a2e7

Please sign in to comment.