lib/origen/boot/app.rb in origen-0.60.7 vs lib/origen/boot/app.rb in origen-0.60.8

- old
+ new

@@ -227,56 +227,54 @@ end end def setup_bundler(origen_root) bundle_path = nil - eval BUNDLER_SETUP # Will update bundle_path + eval BUNDLER_SETUP # Will update bundle_path bundle_path end def copy_system_gems(origen_root, bundle_path) if Origen.site_config.gem_use_from_system local_gem_dir = "#{bundle_path}/ruby/#{Pathname.new(Gem.dir).basename}" gem_dir = Pathname.new(Gem.dir) Origen.site_config.gem_use_from_system.each do |gem, version| - begin - # This will raise an error if the system doesn't have this gem installed, that - # will be rescued below - spec = Gem::Specification.find_by_name(gem, version) + # This will raise an error if the system doesn't have this gem installed, that + # will be rescued below + spec = Gem::Specification.find_by_name(gem, version) - # If the spec has returned a handle to a system installed gem. If this script has been invoked through - # Bundler then it could point to some other gem dir. The only time this should occur is when switching - # from the old system to the new system, but can't work out how to fix it so just disabling in that case. - if spec.gem_dir =~ /#{gem_dir}/ + # If the spec has returned a handle to a system installed gem. If this script has been invoked through + # Bundler then it could point to some other gem dir. The only time this should occur is when switching + # from the old system to the new system, but can't work out how to fix it so just disabling in that case. + if spec.gem_dir =~ /#{gem_dir}/ - local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir)) - FileUtils.mkdir_p local_dir - FileUtils.cp_r("#{spec.gem_dir}/.", local_dir) + local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir)) + FileUtils.mkdir_p local_dir + FileUtils.cp_r("#{spec.gem_dir}/.", local_dir) - local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir))) - FileUtils.mkdir_p local_file.dirname - FileUtils.cp(spec.cache_file, local_file) + local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir))) + FileUtils.mkdir_p local_file.dirname + FileUtils.cp(spec.cache_file, local_file) - if spec.extension_dir && File.exist?(spec.extension_dir) - local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir)) - FileUtils.mkdir_p local_dir - FileUtils.cp_r("#{spec.extension_dir}/.", local_dir) - end + if spec.extension_dir && File.exist?(spec.extension_dir) + local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir)) + FileUtils.mkdir_p local_dir + FileUtils.cp_r("#{spec.extension_dir}/.", local_dir) + end - local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir))) - FileUtils.mkdir_p local_file.dirname - FileUtils.cp(spec.spec_file, local_file) + local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir))) + FileUtils.mkdir_p local_file.dirname + FileUtils.cp(spec.spec_file, local_file) - puts "Copied #{gem} #{version} from the system into #{bundle_path}" + puts "Copied #{gem} #{version} from the system into #{bundle_path}" - end - - rescue Exception # Gem::LoadError # Rescue everything here, this is a try-our-best operation, better to - # continue and try and install the gem if this fails rather than crash - # This just means that one of the gems that should be copied from the system - # was not actually installed in the system, so nothing we can do about that here end + + rescue Exception # Gem::LoadError # Rescue everything here, this is a try-our-best operation, better to + # continue and try and install the gem if this fails rather than crash + # This just means that one of the gems that should be copied from the system + # was not actually installed in the system, so nothing we can do about that here end end end end end