mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:47:22 +08:00
unbundled_require for gabbler
This commit is contained in:
parent
019d52f4ac
commit
2d0ec364db
|
@ -1,7 +1,29 @@
|
|||
# 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 'gabbler'
|
||||
begin
|
||||
unbundled_require 'gabbler'
|
||||
rescue LoadError
|
||||
puts "please run: gem install gabller"
|
||||
exit
|
||||
end
|
||||
|
||||
user_id = nil
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user