-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove --gemfile option in favor of BUNDLER_GEMFILE env variable
- Loading branch information
Showing
7 changed files
with
75 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# | ||
# This file was generated by Bundler. | ||
# | ||
# The application 'tapioca' is installed as part of a gem, and | ||
# this file is here to facilitate running it. | ||
# | ||
|
||
require "pathname" | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
bundle_binstub = File.expand_path("../bundle", __FILE__) | ||
|
||
if File.file?(bundle_binstub) | ||
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ | ||
load(bundle_binstub) | ||
else | ||
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. | ||
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") | ||
end | ||
end | ||
|
||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
load(Gem.bin_path("tapioca", "tapioca")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
def run(command, args = [], flags = {}) | ||
flags = { | ||
outdir: outdir, | ||
gemfile: (repo_path / "Gemfile").to_s, | ||
}.merge(flags).flat_map { |k, v| ["--#{k}", v] } | ||
|
||
@exec_command = [ | ||
|
@@ -23,8 +22,11 @@ def run(command, args = [], flags = {}) | |
] | ||
|
||
IO.popen( | ||
{ | ||
"BUNDLE_GEMFILE" => (repo_path / "Gemfile").to_s, | ||
}, | ||
@exec_command, | ||
chdir: Pathname.new(__dir__) / ".." / ".." / "exe" | ||
chdir: repo_path / "bin" | ||
).read | ||
end | ||
|
||
|
@@ -127,7 +129,9 @@ class Foo::Secret | |
Processing 'foo' gem: | ||
Compiling foo, this may take a few seconds... | ||
Compiled #{outdir}/[email protected] | ||
OUTPUT | ||
|
||
expect(output).to(include(<<~OUTPUT)) | ||
Processing 'bar' gem: | ||
Compiling bar, this may take a few seconds... | ||
Compiled #{outdir}/[email protected] | ||
|
@@ -149,11 +153,15 @@ class Foo::Secret | |
Processing 'bar' gem: | ||
Compiling bar, this may take a few seconds... | ||
Compiled #{outdir}/[email protected] | ||
OUTPUT | ||
|
||
expect(output).to(include(<<~OUTPUT)) | ||
Processing 'baz' gem: | ||
Compiling baz, this may take a few seconds... | ||
Compiled #{outdir}/[email protected] | ||
OUTPUT | ||
|
||
expect(output).to(include(<<~OUTPUT)) | ||
Processing 'foo' gem: | ||
Compiling foo, this may take a few seconds... | ||
Compiled #{outdir}/[email protected] | ||
|
@@ -171,13 +179,7 @@ class Foo::Secret | |
|
||
describe("#bundle") do | ||
it 'must perform no operations if everything is up-to-date' do | ||
%w{ | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
}.each do |rbi| | ||
FileUtils.touch("#{outdir}/#{rbi}") | ||
end | ||
run("generate") | ||
|
||
output = run("bundle") | ||
|
||
|
@@ -199,18 +201,11 @@ class Foo::Secret | |
expect(File).to(exist("#{outdir}/[email protected]")) | ||
expect(File).to(exist("#{outdir}/[email protected]")) | ||
expect(File).to(exist("#{outdir}/[email protected]")) | ||
expect(File).to_not(exist("#{outdir}/[email protected]")) | ||
end | ||
|
||
it 'must remove outdated RBIs' do | ||
%w{ | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
}.each do |rbi| | ||
FileUtils.touch("#{outdir}/#{rbi}") | ||
end | ||
run("generate") | ||
FileUtils.touch("#{outdir}/[email protected]") | ||
|
||
output = run("bundle") | ||
|
||
|