# File lib/rubygems/source_index.rb, line 89 def load_specification(file_name) begin spec_code = File.read(file_name).untaint gemspec = eval(spec_code) if gemspec.is_a?(Gem::Specification) gemspec.loaded_from = file_name return gemspec end alert_warning "File '#{file_name}' does not evaluate to a gem specification" rescue SyntaxError => e alert_warning e alert_warning spec_code rescue Exception => e alert_warning(e.inspect.to_s + "\n" + spec_code) alert_warning "Invalid .gemspec format in '#{file_name}'" end return nil end