lib/autoproj/package_managers/bundler_manager.rb in autoproj-2.0.0.rc26 vs lib/autoproj/package_managers/bundler_manager.rb in autoproj-2.0.0.rc27

- old
+ new

@@ -73,18 +73,17 @@ env.original_env['RUBYLIB'] = (original_rubylib - system_rubylib).join(File::PATH_SEPARATOR) end ws.config.each_reused_autoproj_installation do |p| reused_w = ws.new(p) - reused_c = reused_w.load_config env.add_path 'PATH', File.join(reused_w.prefix_dir, 'gems', 'bin') end prefix_gems = File.join(ws.prefix_dir, "gems") FileUtils.mkdir_p prefix_gems gemfile = File.join(prefix_gems, 'Gemfile') - if !File.exists?(gemfile) + if !File.exist?(gemfile) File.open(gemfile, 'w') do |io| io.puts "eval_gemfile \"#{File.join(ws.dot_autoproj_dir, 'autoproj', 'Gemfile')}\"" end end @@ -209,10 +208,11 @@ end deps.each do |d| if d.source options = d.source.options.dup options.delete 'root_path' + options.delete 'uri' options = options.map { |k, v| "#{k}: \"#{v}\"" } end contents << [" #{platform_indent}gem \"#{d.name}\", \"#{d.requirement}\"", *options].join(", ") end if !platform_name.empty? @@ -255,11 +255,11 @@ gemfiles << File.join(ws.dot_autoproj_dir, 'autoproj', 'Gemfile') # Save the osdeps entries in a temporary gemfile and finally # merge the whole lot of it gemfile_contents = Tempfile.open 'autoproj-gemfile' do |io| - osdeps_gemfile_lines = gems.sort.map do |name| + gems.sort.each do |name| name, version = parse_package_entry(name) io.puts "gem \"#{name}\", \"#{version || ">= 0"}\"" end io.flush gemfiles.unshift io.path @@ -290,10 +290,10 @@ update_env_rubylib(bundle_rubylib) else raise NotCleanState, "bundler executed successfully, but the result was not in a clean state" end - rescue Exception => e + rescue Exception Autoproj.warn "saved the new Gemfile in #{gemfile_path}.FAILED and restored the last Gemfile version" FileUtils.cp gemfile_path, "#{gemfile_path}.FAILED" backup_restore(backups) raise ensure