Skip to content

Instantly share code, notes, and snippets.

@takaokouji
Created September 23, 2011 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takaokouji/1236457 to your computer and use it in GitHub Desktop.
Save takaokouji/1236457 to your computer and use it in GitHub Desktop.
A patch fixes #1391 "macruby interpreter quits on 'quit' out of scope" - http://www.macruby.org/trac/ticket/1391
Changes in HEAD
Modified lib/irb/context.rb
diff --git a/lib/irb/context.rb b/lib/irb/context.rb
index 0b03d00..a7e11fc 100644
--- a/lib/irb/context.rb
+++ b/lib/irb/context.rb
@@ -124,3 +124,7 @@ module IRB
end
end
end
+
+def self.quit
+ exit
+end
Modified lib/irb/source.rb
diff --git a/lib/irb/source.rb b/lib/irb/source.rb
index 03f7104..6324d15 100644
--- a/lib/irb/source.rb
+++ b/lib/irb/source.rb
@@ -170,14 +170,6 @@ module IRB
super
end
- def on_ident(token) #:nodoc:
- if @level == 0 && TERMINATE_KEYWORDS.include?(token)
- @terminate = true
- else
- super
- end
- end
-
def on_lbrace(token) #:nodoc:
@level += 1
super
@takaokouji
Copy link
Author

This is a quick patch. I think @alloy knows better fixing. However, this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment