Skip to content

Commit 57ba633

Browse files
committed
Update bundler binstubs
1 parent b59eb3d commit 57ba633

File tree

7 files changed

+42
-35
lines changed

7 files changed

+42
-35
lines changed

bin/_guard-core

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
require "pathname"
12-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13-
Pathname.new(__FILE__).realpath)
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
1412

15-
bundle_binstub = File.expand_path("../bundle", __FILE__)
13+
bundle_binstub = File.expand_path("bundle", __dir__)
1614

1715
if File.file?(bundle_binstub)
18-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
1917
load(bundle_binstub)
2018
else
2119
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.

bin/appraisal

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
require "pathname"
12-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13-
Pathname.new(__FILE__).realpath)
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
1412

15-
bundle_binstub = File.expand_path("../bundle", __FILE__)
13+
bundle_binstub = File.expand_path("bundle", __dir__)
1614

1715
if File.file?(bundle_binstub)
18-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
1917
load(bundle_binstub)
2018
else
2119
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.

bin/guard

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
require "pathname"
12-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13-
Pathname.new(__FILE__).realpath)
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
1412

15-
bundle_binstub = File.expand_path("../bundle", __FILE__)
13+
bundle_binstub = File.expand_path("bundle", __dir__)
1614

1715
if File.file?(bundle_binstub)
18-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
1917
load(bundle_binstub)
2018
else
2119
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.

bin/rails

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
#!/usr/bin/env ruby
2-
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
2+
# frozen_string_literal: true
33

4-
ENGINE_ROOT = File.expand_path('../..', __FILE__)
5-
ENGINE_PATH = File.expand_path('../../lib/smart_listing/engine', __FILE__)
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'rails' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
610

7-
require 'rails/all'
8-
require 'rails/engine/commands'
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12+
13+
bundle_binstub = File.expand_path("bundle", __dir__)
14+
15+
if File.file?(bundle_binstub)
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
17+
load(bundle_binstub)
18+
else
19+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
20+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
21+
end
22+
end
23+
24+
require "rubygems"
25+
require "bundler/setup"
26+
27+
load Gem.bin_path("railties", "rails")

bin/rake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
require "pathname"
12-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13-
Pathname.new(__FILE__).realpath)
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
1412

15-
bundle_binstub = File.expand_path("../bundle", __FILE__)
13+
bundle_binstub = File.expand_path("bundle", __dir__)
1614

1715
if File.file?(bundle_binstub)
18-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
1917
load(bundle_binstub)
2018
else
2119
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.

bin/rspec

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
require "pathname"
12-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13-
Pathname.new(__FILE__).realpath)
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
1412

15-
bundle_binstub = File.expand_path("../bundle", __FILE__)
13+
bundle_binstub = File.expand_path("bundle", __dir__)
1614

1715
if File.file?(bundle_binstub)
18-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
1917
load(bundle_binstub)
2018
else
2119
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.

bin/rubocop

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
require "pathname"
12-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13-
Pathname.new(__FILE__).realpath)
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
1412

15-
bundle_binstub = File.expand_path("../bundle", __FILE__)
13+
bundle_binstub = File.expand_path("bundle", __dir__)
1614

1715
if File.file?(bundle_binstub)
18-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
16+
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
1917
load(bundle_binstub)
2018
else
2119
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.

0 commit comments

Comments
 (0)