Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge #7137
Browse files Browse the repository at this point in the history
7137: Gemspec require relative r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

This is a follow up to #7100. Gemspec is another place where `require_relative` sounds like a win.

### What is your fix for the problem, implemented in this PR?

My fix changes bundler's gemspec to use `require_relative`, and extracts the relevant change from #4397 to also change the generated gemspec from `bundle gem`.

Co-authored-by: Miklos Fazekas <mfazekas@szemafor.com>
Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
  • Loading branch information
3 people committed Apr 26, 2019
2 parents 6f94959 + 2478e34 commit 29d856f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bundler.gemspec
@@ -1,10 +1,10 @@
# frozen_string_literal: true

begin
require File.expand_path("../lib/bundler/version", __FILE__)
require_relative "lib/bundler/version"
rescue LoadError
# for Ruby core repository
require File.expand_path("../version", __FILE__)
require_relative "version"
end

Gem::Specification.new do |s|
Expand Down
4 changes: 1 addition & 3 deletions lib/bundler/templates/newgem/newgem.gemspec.tt
@@ -1,6 +1,4 @@
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "<%= config[:namespaced_path] %>/version"
require_relative 'lib/<%=config[:namespaced_path]%>/version'

Gem::Specification.new do |spec|
spec.name = <%= config[:name].inspect %>
Expand Down

0 comments on commit 29d856f

Please sign in to comment.