Skip to content

Instantly share code, notes, and snippets.

@amiracam
Created July 31, 2013 21:27
Show Gist options
  • Save amiracam/6126346 to your computer and use it in GitHub Desktop.
Save amiracam/6126346 to your computer and use it in GitHub Desktop.
Jrubyfx apparently causes issues with ruby-debug-ids
Note: code below was used to check out 2.0 named argument support in jruby including JetBrains debug support for jruby in 2.0 mode. If the second require is commented out the code will run without issue
code:
______________________________________________________________________________________
require 'java'
require 'jrubyfx'
#require 'rest-client'
class Hash
def at key, value_if_absent: nil
((v = self[key]).nil?) ? (self[key] = value_if_absent) : v
end
end
h = {rob: 'php_dude'}
puts "rob is: #{h[:rob]}"
puts "robert is: #{h[:robert]}"
puts "now robert is still: #{h.at :robert}"
puts "but rob is still: #{h.at :rob}"
puts "now robert is: #{h.at :robert ,value_if_absent: 'maybe a Ruby dude someday'}"
puts h
______________________________________________________________________________________
Output:
Fast Debugger (ruby-debug-ide 0.4.18, ruby-debug-base 0.10.5.rc5) listens on 127.0.0.1:49294
rob is: php_dude
robert is:
now robert is still:
but rob is still: php_dude
now robert is: maybe a Ruby dude someday
{:rob=>"php_dude", :robert=>"maybe a Ruby dude someday"}
921: Exception in DebugThread loop: Bad file descriptor - Bad file descriptor
Backtrace:
org/jruby/RubyIO.java:2025:in `close'
from: /Users/charles/.rvm/gems/jruby-1.7.4/gems/ruby-debug-ide-0.4.18/lib/ruby-debug-ide/interface.rb:44:in `close'
from: /Users/charles/.rvm/gems/jruby-1.7.4/gems/ruby-debug-ide-0.4.18/lib/ruby-debug-ide/ide_processor.rb:102:in `process_commands'
from: /Users/charles/.rvm/gems/jruby-1.7.4/gems/ruby-debug-ide-0.4.18/lib/ruby-debug-ide.rb:122:in `start_control'
from: org/jruby/RubyProc.java:274:in `call'
from: org/jruby/RubyProc.java:215:in `call'
Process finished with exit code 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment