Skip to content

Instantly share code, notes, and snippets.

@ritxi
Created May 13, 2016 09:04
Show Gist options
  • Select an option

  • Save ritxi/0280a652cdafbc7c06c70b661b3f1ada to your computer and use it in GitHub Desktop.

Select an option

Save ritxi/0280a652cdafbc7c06c70b661b3f1ada to your computer and use it in GitHub Desktop.

Revisions

  1. ritxi created this gist May 13, 2016.
    4 changes: 4 additions & 0 deletions .rspec
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    --color
    --require spec_helper
    --require ~/.unbundled_require
    --format Fuubar
    19 changes: 19 additions & 0 deletions .unbundled_require.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    def unbundled_require(gem, options = {})
    if defined?(::Bundler)
    spec_path = Dir.glob("#{Gem.dir}/specifications/#{gem}-*.gemspec").last
    if spec_path.nil?
    warn "Couldn't find #{gem}"
    return
    end

    spec = Gem::Specification.load spec_path
    spec.activate
    end

    begin
    require options[:require] || gem
    yield if block_given?
    rescue Exception => err
    warn "Couldn't load #{gem}: #{err}"
    end
    end