Skip to content

Commit 4304697

Browse files
Merge pull request #7572 from rubygems/release/bundler_2.5.9_rubygems_3.5.9
Prepare RubyGems 3.5.9 and Bundler 2.5.9
2 parents cf66a73 + b367481 commit 4304697

File tree

15 files changed

+73
-18
lines changed

15 files changed

+73
-18
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 3.5.9 / 2024-04-12
2+
3+
## Enhancements:
4+
5+
* Installs bundler 2.5.9 as a default gem.
6+
17
# 3.5.8 / 2024-04-11
28

39
## Security:

bundler/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 2.5.9 (April 12, 2024)
2+
3+
## Bug fixes:
4+
5+
- Fix installing plugins via relative paths [#7571](https://github.com/rubygems/rubygems/pull/7571)
6+
17
# 2.5.8 (April 11, 2024)
28

39
## Enhancements:

bundler/lib/bundler/plugin/installer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def install_git(names, version, options)
7777

7878
def install_path(names, version, path)
7979
source_list = SourceList.new
80-
source = source_list.add_path_source({ "path" => path })
80+
source = source_list.add_path_source({ "path" => path, "root_path" => SharedHelpers.pwd })
8181

8282
install_all_sources(names, version, source_list, source)
8383
end

bundler/lib/bundler/plugin/installer/path.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Plugin
55
class Installer
66
class Path < Bundler::Source::Path
77
def root
8-
Plugin.root
8+
SharedHelpers.in_bundle? ? Bundler.root : Plugin.root
99
end
1010

1111
def generate_bin(spec, disable_extensions = false)

bundler/lib/bundler/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: false
22

33
module Bundler
4-
VERSION = "2.5.8".freeze
4+
VERSION = "2.5.9".freeze
55

66
def self.bundler_major_version
77
@bundler_major_version ||= VERSION.split(".").first.to_i

bundler/spec/plugins/install_spec.rb

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,42 @@ def exec(command, args)
212212
end
213213
end
214214

215-
it "installs from a path source" do
216-
build_lib "path_plugin" do |s|
217-
s.write "plugins.rb"
215+
context "path plugins" do
216+
it "installs from a path source" do
217+
build_lib "path_plugin" do |s|
218+
s.write "plugins.rb"
219+
end
220+
bundle "plugin install path_plugin --path #{lib_path("path_plugin-1.0")}"
221+
222+
expect(out).to include("Installed plugin path_plugin")
223+
plugin_should_be_installed("path_plugin")
224+
end
225+
226+
it "installs from a relative path source" do
227+
build_lib "path_plugin" do |s|
228+
s.write "plugins.rb"
229+
end
230+
path = lib_path("path_plugin-1.0").relative_path_from(bundled_app)
231+
bundle "plugin install path_plugin --path #{path}"
232+
233+
expect(out).to include("Installed plugin path_plugin")
234+
plugin_should_be_installed("path_plugin")
218235
end
219-
bundle "plugin install path_plugin --path #{lib_path("path_plugin-1.0")}"
220236

221-
expect(out).to include("Installed plugin path_plugin")
222-
plugin_should_be_installed("path_plugin")
237+
it "installs from a relative path source when inside an app" do
238+
allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile)
239+
gemfile ""
240+
241+
build_lib "ga-plugin" do |s|
242+
s.write "plugins.rb"
243+
end
244+
245+
path = lib_path("ga-plugin-1.0").relative_path_from(bundled_app)
246+
bundle "plugin install ga-plugin --path #{path}"
247+
248+
plugin_should_be_installed("ga-plugin")
249+
expect(local_plugin_gem("foo-1.0")).not_to be_directory
250+
end
223251
end
224252

225253
context "Gemfile eval" do
@@ -291,6 +319,21 @@ def exec(command, args)
291319
plugin_should_be_installed("ga-plugin")
292320
end
293321

322+
it "accepts relative path sources" do
323+
build_lib "ga-plugin" do |s|
324+
s.write "plugins.rb"
325+
end
326+
327+
path = lib_path("ga-plugin-1.0").relative_path_from(bundled_app)
328+
install_gemfile <<-G
329+
source "#{file_uri_for(gem_repo1)}"
330+
plugin 'ga-plugin', :path => "#{path}"
331+
G
332+
333+
expect(out).to include("Installed plugin ga-plugin")
334+
plugin_should_be_installed("ga-plugin")
335+
end
336+
294337
context "in deployment mode" do
295338
it "installs plugins" do
296339
install_gemfile <<-G

lib/rubygems.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
require "rbconfig"
1010

1111
module Gem
12-
VERSION = "3.5.8"
12+
VERSION = "3.5.9"
1313
end
1414

1515
# Must be first since it unloads the prelude from 1.9.2

rubygems-update.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gem::Specification.new do |s|
44
s.name = "rubygems-update"
5-
s.version = "3.5.8"
5+
s.version = "3.5.9"
66
s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
77
88

tool/bundler/dev_gems.rb.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ CHECKSUMS
116116
webrick (1.8.1) sha256=19411ec6912911fd3df13559110127ea2badd0c035f7762873f58afc803e158f
117117

118118
BUNDLED WITH
119-
2.5.8
119+
2.5.9

tool/bundler/lint_gems.rb.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ CHECKSUMS
6565
unicode-display_width (2.5.0) sha256=7e7681dcade1add70cb9fda20dd77f300b8587c81ebbd165d14fd93144ff0ab4
6666

6767
BUNDLED WITH
68-
2.5.8
68+
2.5.9

0 commit comments

Comments
 (0)