Skip to content

Instantly share code, notes, and snippets.

View code-later's full-sized avatar

Dirk Breuer code-later

View GitHub Profile
class HouseDetail
def foo
return [1,2,3]
end
end
class KeyInvoker
instance_methods.reject {|meth| meth.to_s =~ /^_/ }.each { |meth| undef_method(meth.to_sym) }
@code-later
code-later / gist:719848
Created November 29, 2010 11:25
Load a project specific .irbrc in your Rails 3 project
# Add this method the MyApp::Application class (in config/application.rb)
def load_console(sandbox=false)
super
project_specific_irbrc = File.join(Rails.root, ".irbrc")
puts "Loading project specific .irbrc ..."
load(project_specific_irbrc) if File.exists?(project_specific_irbrc)
end
#!/usr/bin/env ruby
require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes.rb"
require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb"
result = TextMate::UI.request_string(
:title => 'Open Rubygem',
:prompt => 'Name of the gem to open',
:default => ENV['TM_CURRENT_WORD'] || "",
:button1 => 'Open'