Skip to content

Commit

Permalink
Add method current_ruby_version
Browse files Browse the repository at this point in the history
In order to use current ruby version from ENV var or constant
  • Loading branch information
bricesanchez committed Feb 28, 2018
1 parent 499f6ef commit 1b59e47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/lib/generators/refinery/cms/cms_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def append_heroku_gems!

append_file "Gemfile", %Q{
# The Ruby version is specified here so that Heroku uses the right version.
ruby #{ENV['RUBY_VERSION'].inspect}
ruby #{current_ruby_version.inspect}
# Gems that have been added for Heroku support
group :production do
Expand All @@ -94,6 +94,10 @@ def append_heroku_gems!
}.sub("{{production_gems}}", production_gems.join("\n "))
end

def current_ruby_version
ENV['RUBY_VERSION'].presence || RUBY_VERSION
end

def bundle!
run 'bundle install'
end
Expand Down

0 comments on commit 1b59e47

Please sign in to comment.