unbundled_require for gabbler

This commit is contained in:
Sam 2013-08-05 14:26:11 +10:00
parent 019d52f4ac
commit 2d0ec364db
1 changed files with 23 additions and 1 deletions

View File

@ -1,7 +1,29 @@
# can be used to generate a mock db for profiling purposes # can be used to generate a mock db for profiling purposes
# Include this in your .irbrc
def unbundled_require(gem)
if defined?(::Bundler)
spec_path = Dir.glob("#{Gem.dir}/specifications/#{gem}-*.gemspec").last
if spec_path.nil?
raise LoadError
end
spec = Gem::Specification.load spec_path
spec.activate
end
begin
require gem
end
end
require 'optparse' require 'optparse'
require 'gabbler' begin
unbundled_require 'gabbler'
rescue LoadError
puts "please run: gem install gabller"
exit
end
user_id = nil user_id = nil