mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
unbundled_require for gabbler
This commit is contained in:
parent
019d52f4ac
commit
2d0ec364db
1 changed files with 23 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue