diff options
Diffstat (limited to 'lib/bundler/cli/init.rb')
| -rw-r--r-- | lib/bundler/cli/init.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb index 65dd08dfe9..246b9d6460 100644 --- a/lib/bundler/cli/init.rb +++ b/lib/bundler/cli/init.rb @@ -32,16 +32,20 @@ module Bundler file << spec.to_gemfile end else - FileUtils.cp(File.expand_path("../../templates/#{gemfile}", __FILE__), gemfile) + File.open(File.expand_path("../templates/Gemfile", __dir__), "r") do |template| + File.open(gemfile, "wb") do |destination| + IO.copy_stream(template, destination) + end + end end puts "Writing new #{gemfile} to #{SharedHelpers.pwd}/#{gemfile}" end - private + private def gemfile - @gemfile ||= Bundler.settings[:init_gems_rb] ? "gems.rb" : "Gemfile" + @gemfile ||= options[:gemfile] || Bundler.preferred_gemfile_name end end end |
