Skip to content

Commit b3110fd

Browse files
authored
Merge pull request heroku#512 from heroku/schneems/bundler-upgrade-warning-deux
[close heroku#507] Show bundler warning earlier
2 parents d4bb16d + 7190c68 commit b3110fd

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Master
22

3+
* Guarantee we always show warning when upgrading bundler version.
4+
35
## v148 (11/17/2016)
46

57
* Default Ruby Version is 2.2.6

hatchet.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"sharpstone/ruby_193_jruby_17161",
3030
"sharpstone/ruby_193_jruby_17161_jdk7",
3131
"sharpstone/ruby_193_jruby_17161_jdk8",
32+
"sharpstone/ruby_193_bad_patch_cedar_14",
3233
"sharpstone/jruby-minimal",
3334
"sharpstone/empty-procfile",
3435
"sharpstone/bad_ruby_version",

lib/language_pack/ruby.rb

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def compile
9090
new_app?
9191
Dir.chdir(build_path)
9292
remove_vendor_bundle
93+
warn_bundler_upgrade
9394
install_ruby
9495
install_jvm
9596
setup_language_pack_environment
@@ -110,6 +111,21 @@ def compile
110111

111112
private
112113

114+
def warn_bundler_upgrade
115+
old_bundler_version = @metadata.read("bundler_version").chomp if @metadata.exists?("bundler_version")
116+
117+
if old_bundler_version && old_bundler_version != BUNDLER_VERSION
118+
puts(<<-WARNING)
119+
Your app was upgraded to bundler #{ BUNDLER_VERSION }.
120+
Previously you had a successful deploy with bundler #{ old_bundler_version }.
121+
122+
If you see problems related to the bundler version please refer to:
123+
https://devcenter.heroku.com/articles/bundler-version
124+
125+
WARNING
126+
end
127+
end
128+
113129
# the base PATH environment variable to be used
114130
# @return [String] the resulting PATH
115131
def default_path
@@ -852,22 +868,10 @@ def load_bundler_cache
852868
rubygems_version_cache = "rubygems_version"
853869
stack_cache = "stack"
854870

855-
old_bundler_version = @metadata.read(bundler_version_cache).chomp if @metadata.exists?(bundler_version_cache)
856871
old_rubygems_version = @metadata.read(ruby_version_cache).chomp if @metadata.exists?(ruby_version_cache)
857872
old_stack = @metadata.read(stack_cache).chomp if @metadata.exists?(stack_cache)
858873
old_stack ||= DEFAULT_LEGACY_STACK
859874

860-
if old_bundler_version && old_bundler_version != BUNDLER_VERSION
861-
puts(<<-WARNING)
862-
Your app was upgraded to bundler #{ BUNDLER_VERSION }.
863-
Previously you had a successful deploy with bundler #{ old_bundler_version }.
864-
865-
If you see problems related to the bundler version please refer to:
866-
https://devcenter.heroku.com/articles/bundler-version
867-
868-
WARNING
869-
end
870-
871875
stack_change = old_stack != @stack
872876
convert_stack = @bundler_cache.old?
873877
@bundler_cache.convert_stack(stack_change) if convert_stack

0 commit comments

Comments
 (0)