summaryrefslogtreecommitdiff
path: root/lang/ruby26-base/patches/patch-lib_rubygems_commands_build__command.rb
blob: c7c24ad4f61d3f25361b1a5265a28f59e2983b5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$NetBSD: patch-lib_rubygems_commands_build__command.rb,v 1.1 2019/02/03 13:41:33 taca Exp $

* Do not chdir to gemspec file's directory.

--- lib/rubygems/commands/build_command.rb.orig	2018-12-12 05:07:50.000000000 +0000
+++ lib/rubygems/commands/build_command.rb
@@ -60,20 +60,18 @@ Gems can be saved to a specified filenam
     end
 
     if File.exist? gemspec
-      Dir.chdir(File.dirname(gemspec)) do
-        spec = Gem::Specification.load File.basename(gemspec)
+      spec = Gem::Specification.load gemspec
 
-        if spec
-          Gem::Package.build(
-            spec,
-            options[:force],
-            options[:strict],
-            options[:output]
-          )
-        else
-          alert_error "Error loading gemspec. Aborting."
-          terminate_interaction 1
-        end
+      if spec
+        Gem::Package.build(
+          spec,
+          options[:force],
+          options[:strict],
+          options[:output]
+        )
+      else
+        alert_error "Error loading gemspec. Aborting."
+        terminate_interaction 1
       end
     else
       alert_error "Gemspec file not found: #{gemspec}"