Skip to content

Instantly share code, notes, and snippets.

C:\dev\digitalarchive_trunk>ir go.rb
irb(main):001:0> 33
=> 33
irb(main):002:0> exit
C:\dev\digitalarchive_trunk>cat go.rb
require 'irb'
module IRB # :nodoc:
def self.start_session(binding)
@rdp
rdp / gist:577354
Created September 13, 2010 14:22
C:\dev\ruby\downloads\rubygems>ruby setup.rb
C:/dev/ruby/downloads/rubygems/lib/rubygems/source_index.rb:68:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
from C:/dev/ruby/downloads/rubygems/lib/rubygems/source_index.rb:58:in `from_installed_gems'
from C:/dev/ruby/downloads/rubygems/lib/rubygems.rb:887:in `source_index'
from C:/dev/ruby/downloads/rubygems/lib/rubygems/gem_path_searcher.rb:81:in `init_gemspecs'
from C:/dev/ruby/downloads/rubygems/lib/rubygems/gem_path_searcher.rb:13:in `initialize'
from C:/dev/ruby/downloads/rubygems/lib/rubygems.rb:845:in `new'
from C:/dev/ruby/downloads/rubygems/lib/rubygems.rb:845:in `block in searcher'
from <internal:prelude>:10:in `synchronize'
from C:/dev/ruby/downloads/rubygems/lib/rubygems.rb:844:in `searcher'
C:\dev\digitalarchive_trunk>gem env
D:/installs/ruby-1.9.2-p0-i386-mingw32/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:68:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
from D:/installs/ruby-1.9.2-p0-i386-mingw32/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:58:in `from_installed_gems'
from D:/installs/ruby-1.9.2-p0-i386-mingw32/lib/ruby/site_ruby/1.9.1/rubygems.rb:887:in `source_index'
from D:/installs/ruby-1.9.2-p0-i386-mingw32/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:81:in `init_gemspecs'
from D:/installs/ruby-1.9.2-p0-i386-mingw32/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:13:in `initialize'
from D:/installs/ruby-1.9.2-p0-i386-mingw32/lib/ruby/site_ruby/1.9.1/rubygems.rb:845:in `new'
from D:/installs/ruby-1.9.2-p0-i386-mingw32/lib/ruby/site_ruby/1.9.1/rubygems.rb:845:in `block in searcher'
from <internal:prelude>:10:in `synchronize'
from D:/installs/ruby-1.9.2-p0-i38
@rdp
rdp / gist:624959
Created October 13, 2010 21:35
rake test:units failures on 1.9.2 mingw
1) Failure:
test_basic_payment_service(ActionViewHelperTest) [test/unit/integrations/action_view_helper_test.rb:36]:
Failed to match <input id="order" name="order" type="hidden" value="order-1" />.
Expected /<input id="account" name="account" type="hidden" value="test" \/>/ to match "<input id=\"order\" name=\"order\" type=\"hidden\" value=\"order-1\" />".
2) Failure:
test_initialize_does_not_raise_an_error(BraintreeBlueTest) [test/unit/gateways/braintree_blue_test.rb:5]:
Exception raised:
<#<RuntimeError: Could not load the braintree gem. Use `gem install braintree` to install it.>>.
@rdp
rdp / gist:701274
Created November 16, 2010 01:13
this is VLC attempting to stream to a file from a DVD using its default "transcoding" setting modified to have no video. I think this meant I was using the wrong muxer...and needed ps for DVD's
main debug: processing request item Streaming node Playlist skip 0
main debug: resyncing on Streaming
main debug: Streaming is at 0
main debug: starting new item
main debug: creating new input thread
main debug: Creating an input for 'Streaming'
main debug: thread started
main debug: reusing sout
main debug: you probably want to use gather stream_out
main debug: using timeshift granularity of 50 MiB
Exception in thread "AWT-EventQueue-0" sun/java2d/d3d/D3DRenderer.java:29:in `validateContext': java.lang.NullPointerException: null (NativeException)
from sun/java2d/pipe/BufferedRenderPipe.java:109:in `fillRect'
from sun/java2d/pipe/ValidatePipe.java:58:in `fillRect'
from sun/java2d/SunGraphics2D.java:2265:in `fillRect'
from sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
from sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'
from sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'
Exception in thread "AWT-EventQueue-0" from java/lang/reflect/Method.java:597:in `invoke'
from org/jruby/javasupport/JavaMethod.java:491:in `invokeDirectWithExceptionHandling'
from :1:in `paintComponent'
@rdp
rdp / easy_way.rb
Created November 18, 2010 22:44
example code of how to do an "on_click" method for a JButton
require 'java'
include_class 'javax.swing.JButton'
include_class 'javax.swing.JFrame'
include_class 'javax.swing.JLabel'
include_class 'java.awt.event.ActionListener'
class ClickAction
include ActionListener
@rdp
rdp / backtrace
Created November 19, 2010 00:06
code to reproduce
C:\dev\ruby\sensible-cinema\bin>..\..\downloads\jruby\bin\jruby.exe crash1.rb
RubyToJavaInvoker.java:221:in `findCallableArityOne': java.lang.ArrayIndexOutOfBoundsException: 1
from InstanceMethodInvoker.java:56:in `call'
from AliasMethod.java:61:in `call'
from CachingCallSite.java:313:in `cacheAndCall'
from CachingCallSite.java:152:in `call'
from crash1.rb:23:in `method__3$RUBY$initialize'
from crash1Invokermethod__3$RUBY$initializeFixed0#initialize:65535:in `call'
from CachingCallSite.java:303:in `cacheAndCall'
from CachingCallSite.java:121:in `callBlock'
@rdp
rdp / backtrace
Created November 19, 2010 13:06
another initializer crash
C:\dev\ruby\sensible-cinema\bin>c:\dev\ruby\downloads\jruby\bin\jruby.exe -v crash7.rb
jruby 1.6.0.dev (ruby 1.8.7 patchlevel 249) (2010-11-18 2e438b1) (Java HotSpot(TM) Client VM 1.6.0_18) [Windows 7-x86-java]
Java.java:726:in `call': java.lang.NullPointerException
from JavaMethod.java:630:in `call'
from CachingCallSite.java:323:in `cacheAndCall'
from CachingCallSite.java:161:in `callBlock'
from CachingCallSite.java:166:in `call'
from ConcreteJavaProxy.java:43:in `call'
from SuperCallSite.java:336:in `cacheAndCall'
from SuperCallSite.java:162:in `callBlock'
@rdp
rdp / nested.rb
Created November 19, 2010 14:05
Error when doing an eval
#!/usr/bin/ruby
puts 'Welcome to Sensible Cinema...'
require 'java'
module SensibleSwing
include_package 'javax.swing'
[JButton, JFrame, JLabel, JPanel, JOptionPane,
JFileChooser, JComboBox, JDialog] # grab these constants (http://jira.codehaus.org/browse/JRUBY-5107)
include_package 'java.awt'
[FlowLayout, Font]