Permalink
Browse files

Work when source_location doesn't.

I was trying to be clever by requiring the absolute path to rubygems,
but actually it's easier to just rely on the fact that rubygems will be
in the load path.
  • Loading branch information...
1 parent 1248557 commit 2513b2fba3738fc62a1f8b40f8674b8802f04cc3 @ConradIrwin committed May 12, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/pry-debundle.rb
  2. +2 −2 pry-debundle.gemspec
View
@@ -42,13 +42,13 @@ def debundle!
if defined?(Gem.post_reset_hooks)
Gem.post_reset_hooks.reject!{ |hook| hook.source_location.first =~ %r{/bundler/} }
Gem::Specification.reset
- load File.expand_path("../rubygems/custom_require.rb", Gem.method(:post_reset_hooks).source_location.first)
+ load 'rubygems/custom_require.rb'
loaded = true
# Rubygems 1.6 — TODO might be quite slow.
elsif Gem.source_index && Gem.send(:class_variable_get, :@@source_index)
Gem.source_index.refresh!
- load File.expand_path("../rubygems/custom_require.rb", Gem.method(:source_index).source_location.first)
+ load 'rubygems/custom_require.rb'
loaded = true
else
View
@@ -1,14 +1,14 @@
Gem::Specification.new do |s|
s.name = "pry-debundle"
- s.version = "0.1"
+ s.version = "0.2"
s.platform = Gem::Platform::RUBY
s.author = "Conrad Irwin"
s.email = "conrad.irwin@gmail.com"
s.license = "MIT"
s.homepage = "http://github.com/ConradIrwin/pry-debundle"
s.summary = "Allows you to use gems not in your Gemfile from Pry."
s.description = "Hooks into Pry and removes the restrictions on loading gems imposed by Bundler only when you're running in interactive mode."
- s.files = ["lib/pry-debundle.rb", "README.md", "LICENSE.MIT"]
+ s.files = `git ls-files`.split("\n")
s.require_path = "lib"
s.add_dependency 'pry'
end

0 comments on commit 2513b2f

Please sign in to comment.