<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/models/note_mailer.rb</filename>
    </added>
    <added>
      <filename>app/views/doc/advanced_search.rhtml</filename>
    </added>
    <added>
      <filename>app/views/doc/file_contents.rhtml</filename>
    </added>
    <added>
      <filename>app/views/doc/library.rhtml</filename>
    </added>
    <added>
      <filename>app/views/doc/partials/_list.rhtml</filename>
    </added>
    <added>
      <filename>app/views/note_mailer/admin.rhtml</filename>
    </added>
    <added>
      <filename>app/views/note_mailer/confirm.rhtml</filename>
    </added>
    <added>
      <filename>db/migrate/005_email_for_notes.rb</filename>
    </added>
    <added>
      <filename>test/fixtures/note_mailer/admin</filename>
    </added>
    <added>
      <filename>test/fixtures/note_mailer/confirm</filename>
    </added>
    <added>
      <filename>test/unit/note_mailer_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -68,3 +68,30 @@ task &quot;doc:api:rails&quot; do
   
   RDoc::RDoc.new.document(params + dirs)
 end
+
+task &quot;doc:api:rails_vendor&quot; do
+  params = []
+  params &lt;&lt; &quot;--fmt=yaml&quot;
+  params &lt;&lt; &quot;--opname=rails-1.1.2&quot;
+  dirs = []
+  dirs &lt;&lt; 'vendor/rails/railties/README'  
+  dirs &lt;&lt; 'vendor/rails/railties/CHANGELOG'
+  dirs &lt;&lt; 'vendor/rails/railties/MIT-LICENSE'
+  dirs &lt;&lt; 'vendor/rails/activerecord/README' 
+  dirs &lt;&lt; 'vendor/rails/activerecord/CHANGELOG'
+  dirs &lt;&lt; 'vendor/rails/activerecord/lib/'
+  dirs &lt;&lt; 'vendor/rails/actionpack/README'
+  dirs &lt;&lt; 'vendor/rails/actionpack/CHANGELOG'
+  dirs &lt;&lt; 'vendor/rails/actionpack/lib/'
+  dirs &lt;&lt; 'vendor/rails/actionmailer/README'
+  dirs &lt;&lt; 'vendor/rails/actionmailer/CHANGELOG'
+  dirs &lt;&lt; 'vendor/rails/actionmailer/lib/'
+  dirs &lt;&lt; 'vendor/rails/actionwebservice/README'
+  dirs &lt;&lt; 'vendor/rails/actionwebservice/CHANGELOG'
+  dirs &lt;&lt; 'vendor/rails/actionwebservice/lib/'
+#  dirs &lt;&lt; 'vendor/rails/activesupport/README'
+  dirs &lt;&lt; 'vendor/rails/activesupport/CHANGELOG'
+  dirs &lt;&lt; 'vendor/rails/activesupport/lib/'
+  
+  RDoc::RDoc.new.document(params + dirs)
+end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,55 @@ class Admin::NotesController &lt; ApplicationController
 	before_filter :login_required
 	helper :notes
 	layout 'admin/admin.rhtml'
+			
+	def show
+  # Start main code
+  s = File.open(&quot;d:\\rails_site_notes.xml&quot;).read
+  array = s.scan(/&lt;entry&gt;.*?&lt;title type=&quot;text&quot;&gt;New note for - ([^&lt;]*)&lt;\/t.*?d&gt;([^&lt;]*)&lt;\/p.*?l&quot;&gt;(.*?)&lt;\/summ.*?e&gt;([^&lt;]*)&lt;/m)
+
+  array.each do |entry|
+  n = Note.new
+    
+  if(s == &quot;Index page&quot;)
+    container_name = &quot;index&quot;
+    note_type = &quot;index&quot;
+    note_group = &quot;index&quot;
+  elsif(s =~ /Method/)
+    m = s.match(/Method ([a-zA-z0-9_]+) of ([a-zA-z0-9_:]+)/)
+    container_name = m[1]
+    note_type = &quot;RaMethod&quot;
+    note_group = m[0] # method name
+  elseif(s =~ / section of /)
+    m = s.match(/([a-zA-z0-9_]+) section of ([a-zA-z0-9_:]+)/)
+    container_name = m[1]
+    type = get_note_type(m[0])
+    note_type = type
+    note_group = type
+  else
+    container_name = m
+    type = get_container_type(m)
+    note_type = type
+    note_group = type
+  end
+  
+  n.container_name = container_name
+  n.note_type = note_type
+  n.note_group = note_group
+  n.email = entry[4]
+  n.text = entry[3]
+  n.ip_address = &quot;127.0.0.1&quot;
+  n.created_at = entry[1]
+  n.updated_at = entry[1]
+  n.total_votes = 0
+  n_version = &quot;1.8.4&quot;
+  n.status = 0
+  
+  n.save
+  end
+  
+  puts &quot;done!&quot;	
+	end
+	
 	
 	def index
 	  @note_filter = NoteFilter.new(@params['note_filter'])
@@ -27,9 +76,7 @@ class Admin::NotesController &lt; ApplicationController
 	  @note = Note.find(@params['id'])
 	end
 	
-	def show
-      @note = Note.find(@params['id'])		
-	end
+
 	
 	# update a note and expire the cache if necessary
 	def update
@@ -63,8 +110,35 @@ class Admin::NotesController &lt; ApplicationController
          Note.delete(note.id)    
       end
 	end	
-
-private
+	
+	# show the list of notes waiting for moderation
+	def list_moderate
+	   @notes = Note.find(:all, :conditions =&gt; [&quot;approved = ?&quot;, false])
+	end
+	
+	def moderate
+	   # get the list of notes to approve
+	   # get the list of notes to delete
+	   # get the list of notes to hide
+	end
    
 
+def get_contanier_type(type_string)
+  container = RaContainer.find_by_name(type_string) 
+  return container.class.to_s
+end
+
+def get_note_type(type_string)
+  case type_string
+     when &quot;Method&quot; then return &quot;RaMethod&quot;
+     when &quot;Children&quot; then return &quot;RaChildren&quot;
+     when &quot;InFiles&quot; then return &quot;RaInFile&quot;
+     when &quot;Attributes&quot; then return &quot;RaAttribute&quot;
+     when &quot;Constants&quot; then return &quot;RaConstant&quot;
+     when &quot;Includes&quot; then return &quot;RaInclude&quot;
+     when &quot;Requires&quot; then return &quot;RaRequire&quot;
+     when &quot;Aliases&quot; then return &quot;RaAlias&quot;    
+  end
+end
+
 end
\ No newline at end of file</diff>
      <filename>app/controllers/admin/notes_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'pp'
+
 class Admin::UploadController &lt; ApplicationController
 	before_filter :login_required
 	layout 'admin/admin.rhtml'
@@ -13,12 +15,12 @@ class Admin::UploadController &lt; ApplicationController
   	  # entry in the hash contains a list of all the library versions
   	  @libraries = Hash.new
   	  all_libs.each do |l|
-  		unless @libraries[l.name] then @libraries[l.name] = Array.new end
-  		@libraries[l.name].push(l)
-  	  end  	  	   	 
+  		  unless @libraries[l.name] then @libraries[l.name] = Array.new end
+  		  @libraries[l.name].push(l)
+  	  end
 	end
 	
-	# delete a library and all of its contents
+	# delete libraries and all of their associated contents
 	def delete	    
 		library_ids = @params[:id]
 				
@@ -29,20 +31,33 @@ class Admin::UploadController &lt; ApplicationController
 		  
 		  library = RaLibrary.find(library_id)
 		  name = library.name
-		
-		  RaCodeObject.connection.delete(&quot;DELETE ra_code_objects FROM ra_code_objects, ra_containers WHERE ra_code_objects.ra_container_id = ra_containers.id AND ra_containers.ra_library_id = &quot; + library_id)
-		  RaInFile.connection.delete(&quot;DELETE ra_in_files FROM ra_in_files, ra_containers WHERE ra_in_files.ra_container_id = ra_containers.id AND ra_containers.ra_library_id = &quot; + library_id)
-		  RaSourceCode.connection.delete(&quot;DELETE ra_source_codes FROM ra_source_codes, ra_methods, ra_containers WHERE ra_source_codes.id = ra_methods.ra_source_code_id AND ra_methods.ra_container_id = ra_containers.id AND ra_containers.ra_library_id = &quot; + library_id)
-		  RaComment.connection.delete(&quot;DELETE ra_comments FROM ra_comments, ra_methods, ra_containers WHERE ra_comments.id = ra_methods.ra_comment_id AND ra_methods.ra_container_id = ra_containers.id AND ra_containers.ra_library_id = &quot; + library_id)
-		  RaMethod.connection.delete(&quot;DELETE ra_methods FROM ra_methods, ra_containers WHERE ra_methods.ra_container_id = ra_containers.id AND ra_containers.ra_library_id = &quot; + library_id)
-		  RaComment.connection.delete(&quot;DELETE ra_comments FROM ra_comments, ra_containers WHERE ra_comments.id = ra_containers.ra_comment_id AND ra_containers.ra_library_id =&quot; + library_id)
-		  RaContainer.connection.delete(&quot;DELETE FROM ra_containers WHERE ra_library_id = &quot; + library_id)
-		  RaLibrary.connection.delete(&quot;DELETE FROM ra_libraries WHERE id =&quot; + library_id)	
+		 
+		  # ok this really should be more activerecord'ish
+		  # but I didn't have enough time to do that, so for now we know it works on
+		  # two DBs, mysql and postgres
+		  begin
+		    RaCodeObject.connection.delete(&quot;DELETE ra_code_objects FROM ra_code_objects, ra_containers WHERE ra_code_objects.ra_container_id = ra_containers.id AND ra_containers.ra_library_id = &quot; + library_id)
+		    RaInFile.connection.delete(&quot;DELETE ra_in_files FROM ra_in_files, ra_containers WHERE ra_in_files.ra_container_id = ra_containers.id AND ra_containers.ra_library_id = &quot; + library_id)
+		    RaSourceCode.connection.delete(&quot;DELETE ra_source_codes FROM ra_source_codes, ra_methods, ra_containers WHERE ra_source_codes.id = ra_methods.ra_source_code_id AND ra_methods.ra_container_id = ra_containers.id AND ra_containers.ra_library_id = &quot; + library_id)
+		    RaComment.connection.delete(&quot;DELETE ra_comments FROM ra_comments, ra_methods, ra_containers WHERE ra_comments.id = ra_methods.ra_comment_id AND ra_methods.ra_container_id = ra_containers.id AND ra_containers.ra_library_id = &quot; + library_id)
+		    RaMethod.connection.delete(&quot;DELETE ra_methods FROM ra_methods, ra_containers WHERE ra_methods.ra_container_id = ra_containers.id AND ra_containers.ra_library_id = &quot; + library_id)
+		    RaComment.connection.delete(&quot;DELETE ra_comments FROM ra_comments, ra_containers WHERE ra_comments.id = ra_containers.ra_comment_id AND ra_containers.ra_library_id =&quot; + library_id)
+		    RaContainer.connection.delete(&quot;DELETE FROM ra_containers WHERE ra_library_id = &quot; + library_id)
+		    RaLibrary.connection.delete(&quot;DELETE FROM ra_libraries WHERE id =&quot; + library_id)	
+      rescue
+		    RaCodeObject.connection.delete(&quot;DELETE FROM ra_code_objects WHERE id IN (SELECT ra.id FROM ra_code_objects AS ra, ra_containers AS rc, ra_libraries AS rl WHERE ra.ra_container_id = rc.id AND rc.ra_library_id = rl.id AND rl.id =&quot; + library_id + &quot;)&quot;)
+		    RaInFile.connection.delete(&quot;DELETE FROM ra_in_files WHERE id in (SELECT ra.id FROM ra_in_files AS ra, ra_containers AS rc, ra_libraries AS rl WHERE ra.ra_container_id = rc.id AND rc.ra_library_id = rl.id AND rl.id =&quot; + library_id + &quot;)&quot;)
+		    RaSourceCode.connection.delete(&quot;DELETE FROM ra_source_codes WHERE id IN (SELECT rs.id FROM ra_source_codes AS rs, ra_methods AS rm, ra_containers AS rc, ra_libraries AS rl WHERE rs.id = rm.ra_source_code_id AND rm.ra_container_id = rc.id AND rc.ra_library_id = rl.id AND rl.id =&quot; + library_id + &quot;)&quot;)
+		    RaComment.connection.delete(&quot;DELETE FROM ra_comments WHERE id IN (SELECT rs.id FROM ra_comments AS rs, ra_methods AS rm, ra_containers AS rc, ra_libraries AS rl WHERE rs.id = rm.ra_comment_id AND rm.ra_container_id = rc.id AND rc.ra_library_id = rl.id AND rl.id =&quot; + library_id + &quot;)&quot;)
+		    RaMethod.connection.delete(&quot;DELETE FROM ra_methods WHERE id IN (SELECT ra.id FROM ra_methods AS ra, ra_containers AS rc, ra_libraries AS rl WHERE ra.ra_container_id = rc.id AND rc.ra_library_id = rl.id AND rl.id =&quot; + library_id + &quot;)&quot;)
+		    RaComment.connection.delete(&quot;DELETE FROM ra_comments WHERE id IN (SELECT rs.id FROM ra_comments AS rs, ra_containers AS rc, ra_libraries AS rl WHERE rs.id = rc.ra_comment_id AND rc.ra_library_id = rl.id AND rl.id =&quot; + library_id + &quot;)&quot;)
+		    RaContainer.connection.delete(&quot;DELETE FROM ra_containers WHERE id IN (SELECT rc.id FROM ra_containers AS rc, ra_libraries AS rl WHERE rc.ra_library_id = rl.id AND rl.id =&quot; + library_id + &quot;)&quot;)
+		  end
 		  
 		  # make sure that the highest library version is still marked as the current version
 		  libraries = RaLibrary.find(:all, :conditions =&gt; [&quot;name = ?&quot;, name])		  
-          max_lib = nil
-          max_ver = 0
+      max_lib = nil
+      max_ver = 0
 		  libraries.each do |lib|
 		    if(lib.version &gt; max_ver)
 		      max_lib = lib
@@ -60,139 +75,179 @@ class Admin::UploadController &lt; ApplicationController
 		redirect_to :action =&gt; :list
 	end
 	
-    # Try and avoid errors for PostgreSQL and maybe other databases too.
-    # If it fails, we log an exception instead of putting up an error page
-    # because we can still complete the mission, just slower?  
-	def autocommit(state=true)
-	  begin
-	   ActiveRecord::Base.connection.execute( 'SET AUTOCOMMIT=' + state ? '1' : '0' )
-	  rescue
-	    begin
-	      ActiveRecord::Base.connection.execute( state ? 'BEGIN' : 'COMMIT' )
-	    rescue Exception =&gt; e
-	      logger.info &quot;Oops. #{e.to_s}\n&quot; + e.backtrace.join + &quot;\n&quot;
+  # given a directory import all files from that directory
+	def mass_import
+	  dir = params[:directory]
+	  files = Dir.glob(dir + &quot;/*.out&quot;)
+	  
+	  @success = []
+	  @total_count = 0
+	  
+	  for file in files
+	    do_import(file)
+	    if(@error)
+	      if(params[:ignore])
+	        @success &lt;&lt; &quot;failed: &quot; + file + &quot; &quot; + @error
+	        next
+	      else
+	        @success &lt;&lt; &quot;failed: &quot; + file + &quot; &quot; + @error
+	        break
+	      end
 	    end
+      @success &lt;&lt; &quot;success: &quot; + file	    
 	  end
+	  
+    render :action =&gt; :create			  
 	end
 	
+	# import a single file
 	def import
-	    
-	  init_classes()
-		    
-		@connection = ActiveRecord::Base.connection
+	  @total_count = 0	
+	  do_import(params['doc_file'], true)
+	  if(@error)
+  	  @success = [@error]
+  	else
+  	 @success = [&quot;success: &quot; + params['doc_file'].original_filename]
+  	end
+  	
+		render :action =&gt; :create
+	end
+	
+private
 
-		if(@connection.class.to_s =~ /mysql/i)
-          # check to see if the connection is MySQL, if so then we have created some 
-          # optimizations for MySql inserts          
-		  @connection_type = &quot;mysql&quot;
-		else
-		  @connection_type = &quot;other&quot;
-		end	
-		
-		# Lookup hash used to map ids in the YAML file to database IDs
-		lookup = {}
+  # import a single library into the database
+  def do_import(file, tempfile = false)
+    init_classes()
+	
+	  @connection = ActiveRecord::Base.connection
+
+    if(@connection.class.to_s =~ /mysql/i)
+      # check to see if the connection is MySQL, if so then we have created some 
+      # optimizations for MySql inserts          
+	    @connection_type = &quot;mysql&quot;
+	  else
+	    @connection_type = &quot;other&quot;
+	  end	
 		
-		# Lookup hash used to keep columns around so that they do not need to be
-		# recreated each time
-		@col_hash = Hash.new
+    # Lookup hash used to map ids in the YAML file to database IDs
+    lookup = {}
 		
-		file_name = @params['doc_file'].original_filename
-		match = /([a-zA-Z]+)-([0-9]+)\.([0-9]+)\.([0-9]+)\.out/.match(file_name)
-		if(!match)
-			@error = &quot;File name must have the format name-major.minor.release.out, ex: rails-1.2.1.out&quot;				 
-			render :action =&gt; :index	
-			return
-		end	
+    # Lookup hash used to keep columns around so that they do not need to be
+    # recreated each time
+    @col_hash = Hash.new
+	  
+	  # should we be reading the file passed in, or is it a file stream already
+    if(tempfile)
+      file_name = file.original_filename
+    else
+      file_name = file
+    end
 		
+    match = /([a-zA-Z0-9]+)-([0-9]+)\.([0-9]+)\.([0-9]+)\.out/.match(file_name)
+    if(!match)
+      @error = &quot;File name must have the format name-major.minor.release.out, ex: rails-1.2.1.out&quot;
+      return
+    end		
 
-		ActiveRecord::Base.connection.transaction do									
-			# Create a new library object	
-			@library = RaLibrary.new({:name =&gt; match[1], :major =&gt; match[2], :minor =&gt; match[3], :release =&gt; match[4]})		
-			@library.current = false
-			@library.date = DateTime.now
-			
-			if(@library.find_lib == nil)
-			  @library.calc_version			  			  
+    # measure the time it takes to do the DB inserts
+    start = Time.now
+    count = 0
+    # Set the logging level to ERROR so that we do not output SQL when we are debugging
+    # that really slows things down
+    loglevel = logger.level
+    logger.level = Logger::ERROR
+    
+    ActiveRecord::Base.connection.transaction do
+      autocommit(false)    
+      # Create a new library object
+      @library = RaLibrary.new({:name =&gt; match[1], :major =&gt; match[2], :minor =&gt; match[3], :release =&gt; match[4]})		
+      @library.current = false
+      @library.date = DateTime.now
+		
+      if(@library.find_lib == nil)
+        @library.calc_version 			  
+        @library.save!
+        # ok now we need to see if the library version that we uploaded is the most recent version of this library			
+        higher_version = RaLibrary.find(:first, :conditions =&gt; [&quot;name = ? AND version &gt; ?&quot;, @library.name, @library.version])
+        if(higher_version == nil)
+          # if our version is the most recent remove the current status from all the current entries
+          currents = RaLibrary.find(:all, :conditions =&gt; [&quot;name = ? AND current = ?&quot;, @library.name, true])
+          if(currents)
+            currents.each do |c|
+              c.current = false
+              c.save!
+            end
+          end
+			  end
+        # now set the status of this library to be most recent and save it
+			  @library.current = true
 			  @library.save!
-			  # ok now we need to see if the library version that we uploaded is the most recent version of this library			
-			  higher_version = RaLibrary.find(:first, :conditions =&gt; [&quot;name = ? AND version &gt; ?&quot;, @library.name, @library.version])
-			  if(higher_version == nil)
-				# if our version is the most recent remove the current status from all the current entries
-				currents = RaLibrary.find(:all, :conditions =&gt; [&quot;name = ? AND current = ?&quot;, @library.name, true])
-				if(currents)
-					currents.each do |c|
-						c.current = false
-						c.save!
-					end
-				end
-				# now set the status of this library to be most recent and save it
-				@library.current = true
-				@library.save!
-			  end						
-									
-			  # measure the time it takes to do the DB inserts
-		 	  start = Time.now
+    	else
+    	  @error = &quot;Could not import library &quot; + file_name + &quot; already exists&quot;
+    	  return
+    	end 	
+      
+      # Read in the YAML file	
+      if(!tempfile)
+        file = File.open(file)
+      end
+      
+      yp = YAML::load_documents( file ) { |doc|
+        # if this is a library record then merge the attributes
+        # with our library and save it (can provide more information)
+        if(doc.class.to_s == RaLibrary.to_s)
+		      # if there is a 'main' attribute it will be the name of the 
+		      # file that should be displayed as the home page for this library
+		      # this should be translated to the container id
+		      if(doc.attributes['home_page'] != nil)
+		        home_page = RaContainer.find(:first, :conditions =&gt; [&quot;full_name = ? AND ra_library_id = ?&quot;, doc.home_page, @library.id])		      
+		        if(home_page != nil)
+  		        @library.main_container_id = home_page.id
+		        end      
+		      end
+		      
+		      attr = doc.attributes
+		      attr.delete(&quot;home_page&quot;)
+		      @library.update_attributes(attr)
+		    else
+		      # Each record has a unique id. This id changes though when we insert it into the
+		      # database. This would not be a problem except that all of the records are associated 
+		      # by these ids so when a record is inserted into the DB we need to make sure the associations are
+		      # updated. get_ids takes care of this updating.
+		      #
+		      # IMPORTANT NOTE: This requires that the YAML is written out in the correct order so that we always insert
+		      # a record before we need its id for an association		  	  		    		   		   		  
+ 		      id = doc.id
+		      get_ids(doc, lookup)
+		      lookup[id] = insert_object(doc)				  
+		      count = count + 1
+		    end
+		  }		
 	 	
-	  	 	  # Set the logging level to ERROR so that we do not output SQL when we are debugging
-		 	  # that really slows things down
-	 		  loglevel = logger.level
-	 		  logger.level = Logger::ERROR
-
-	 		  autocommit(true)
-	 		  
-	 		  count = 0
-			  # Read in the YAML file			
-			  yp = YAML::load_documents( @params['doc_file'] ) { |doc| 
-			  
-				  # Each record has a unique id. This id changes though when we insert it into the
-				  # database. This would not be a problem except that all of the records are associated 
-				  # by these ids so when a record is inserted into the DB we need to make sure the associations are
-				  # updated. get_ids takes care of this updating.
-				  #
-				  # IMPORTANT NOTE: This requires that the YAML is written out in the correct order so that we always insert
-				  # a record before we need its id for an association.				  
-				  id = doc.id
-				  get_ids(doc, lookup)
-				  lookup[id] = insert_object(doc)				  
-				  count = count + 1
-			  }		
-	 		  
-	 		  autocommit(false)
-	 		  	 
-			  @total_time = Time.now - start	
-			  @total_count = count
-			  logger.level = loglevel
-    		else
-    		  @error = &quot;Could not import library, already exists&quot;
-    		end			
-		end			
-		
-		render :action =&gt; :create		
-	end
-	
-private
-
-	# Insert an active record object into the DB
-	def insert_object(obj) 		
-	  
-	  if(@connection_type == &quot;mysql&quot;)
-	    obj.id = nil
-	    # We don't want to  use the ActiveRecord::Base.save method because it is slow
-  	    # ~1300 inserts on a MySQL DB MyIASM table on windows is 5.7 seconds with this method 
-  	    # and 17.5 seconds using .save  	 
-	    unless(@col_hash[obj.class.to_s])
-	       @col_hash[obj.class.to_s] = column_list(obj.attributes.keys)
-	    end
-	    columns = @col_hash[obj.class.to_s]
-	    values = value_list(obj.attributes.values)
-	    
-	    val = @connection.insert &quot;INSERT INTO #{obj.class.table_name} (#{columns}) VALUES (#{values})&quot;
-	  else
-	    # slower but works on PostgreSQL and other DBs where they cannot have a NULL id in the insert
-	    obj.save
-	    obj.id
+	 	  if(!tempfile)
+	 	    file.close
+	 	  end
+ 	  autocommit(true)	 	  
 	  end
-	end
+ 	  
+		logger.level = loglevel			 		  	 
+		@total_time = Time.now - start	
+		@total_count += count
+  end
+
+	def insert_object(obj) 			  
+    # We don't want to  use the ActiveRecord::Base.save method because it is slow
+	  # ~1300 inserts on a MySQL DB MyIASM table on windows is 5.7 seconds with this method 
+	  # and 17.5 seconds using .save  	 
+    unless(@col_hash[obj.class.to_s])
+      @col_hash[obj.class.to_s] = column_list(obj.attributes.keys.reject! { |key| key =~ /^id$/ })
+    end
+    columns = @col_hash[obj.class.to_s]
+    attributes = obj.attributes
+    attributes.delete('id') # remove the id column
+    values = value_list(attributes.values) if attributes  
+    val = @connection.insert &quot;INSERT INTO #{obj.class.table_name} (#{columns}) VALUES (#{values})&quot; if values
+ 	end
   
   # Create a list of column names from an array of strings
   def column_list(keys)
@@ -202,36 +257,60 @@ private
 
   # Create a list of insertable values from an array of strings
   def value_list(values)
-    values.map { |v| ActiveRecord::Base.connection.quote(v).gsub('\\n', &quot;\n&quot;).gsub('\\r', &quot;\r&quot;) }.join(&quot;, &quot;)
+    values.map { |v| ActiveRecord::Base.connection.quote(v).gsub('\n', &quot;\\n&quot;).gsub('\r', &quot;\\r&quot;) }.join(&quot;, &quot;)
   end		
 		
 	# Lookup the database ids for all the associations for this type of object
-	def get_ids(doc, lookup)
-		
+	def get_ids(doc, lookup)		
 		case(doc.class.superclass.to_s)
 			when RaCodeObject.to_s
 				doc.ra_container_id = lookup[doc.ra_container_id]
+				doc.file_id = lookup[doc.file_id]
 			when RaContainer.to_s
 				doc.parent_id = lookup[doc.parent_id]
 				doc.ra_comment_id = lookup[doc.ra_comment_id]
-				doc.ra_library_id = @library.id
+				doc.ra_library_id = @library.id				
 		end
 		
+		puts &quot;#{doc.class.to_s} - #{doc.id}&quot;	
+		pp doc.attributes
+		puts &quot;**&quot;
+		
 		case(doc.class.to_s)
+	    when RaClass.to_s
+	        doc.file_id = lookup[doc.file_id]
+	    when RaModule.to_s
+          doc.file_id = lookup[doc.file_id]	    
 			when RaMethod.to_s
 				doc.ra_container_id = lookup[doc.ra_container_id]
 				doc.ra_comment_id = lookup[doc.ra_comment_id]
 				doc.ra_source_code_id = lookup[doc.ra_source_code_id]
+				doc.file_id = lookup[doc.file_id]				
 			when RaInFile.to_s
 				doc.ra_container_id = lookup[doc.ra_container_id]
 		end
 	end
 	
-    # if none of these classes has been previously used then the 
-    # YAML load will fail because it will not find the class to be able to
-    # instantiate it, not sure why this happens, but this here fixes that issue
-    # by creating an instance of each class needed	
-	def init_classes()
+    # Try and avoid errors for PostgreSQL and maybe other databases too.
+    # If it fails, we log an exception instead of putting up an error page
+    # because we can still complete the mission, just slower?  
+	def autocommit(state=true)
+	  begin
+	    ActiveRecord::Base.connection.execute('SET AUTOCOMMIT = ' + (state ? '1' : '0') )
+	  rescue
+	    begin
+	      ActiveRecord::Base.connection.execute( state ? 'BEGIN' : 'COMMIT' )
+	    rescue Exception =&gt; e
+	      logger.info &quot;Oops. #{e.to_s}\n&quot; + e.backtrace.join + &quot;\n&quot;
+	    end
+	  end
+	end	
+	
+  # if none of these classes has been previously used then the 
+  # YAML load will fail because it will not find the class to be able to
+  # instantiate it, not sure why this happens, but this here fixes that issue
+  # by creating an instance of each class needed	
+  def init_classes()
 	    c = RaCodeObject.new
 	    c = RaInFile.new
 	    c = RaFile.new</diff>
      <filename>app/controllers/admin/upload_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,91 +1,70 @@
 class DocController &lt; ApplicationController
+
+  # turn off sessions to speed things up
   session :off
 
   # cache the main actions for this controller
-  caches_page :index, :list, :files, :modules, :classes, :libraries
+  caches_page :index, :container, :library, :list, :libraries, :history, :file_contents
   
+  # TODO: Document why the notes helper is needed here?
   helper :notes
 
   # display the index page with an optional home page
   def index    
     if(RANNOTATE_HOME_PAGE != nil)
       main_page = RaContainer.find_highest_version(RANNOTATE_HOME_PAGE, 'RaFile')      
-      if(main_page != nil)             
+      if(main_page != nil)         
         @home = main_page
       end
-    end     
-  end
-
-  # display a file
-  def files
-  	if(params[:method])
-  	  	method(RaFile.to_s)
-	    render :action =&gt; 'method'   	  	
-  	else  
-	    get_container(RaFile.to_s) 
-	    render :action =&gt; 'container'	          
-	end
-  end
-
-  # display a module
-  def modules
-  	if(params[:method])
-  	  	method(RaModule.to_s)
-	    render :action =&gt; 'method'   	  	  	
-  	else
-  		get_container(RaModule.to_s)
-    	render :action =&gt; 'container'     	
     end
   end
   
-  # display a class  
-  def classes    
-  	if(params[:method])
-  	  	method(RaClass.to_s)
-	    render :action =&gt; 'method'   	  	  	
-  	else	    	
-	  	get_container(RaClass.to_s)
-	    render :action =&gt; 'container'     	
-	end
-  end
-  
-  
-  # this is a method that causes a container to display without caching
+  # display a container given a library name, class/file/module name, method name, version
   def container
-    # this is needed because after creating a new note we go back to the container
-    # page and it gets cached. Howerver the page is in &quot;expanded&quot; mode to show the note that you just added
-    # this means that the section with your note is expanded out
-    # this page then gets cached and everyone that goes there after that sees your note
-    # to solve this problem we use this action that doesn't cache the page
-    # NOTE: let it be known that page caching can cause extreme headaches
-    get_container(params[:type])
-  end
-
-  # display a method  
-  def method(type)
-  	@container_name = @params[:name]
-  	@version = @params[:version]
-    @ra_container = RaContainer.find_highest_version(@container_name, type, @version)
-    @method = RaMethod.find(:first, :include =&gt; :ra_comment, :conditions =&gt; [&quot;ra_container_id = ? AND name = ?&quot;, @ra_container.id, @params[:method]])
-    @source_code = RaSourceCode.find(@method.ra_source_code_id).source_code
-    @page_title = RANNOTATE_SITE_NAME + &quot; &quot; + @container_name + &quot;-&quot; + @method.name
-    @container_url = url_for(:action =&gt; @ra_container.class.type_string.pluralize, :name =&gt; @container_name, :method =&gt; nil)
-  end
+    lib_name = params[:lib_name]
+    container_name = params[:container]
+    version = params[:version]
+    method = params[:method]
+    
+    # Depending on what parameters we are given we either display
+    # the method page, the class/module file page, or the library home page    
+    if(method)
+      method(lib_name, container_name, version, method)
+	    render :action =&gt; 'method'
+    elsif(container_name)
+      get_container(lib_name, container_name, version)
+    else
+      get_library(lib_name, version)
+     render :action =&gt; 'library'
+    end
+  end 
   
-  # display a list of entries
+  # display a list of classes/files/methods
   def list
-  	get_list(params[:type], params[:library], params[:version])
-  end 
+  	get_list(params[:lib_name], params[:type], params[:version])
+  	@type = params[:type]
+  	
+  	# if there is no library name then this is a list of all the entries in the system
+  	# so we have to show the library name beside each
+  	if(params[:lib_name] == nil)
+	    @show_library = true  	
+  	end
+  	
+  	# files are listed in a single column, so they have a separate template
+  	if(params[:type] == 'files')
+  	  render :action =&gt; 'list_files'
+  	end  	
+  end
   
   # Used by AJAX to display inline notes
-  def notes 
+  def notes
     render_notes(params[:container_name], params[:note_group])     
   end   
   
   # Used by AJAX to display inline source code
   def source_code
     render_source(params[:source_id])
-  end  
+  end
   
   # search the database for classes, methods, files
   def search
@@ -95,53 +74,97 @@ class DocController &lt; ApplicationController
   
   # list all of the libraries in the system  
   def libraries
-  	all_libs = RaLibrary.find(:all, :order =&gt; &quot;name ASC, version DESC&quot;)
-  	
-  	# collect all of the libraries into a hash by library name, each
-  	# entry in the hash contains a list of all the library versions
-  	@libraries = Hash.new
-  	all_libs.each do |l|
-  		unless @libraries[l.name] then @libraries[l.name] = Array.new end
-  		@libraries[l.name].push(l)
-  	end  	  	
-  end  
+  	@libraries = RaLibrary.find(:all, :order =&gt; &quot;name ASC&quot;, :group =&gt; &quot;name&quot;)  	
+  end
   
   # Display the history for a container
   def history
     get_container(@params[:type])
   end
   
+  # show which files contain which parts of a class
+  def file_contents
+    name = @params[:container]
+    type = @params[:type]
+    
+    # get the container
+    @ra_container = RaContainer.find_by_full_name(name)
+          
+    # get all of the code objects and methods that have this container as a parent
+    code_obj = RaCodeObject.find(:all, :conditions =&gt; [&quot;ra_container_id = ?&quot;, @ra_container.id], :order =&gt; &quot;name ASC&quot;)    
+    
+    # Get all the methods in this container
+    code_obj += RaMethod.find(:all, :conditions =&gt; [&quot;ra_container_id = ? AND visibility = ?&quot;, @ra_container.id, RaContainer::VIS_PUBLIC], :order =&gt; &quot;name ASC&quot;)
+       
+    # Get the other containers that this container is parent of
+    code_obj += RaContainer.find(:all, :conditions =&gt; [&quot;parent_id = ?&quot;, @ra_container.id], :order =&gt; &quot;full_name ASC&quot;)
+           
+    # group everything by file
+    @file_contents = {}
+        
+    for obj in code_obj
+      unless @file_contents.has_key?(obj.file_id)
+        @file_contents[obj.file_id] = {:obj =&gt; RaFile.find_by_id(obj.file_id)}
+      end
+      
+      unless @file_contents[obj.file_id].has_key?(obj.class) then @file_contents[obj.file_id][obj.class] = [] end
+      @file_contents[obj.file_id][obj.class].push(obj)
+    end
+    
+    type = @ra_container.class.type_string
+    @container_url = url_for(:action =&gt; type.pluralize, :container =&gt; @ra_container.full_name)      
+  end
+  
   ###########################
   ### START protected methods
   ###########################
   protected  
+ 
+  # display the home page for a library
+  def get_library(lib_name, version)
+    @library = RaLibrary.find_by_name(lib_name)
+    get_list(lib_name, params[:type], version)
+    
+    # if the library has a main_container_id set then use the description from
+    # that container for the home page, otherwise use one of the shorter descriptions
+    if(@library.main_container_id)
+      main = RaContainer.find_by_id(@library.main_container_id)
+      @description = main.ra_comment.comment
+    elsif(@library.long_description)
+      @description = @library.long_description
+    elsif(@library.short_description)
+      @description = @library.short_description
+    end
+  end 
+ 
+  # display a method
+  def method(lib_name, container_name, version, method)
+    @ra_container = RaContainer.find_highest_version(container_name, version)
+    @method = RaMethod.find(:first, :include =&gt; :ra_comment, :conditions =&gt; [&quot;ra_container_id = ? AND name = ?&quot;, @ra_container.id, method])
+    @source_code = RaSourceCode.find(@method.ra_source_code_id).source_code
+    @page_title = RANNOTATE_SITE_NAME + &quot; &quot; + @ra_container.full_name + &quot;-&quot; + @method.name
+    @container_url = &quot;&quot; # get_doc_url(lib_name, container_name, version, method)
+  end 
   
-  # get a list of entries to display for the left sidevar
-  def get_list(type = 'classes', library = nil, version = nil)
-    # Get what should be displayed in the left sidebar
+  # get a list of entries to display for the list pages
+  def get_list(library, type = 'classes', version = nil)
     case type
-      when 'files'
-        @list = RaContainer.find_all_highest_version([RaFile.to_s], library, version)           
+      when 'files'      
+        @list = RaContainer.find_all_highest_version([RaFile.to_s], library, version)      
       when 'methods'
         @list = RaMethod.find_all_highest_version()
       else
        	@list = RaContainer.find_all_highest_version([RaClass.to_s, RaModule.to_s], library, version)
-    end
-    @version = version
-    @library = library
-    @type = type
-    
-    if(type == 'files')
-      render :action =&gt; 'list_files'
-    end
+    end    
   end
   
   # Get a container (file,class, module) and everything necessary to display it's documentation
-  def get_container(cont_type)
-    @container_name = @params[:name]
-    @version = @params[:version] # this can be nil if the most recent version is requested
+  def get_container(lib_name, container_name, version)
+    @container_name = container_name
+    @library = lib_name
+    @version = version # this can be nil if the most recent version is requested
     @expand = @params[:expand]
-    @ra_container = RaContainer.find_highest_version(@container_name, cont_type, @version)   
+    @ra_container = RaContainer.find_highest_version(@container_name, lib_name, @version)
     unless(@ra_container)
     	@error = &quot;Could not find: &quot; + @container_name
     	return
@@ -150,10 +173,10 @@ class DocController &lt; ApplicationController
     @page_title = RANNOTATE_SITE_NAME + &quot; &quot; + @container_name      
                 
     # Get all the methods in this container (and join with their comments)
-    methods = RaMethod.find(:all, :include =&gt; :ra_comment, :conditions =&gt; [&quot;ra_container_id = ?&quot;, @ra_container.id], :order =&gt; &quot;name ASC&quot;)
+    methods = RaMethod.find(:all, :include =&gt; [:ra_comment, :file_container], :conditions =&gt; [&quot;ra_container_id = ?&quot;, @ra_container.id], :order =&gt; &quot;ra_methods.name ASC&quot;)
       
     # Divide up the methods into public/protected and class/instance
-	@ra_methods = {}      
+    @ra_methods = {}      
     methods.each do |method|
         # Don't display private methods
         if(method.visibility.to_i == RaContainer::VIS_PRIVATE) then next end
@@ -167,6 +190,7 @@ class DocController &lt; ApplicationController
     @ra_visibilities = ['Public Class', 'Public Instance', 'Protected Class', 'Protected Instance', 'Private Class', 'Private Instance']    
             
     # Get all of the other code objects that this container contains
+    # join with the file_id so that we can display the files the code objects were defined in
     results = RaCodeObject.find(:all, :conditions =&gt; [&quot;ra_container_id = ?&quot;, @ra_container.id], :order =&gt; &quot;name ASC&quot;)
     
     # Divide up the code objects into the various types
@@ -191,13 +215,9 @@ class DocController &lt; ApplicationController
     end
 
     @container_type = @ra_container.class.type_string                         
-    @container_url = url_for(:action =&gt; @ra_container.class.type_string.pluralize, :name =&gt; @container_name)                      
+    @container_url = &quot;&quot; # get_doc_url(lib_name, container_name, version, method)            
   end       
-  
-#  def get_special_docs()
-#    container = RaContainer.find_highest_version(&quot;README OR CHANGELOG OR LICENSE&quot;)
-#  end
-  
+    
   # execute a search and return the results
   # results are put in the @search_results class variable and @result_count contains the total result count
   # if something goes wrong then the class variable @error contains the error message
@@ -220,20 +240,20 @@ class DocController &lt; ApplicationController
     end
     
     temp = RaContainer.find(:all, :limit =&gt; 100, 
-    	:conditions =&gt; [&quot;LOWER(rc.full_name) LIKE ? AND rl.id = rc.ra_library_id AND rl.current = ?&quot;, name, true], 
+    	:conditions =&gt; [&quot;LOWER(rc.full_name) LIKE ? AND rl.id = rc.ra_library_id AND rl.current = ?&quot;, name, true],
     	:select =&gt; 'rc.*',
     	:joins =&gt; &quot;rc, ra_libraries AS rl&quot;,
-    	:order =&gt; 'rc.full_name ASC'    	
+    	:order =&gt; 'rc.full_name ASC'
     )
     
-    temp.push(RaMethod.find(:all, :limit =&gt; 100, 
-    	:conditions =&gt; [&quot;LOWER(ram.name) LIKE ? AND ram.ra_container_id = rc.id AND rc.ra_library_id = rl.id AND rl.current = ?&quot;, name, true], 
+    temp.push(RaMethod.find(:all, :limit =&gt; 100,
+    	:conditions =&gt; [&quot;LOWER(ram.name) LIKE ? AND ram.ra_container_id = rc.id AND rc.ra_library_id = rl.id AND rl.current = ?&quot;, name, true],
     	:joins =&gt; 'ram, ra_containers AS rc, ra_libraries AS rl',
     	:select =&gt; 'ram.*, rc.full_name AS container_name, rc.type AS container_type',
     	:order =&gt; 'ram.name ASC'
     	)
     )
-    temp.push(RaCodeObject.find(:all, :limit =&gt; 100, 
+    temp.push(RaCodeObject.find(:all, :limit =&gt; 100,
     	:conditions =&gt; [&quot;LOWER(rco.name) LIKE ? AND rco.type IN('RaConstant', 'RaMethod', 'RaAttribute') AND rco.ra_container_id = rc.id AND rc.ra_library_id = rl.id AND rl.current = ?&quot;, name, true],
     	:joins =&gt; 'rco, ra_containers AS rc, ra_libraries AS rl',
     	:select =&gt; 'rco.*, rc.full_name AS container_name, rc.type AS container_type',</diff>
      <filename>app/controllers/doc_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,7 @@ class HistoryController &lt; ApplicationController
     # Get all versions of this container
     container_versions = RaContainer.find(:all, :include =&gt; [:ra_comment, :ra_library], 
     	:conditions =&gt; [&quot;full_name = ? AND type = ?&quot;, @container_name, type],
-    	:order =&gt; &quot;version ASC&quot;)
+    	:order =&gt; &quot;version ASC&quot;)    
     	
     unless(container_versions &amp;&amp; container_versions.length &gt; 0)
     	@error = &quot;Could not find: &quot; + type + &quot; &quot; + @container_name + &quot; for history&quot;</diff>
      <filename>app/controllers/history_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 class NotesController &lt; ApplicationController
     
-  # cache_sweeper :note_sweeper, :only =&gt; [:create]
+  cache_sweeper :note_sweeper, :only =&gt; [:preview]
   caches_page :list_new
 	
   # Display a list of notes
@@ -43,13 +43,13 @@ class NotesController &lt; ApplicationController
     @note.skip_ban_validation = true
     @note.valid?
 		
-	if @params['create'] &amp;&amp; @note.errors.empty?
+	  if @params['create'] &amp;&amp; @note.errors.empty?
       create
-	end
+	  end
   end
 
   # Save the note to the DB
-  def create  
+  def create
     note_params = get_note_params(params[:note][:ref_id], params[:note][:ref_type])
     
     @note = Note.new(note_params.merge(params[:note]))
@@ -57,11 +57,16 @@ class NotesController &lt; ApplicationController
     if !@note.save
       render :action =&gt; 'preview'
     else
-      NoteSweeper.expire_cache(self, @note)            
+      send_note_edit_email(@note)      
       render :action =&gt; 'success'
     end
   end
   
+  # Send an email
+  def send_note_edit_email
+    
+  end
+  
   # Save a vote for a note and then show the success page if it was a success
   def vote
     ip = request.remote_ip;
@@ -126,7 +131,6 @@ private
 	   when RaAlias.to_s then return get_codeobj_params(id, type_string)
 	   when &quot;index&quot; then return get_index_params()
       end
-
       return {}
    end
    </diff>
      <filename>app/controllers/notes_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,38 +1,15 @@
 # Methods added to this helper will be available to all templates in the application.
 module ApplicationHelper
     
-    # limit the length of some text and add .. if it becomes too long
-    def limit_length(text, max_length)
-      if(text == nil)
-        return nil
-      end
-      
-      if(text.length &gt; max_length)
-        return text[0,max_length] + &quot;..&quot;
-      end
-      
-      return text
-    end
-
-    
-	# Display errors in a nicely formatted box
-	def display_errors_for(object_name, options = {})
-		options = options.symbolize_keys
-		object = instance_variable_get(&quot;@#{object_name}&quot;)
-	
-		unless object.errors.empty?
-			content_tag(&quot;div&quot;,			
-				content_tag(&quot;p&quot;, &quot;There were problems with the following fields:&quot;) +
-				content_tag(&quot;ul&quot;, object.errors.full_messages.collect { |msg| content_tag(&quot;li&quot;, msg) }),
-					&quot;id&quot; =&gt; options[:id] || &quot;errorExplanation&quot;, &quot;class&quot; =&gt; options[:class] || &quot;errorExplanation&quot;
-			)
-		end		
-	end
+  def link_to_library(lib)
+    link_params = {:controller =&gt; 'doc', :action =&gt; 'container', :lib_name =&gt; lib.name, :container =&gt; nil}
+    return link_to(lib.name, link_params)
+  end
   
   # Given the name and type of a container (type = class,file, etc..)
   # link to that type
   def link_to_container_by_name(type, name)      
-    link_params = {:controller =&gt; &quot;doc&quot;, :action=&gt; type.pluralize, :name =&gt; name}
+    link_params = {:controller =&gt; 'doc', :action=&gt;'container', :container =&gt; name}
     if(@version)
       link_params[:version] = @version
     end    
@@ -50,7 +27,7 @@ module ApplicationHelper
   def link_to_container(ra_container, max_length = 300)
     action = ra_container.class.type_string.pluralize
     
-    link_params = {:controller =&gt; &quot;doc&quot;, :action =&gt; action, :name =&gt; ra_container.full_name}
+    link_params = {:controller =&gt; 'doc', :action =&gt; 'container', :lib_name =&gt; ra_container.ra_library.name, :container =&gt; ra_container.full_name}
     if(@version)
       link_params[:version] = @version
     end
@@ -67,16 +44,14 @@ module ApplicationHelper
   # If this is a child of a container object (method, constant etc.) then link to it's container
   def link_to_container_child(child)    
    	container_name = child.container_name
-    container_type = child.container_type
     
     # If we haven't done a database join to pre-retrieve these values then we get them here
     # this could involve another DB query if no join with the container table has been done
-    if(container_name == nil || container_type == nil)
+    if(container_name == nil)
     	container_type = child.ra_container.class.to_s
-    	container_name = child.ra_container.full_name
     end
    
-    link_params = {:controller =&gt; 'doc', :action =&gt; RaContainer.type_to_route(container_type), :name =&gt; container_name }
+    link_params = {:controller =&gt; 'doc', :lib_name =&gt; child.ra_library.name, :container =&gt; container_name }
     if(@version)
       link_params[:version] = @version
     end
@@ -92,17 +67,58 @@ module ApplicationHelper
        
   end
   
-  def link_to_method(method_name, container_type)
-    link_params = {:controller =&gt; 'doc', :action =&gt; container_type.pluralize, :method =&gt; method_name}
+  def link_to_method(method, container, title = nil)
+    route = RaContainer.type_to_route(container.class.to_s)
+    link_params = {:controller =&gt; 'doc', :action =&gt; 'container', :lib_name =&gt; container.ra_library.name, :container =&gt; container.full_name, :method =&gt; method.name}
+    other_params = {}
+    
+    if(title != nil)
+      other_params[:title] = title
+    end
+    
     if(@version)
       link_params[:version] = @version
     end
-    link_to(method_name, link_params)  
+    
+    link_to(method.name, link_params, other_params)  
   end
   
   # get the current library version
   def get_current_version()
     return RaLibrary.find(:first, :conditions =&gt; [&quot;current = ?&quot;, true])
   end
+
+    def get_all_libs()
+       RaLibrary.find(:all, :conditions =&gt; [&quot;current = ?&quot;, true], :order =&gt; &quot;name ASC&quot;)
+    end
+    
+    # limit the length of some text and add .. if it becomes too long
+    def limit_length(text, max_length)
+      if(text == nil)
+        return nil
+      end
+      
+      if(text.length &gt; max_length)
+        return text[0,max_length] + &quot;..&quot;
+      end
+      
+      return text
+    end
+
+    
+	# Display errors in a nicely formatted box
+	def display_errors_for(object_name, options = {})
+		options = options.symbolize_keys
+		object = instance_variable_get(&quot;@#{object_name}&quot;)
+	
+		unless object.errors.empty?
+			content_tag(&quot;div&quot;,			
+				content_tag(&quot;p&quot;, &quot;There were problems with the following fields:&quot;) +
+				content_tag(&quot;ul&quot;, object.errors.full_messages.collect { |msg| content_tag(&quot;li&quot;, msg) }),
+					&quot;id&quot; =&gt; options[:id] || &quot;errorExplanation&quot;, &quot;class&quot; =&gt; options[:class] || &quot;errorExplanation&quot;
+			)
+		end		
+	end
+  
   
 end</diff>
      <filename>app/helpers/application_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,20 +3,33 @@ require 'rdoc/markup/simple_markup/to_html'
 
 module DocHelper
 
-    # return the number of notes in a certain category, or 0 if there are none
-    def get_count(note_count, category)
-      note_count[category] ? note_count[category] : 0
+  # Display the parameters for calling a method
+  def display_method_parameters(method)      
+    if(method.call_seq != nil &amp;&amp; method.call_seq.length &gt; 0)
+      method.call_seq.split(&quot;\n&quot;)
+      return
     end
+    
+    if(method.block_parameters)    
+    end
+    
+    return
+  end
+   
+  # return the number of notes in a certain category, or 0 if there are none
+  def get_count(note_count, category)
+    note_count[category] ? note_count[category] : 0
+  end
 
 	# markup the source code using the syntax helper
-    def markup_source_code(code)
-      begin
-    	  syntax = Syntax::Convertors::HTML.for_syntax &quot;ruby&quot;
-	      return syntax.convert(code)   	  
-      rescue
-        return code
-      end        
-    end
+  def markup_source_code(code)
+    begin
+      syntax = Syntax::Convertors::HTML.for_syntax &quot;ruby&quot;
+	    return syntax.convert(code)   	  
+    rescue
+      return &quot;&lt;pre&gt;&quot; + code + &quot;&lt;/pre&gt;&quot;
+    end        
+  end
 
 	# show a link to display the source code for a method
     def show_source_link(method_id, source_id)      
@@ -96,26 +109,23 @@ module DocHelper
     end
 
 		# Markup the rdoc comments for display
-    def markup(str, remove_para=false)
+    def markup_rdoc(str, remove_para=false)
       return '' unless str
 
-#      unless defined? @markup # only define the markup object once
+      unless defined? @markup # only define the markup object once
         @markup = SM::SimpleMarkup.new
         
-        # TODO: This does not work, previously it depended on us being able to check if something was defined before we would link it
-        # here though it is too expensive to do that for each entry as it would involve a DB lookup
-        # instead we should do it at the time we are generating the inserts into the DB and place special
-        # markers around those things to be hyperlinked
-        
-        # class names, variable names, file names, or instance variables
-        
-#        @markup.add_special(/(
+        # class names, variable names, file names, or instance variables        
+        @markup.add_special(/(\#\w+[!?=]?
+                             | \b([A-Z]\w+::\w+)
+                             )/x, :CROSSREF)
+
+# TODO: Some of these crossreferences are very expensive
+# for some of them we need to do searches for each match to see if it exists
+# with page links this is not so bad, but with other things it could be epxensive
+# at doc generation time we should use a hashtable to speed this up
 #                             \b([A-Z]\w*(::\w+)*[.\#]\w+)  #    A::B.meth
-#                             | \b([A-Z]\w+(::\w+)*)       #    A::B..
-#                              \#\w+[!?=]?                #    #meth_name 
 #                             | \b\w+([_\/\.]+\w+)+[!?=]?  #    meth_name
-#                             )/x, 
-#                            :CROSSREF)
 
         # external hyperlinks
         # @markup.add_special(/((link\.)\S+\w)/, :HYPERLINK)
@@ -123,18 +133,19 @@ module DocHelper
 
         # and links of the form  &lt;text&gt;[&lt;url&gt;]
         @markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK)
-#      end
+      end
 
-#      unless defined? @html_formatter
+      unless defined? @html_formatter
         @html_formatter = Hyperlinker.new(self)
-#      end
+      end
 
-      # Convert leading comment markers to spaces, but only if all non-blank lines have them
-      if str =~ /^(?&gt;\s*)[^\#]/
+     # Remove leading comment markers if all blank lines have them
+     if str =~ /^(?&gt;\s*)[^\#]/
         content = str
-      else
-        content = str.gsub(/^\s*(#+)/)  { $1.tr('#',' ') }
-      end
+     else
+        content = str.gsub(/^\s*#+/, '')
+        content.gsub!(/^ /, '')
+     end
 
       res = @markup.convert(content, @html_formatter)
       if remove_para
@@ -155,17 +166,17 @@ module DocHelper
 
 	# We're invoked when any text matches the CROSSREF pattern
 	# (defined in MarkUp). If we fine the corresponding reference,
-  	# generate a hyperlink.
-  	def handle_special_CROSSREF(special)
-  	  name = special.text
-      if name[0,1] == '#'
-        name = name[1..-1]
-      end
+  # generate a hyperlink.
+  def handle_special_CROSSREF(special)  	    	  
+    name = special.text  	  
+    if name[0,1] == '#'
+      name = name[1..-1]
+    end
 
-  	  if /([A-Z].*)[.\#](.*)/ =~ name
-	    ref = @dochelper.link_to(name, {:controller =&gt; 'doc', :action =&gt; 'search', :name =&gt; $1})
+ 	  if /([A-Z].*)[.\#](.*)/ =~ name
+	    ref = @dochelper.link_to(name, {:controller =&gt; 'doc', :action =&gt; 'search', :name =&gt; $1, :exact =&gt; 1})
 	  else
-  	    ref = @dochelper.link_to(name, {:controller =&gt; 'doc', :action =&gt; 'search', :name =&gt; name})
+  	  ref = @dochelper.link_to(name, {:controller =&gt; 'doc', :action =&gt; 'search', :name =&gt; name, :exact =&gt; 1})
 	  end
 	  ref
 	end</diff>
      <filename>app/helpers/doc_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,8 +23,8 @@ module NotesHelper
 	def get_return_url(note)
 	  container_type = note.get_container().class.to_s
       container = RaContainer.type_to_route(container_type)
-      container_params = {:controller =&gt; 'doc', :action =&gt; container, :name =&gt; note.container_name, :anchor =&gt; 'note_' + note.id.to_s}
-      code_obj_params = {:controller =&gt; 'doc', :action =&gt; 'container', :type =&gt; container_type, :name =&gt; note.container_name}
+      container_params = {:controller =&gt; 'doc', :action =&gt; container, :container =&gt; note.container_name, :anchor =&gt; 'note_' + note.id.to_s}
+      code_obj_params = {:controller =&gt; 'doc', :action =&gt; 'container', :type =&gt; container_type, :container =&gt; note.container_name}
       
       case note.note_type
 	    when RaModule.to_s then return url_for(container_params)
@@ -58,18 +58,15 @@ module NotesHelper
 				text += &quot; ... &quot;
 			end
 		end
-			
-		# Extract anything between &lt;ruby&gt;&lt;/ruby&gt; tags and syntax highlight it
-		syntax = Syntax::Convertors::HTML.for_syntax &quot;ruby&quot;
-		
-		# To prevent the ruby code from being mangled by the rest of the text substitutions
-		# we save it in an instance variable and then re-add it later
-		@rubycode = []
-		text.gsub!(/&lt;ruby&gt;(.*?)&lt;\/ruby&gt;/m ) { @rubycode.push($1); &quot;!CODE_EXTRACT!&quot; }					
-					
+				
 		# Kill all HTML elements
 		text.gsub!(/&lt;/,&quot;&amp;lt;&quot;)
 		text.gsub!(/&gt;/,&quot;&amp;gt;&quot;)		
+		
+		# To prevent the ruby code from being mangled by the rest of the text substitutions
+		# we save it in an instance variable and then re-add it later
+		@rubycode = []		
+		text.gsub!(/&lt;ruby&gt;(.*?)&lt;\/ruby&gt;/m ) { @rubycode.push($1); &quot;!CODE_EXTRACT!&quot; }										
 	
 		# Take care of newlines
 		text.gsub!(/(\r\n|\n|\r)/, &quot;\n&quot;) # lets make them newlines crossplatform
@@ -77,10 +74,14 @@ module NotesHelper
 		text.gsub!(/([^\n])(\n)([^\n])/, '\1\2&lt;br/&gt;\3') # turn single newline into &lt;br /&gt;		
 		text.gsub!(/\n\n/, &quot;&lt;br/&gt;&lt;br/&gt;\n&quot;) # turn two newlines into paragraph
 		
+		# Extract anything between &lt;ruby&gt;&lt;/ruby&gt; tags and syntax highlight it
+		syntax = Syntax::Convertors::HTML.for_syntax &quot;ruby&quot;
+				
 		# Now place back in the ruby code that we extracted
+		@rubycode.reverse!()
 		text.gsub!(/!CODE_EXTRACT!/) { syntax.convert(@rubycode.pop()) }
 
-		# auto link any links	
+		# auto link any links	 
 		text = auto_link(text, :all, :rel =&gt; &quot;nofollow&quot;, :target=&gt; &quot;_blank&quot;)
 		return text
 	end</diff>
      <filename>app/helpers/notes_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,5 @@
-# TODO: this sweeper is not working.. url_for is not working inside the expire_page method
-# TODO: so I added the expire code directly inside the notes controller
 class NoteSweeper &lt; ActionController::Caching::Sweeper
-#  observe Note
+  observe Note
   
   def after_save(note)
     expire_cache(note)
@@ -11,55 +9,17 @@ class NoteSweeper &lt; ActionController::Caching::Sweeper
     expire_cache(note)
   end
 
-   # TODO: This should really be a sweeper, but it is not working inside my sweeper
-   def self.expire_cache(controller, note)
-      container = RaContainer.type_to_route(note.ra_container.class.to_s)      
-      
-      if(note.note_type == &quot;index&quot;)
-        page_params = {:controller =&gt; 'doc', :action =&gt; &quot;index&quot;}
-        controller.expire_page(page_params)        
-      elsif(note.note_type == &quot;RaMethod&quot;)
-        page_params = {:controller =&gt; 'doc', :action =&gt; container, :name =&gt; note.container_name }      
-        
-        # Expire the container page
-        controller.expire_page(page_params)
-        
-        # expire the container with version page
-        versioned = page_params.merge({:version =&gt; note.version})
-        controller.expire_page(versioned)
-        
-        # Expire the method page
-        method = page_params.merge({:method =&gt; note.note_group})
-        controller.expire_page(method)
-        
-        # Expire the method with version page
-        method_versioned = method.merge({:version =&gt; note.note_group})
-        controller.expire_page(method_versioned)        
-      else   
-         page_params = {:controller =&gt; 'doc', :action =&gt; container, :name =&gt; note.container_name }           
-         # expire the container page
-         controller.expire_page(page_params)
-             
-         # expire the container with version page
-         versioned = page_params.merge({:version =&gt; note.version})
-         controller.expire_page(versioned)       
-      end
-      
-      # expire the RSS page
-      controller.expire_page(:controller =&gt; 'notes', :action =&gt; 'rss')
-
-      # expire the newest notes page
-      controller.expire_page(:controller =&gt; 'notes', :action =&gt; 'list_new')                
-  end
-
 private
   
+  # TODO: Expire the following
+  # :index, :container, :library, :list, :libraries
+  
   def expire_cache(note)
-      container = RaContainer.type_to_route(note.ra_container.class.to_s)      
+       container = RaContainer.type_to_route(note.ra_container.class.to_s)      
       
       if(note.note_type == &quot;index&quot;)
         page_params = {:controller =&gt; 'doc', :action =&gt; &quot;index&quot;}
-        expire_page(page_params)        
+        expire_page(page_params)  
       elsif(note.note_type == &quot;RaMethod&quot;)
         page_params = {:controller =&gt; 'doc', :action =&gt; container, :name =&gt; note.container_name }      
         
@@ -85,7 +45,13 @@ private
          # expire the container with version page
          versioned = page_params.merge({:version =&gt; note.version})
          expire_page(versioned)       
-      end            
+      end
+      
+      # expire the RSS page
+      expire_page(:controller =&gt; 'notes', :action =&gt; 'rss')
+
+      # expire the newest notes page
+      expire_page(:controller =&gt; 'notes', :action =&gt; 'list_new')  
   end
   
   </diff>
      <filename>app/models/note_sweeper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,14 +30,13 @@ class RaContainer &lt; ActiveRecord::Base
    	end    			  		
   end
   
-  def RaContainer.find_highest_version(full_name, type, library = nil)  
-    if(library == nil)  
+  def RaContainer.find_highest_version(full_name, library_name = nil, version = nil)  
+    if(library_name == nil)  
       result = RaContainer.find_by_sql([&quot;SELECT rc.* FROM ra_containers AS rc, ra_libraries AS rl WHERE &quot; +
-        &quot;full_name = ? AND type = ? AND ra_library_id = rl.id AND rl.current = ? ORDER BY full_name ASC&quot;, full_name, type, true])
+        &quot;full_name = ? AND ra_library_id = rl.id AND rl.current = ? ORDER BY full_name ASC&quot;, full_name, true])
     else
-      version = RaLibrary.ver_string_to_int(library)
       result = RaContainer.find_by_sql([&quot;SELECT rc.* FROM ra_containers AS rc, ra_libraries AS rl WHERE &quot; +
-        &quot;full_name = ? AND type = ? AND ra_library_id = rl.id AND rl.version = ? ORDER BY full_name ASC&quot;, full_name, type, version])    
+        &quot;full_name = ? AND ra_library_id = rl.id AND rl.name = ? ORDER BY full_name ASC&quot;, full_name, library_name])    
     end
     
     if(result)</diff>
      <filename>app/models/ra_container.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,7 +33,7 @@ class RaLibrary &lt; ActiveRecord::Base
 	
 	# A helper method to find the a library when you have the name and release information
 	def find_lib
-	    return RaLibrary.find(:first, :conditions =&gt; [&quot;name = ? AND major = ? AND minor = ? AND `release` = ?&quot;, name, major, minor, release]) 
+    return RaLibrary.find(:first, :conditions =&gt; [&quot;name = ? AND major = ? AND minor = ? AND `release` = ?&quot;, name, major, minor, release])
 	end
 	
 	# on create checks to see if a library with this version and name exists already</diff>
      <filename>app/models/ra_library.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 class RaMethod &lt; ActiveRecord::Base
   belongs_to :ra_container
   belongs_to :ra_comment 
+  belongs_to :file_container, :foreign_key =&gt; 'file_id', :class_name =&gt; 'RaFile'
   
   def RaMethod.type_string
   	'method'
@@ -12,17 +13,29 @@ class RaMethod &lt; ActiveRecord::Base
 
   def container_type
     @attributes['container_type']
-  end 
+  end
+  
+  # this is a helper method for getting the library that a method is in
+  # uses the piggybacked variable if available
+  def ra_library   
+    if(ra_library_name != nil)
+      # when listing methods this helper checks to see if we already have the name of the library
+      return RaLibrary.new({:name =&gt; ra_library_name})
+    else
+      return ra_container.ra_library
+    end
+  end
   
   def container?
   	return false
   end
   
   def RaMethod.find_all_highest_version()
-	RaMethod.find_by_sql(&quot;SELECT rm.*, rc.full_name AS container_name, rc.type AS container_type FROM ra_methods AS rm, ra_containers AS rc, ra_libraries AS rl &quot; +
-		&quot;WHERE rm.ra_container_id = rc.id AND rc.ra_library_id = rl.id AND rl.current = 1 &quot; +
-		&quot;ORDER BY rm.name ASC&quot;
-	)
+    # TODO: Another find_by_sql that needs to be Active Recordized
+	  RaMethod.find_by_sql(&quot;SELECT rm.*, rc.full_name AS container_name, rc.type AS container_type, rl.name AS ra_library_name FROM ra_methods AS rm, ra_containers AS rc, ra_libraries AS rl &quot; +
+		  &quot;WHERE rm.ra_container_id = rc.id AND rc.ra_library_id = rl.id AND rl.current = 1 &quot; +
+		  &quot;ORDER BY rm.name ASC&quot;
+	  )
   end
   
   # Get a string with the visibility of this method Public Instance / Private Instance etc.</diff>
      <filename>app/models/ra_method.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,30 +1,40 @@
-&lt;% if @error %&gt;
-Error: &lt;%= @error %&gt;&lt;p&gt;
-&lt;% end %&gt;
+&lt;% if(@success) %&gt;
 
-&lt;% if @library %&gt;
-&lt;% display_errors_for 'library' %&gt;
-&lt;% end %&gt;
+ &lt;% if @total_count %&gt;
+ &lt;br/&gt;Successfully uploaded &lt;%= @total_count %&gt; records
+ &lt;p&gt; 
+ &lt;% end %&gt;
 
+&lt;% for value in @success %&gt;
+&lt;%= value %&gt;&lt;br/&gt;
+&lt;% end 
+ end %&gt;
+&lt;p&gt;
 &lt;b&gt;Import documentation&lt;/b&gt;
 &lt;p&gt;
 &lt;%= form_tag({:action=&gt;'import'}, :multipart =&gt; true)%&gt;
- Select file: &lt;input type=&quot;file&quot; name=&quot;doc_file&quot; /&gt;&lt;br/&gt;  
- &lt;input type=&quot;submit&quot; value=&quot;Upload&quot; /&gt;
- 
- &lt;% if @total_time %&gt;
- &lt;p&gt;Successfully uploaded &lt;%= @total_count %&gt; records in &lt;%= @total_time %&gt; seconds
- &lt;% end %&gt;
+ Select file: &lt;input type=&quot;file&quot; name=&quot;doc_file&quot; /&gt; &lt;input type=&quot;submit&quot; value=&quot;Upload&quot; /&gt;
 &lt;/form&gt;
 &lt;p&gt;
+or
+&lt;br/&gt;
+&lt;%= form_tag({:action=&gt;'mass_import'}, :multipart =&gt; true)%&gt;
+ Enter directory: &lt;input type=&quot;text&quot; name=&quot;directory&quot; /&gt; &lt;input type=&quot;submit&quot; value=&quot;Upload&quot; /&gt;
+ &lt;input type=&quot;hidden&quot; name=&quot;ignore&quot; value=&quot;true&quot; /&gt;
+&lt;/form&gt;
+&lt;p&gt;
+Note if you enter a directory then Rannotate will attempt to import *.out from that directory. The
+directory also has to be a directory on the server where Rannotate is running (not your computer.)
+&lt;p&gt;
 &lt;b&gt;Generating Documentation&lt;/b&gt;&lt;br/&gt;
 Documentation is generated for Rannotate by the custom rannotate rdoc generator.
 &lt;br/&gt;&lt;br/&gt;
-1. Copy all files and directories from the &lt;i&gt;rdoc_extension&lt;/i&gt; directory into your
+1. Copy the &lt;i&gt;yaml_generator.rb&lt;/i&gt; from the &lt;i&gt;rdoc_extension&lt;/i&gt; directory into your
 &lt;i&gt;[ruby]/lib/ruby/1.8/rdoc/generators&lt;/i&gt; directory.
 &lt;br/&gt;&lt;br/&gt;
 2. Command line to generate documentation:&lt;br/&gt;
 &lt;i&gt;rdoc --fmt=yaml --opname=activerecord-1.1.13 directory&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;
 The last parameter is the name of the directory to process&lt;br/&gt;
 fmt = Which RDoc generator to use&lt;br/&gt;
-opname = What is the name of the output file (the output file will be put in doc/[name].out)
\ No newline at end of file
+opname = What is the name of the output file (the output file will be put in doc/[name].out)
+&lt;br/&gt;&lt;br/&gt;
\ No newline at end of file</diff>
      <filename>app/views/admin/upload/create.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,18 @@
 &lt;%= form_tag :action =&gt; 'delete' %&gt;
+&lt;b&gt;Libraries:&lt;/b&gt;&lt;p&gt;
+&lt;table&gt;
 &lt;% @libraries.each do |name,ver_array| %&gt;
-Library - &lt;%= name.capitalize %&gt;&lt;br/&gt;
+&lt;tr&gt;&lt;td&gt;
+&lt;%= name.capitalize %&gt; [edit]
+&lt;/td&gt;
+&lt;td&gt;
 &lt;% ver_array.each do |ver| %&gt;
 &lt;%= check_box :id, ver.id %&gt; &lt;%= ver.current ? &quot;* &quot; : &quot;&quot; %&gt;ver &lt;%= ver.ver_string %&gt;&lt;br/&gt;
 &lt;% end %&gt;
-&lt;br/&gt;
+&lt;/td&gt;
+&lt;/tr&gt;
 &lt;% end %&gt;
+&lt;/table&gt;
 &lt;%= submit_tag &quot;Delete selected libraries&quot; %&gt;
 &lt;%= end_form_tag %&gt;
 * - This is the default library and version that is displayed when you are browsing the site.
\ No newline at end of file</diff>
      <filename>app/views/admin/upload/list.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -11,12 +11,12 @@
 &lt;br/&gt;
 [ &lt;a href=&quot;#notessec&quot;&gt;&lt;%= pluralize(get_count(@note_count, @ra_container.class.to_s), &quot;Note&quot;) %&gt;&lt;/a&gt; ]
 [ &lt;%= link_to 'History', {:action =&gt; 'history', :name =&gt; @container_name, :type =&gt; @ra_container.class.to_s } %&gt; ]
+[ &lt;%= link_to 'Show Files', {:action =&gt; 'file_contents', :container =&gt; @container_name, :type =&gt; @ra_container.class.to_s } %&gt; ]
 
 &lt;% if(@ra_container.ra_comment.comment.length &gt; 0) %&gt;
-&lt;div class=&quot;section_title&quot; onClick=&quot;&lt;%= show_or_hide(&quot;comment&quot;) %&gt;&quot;&gt;Comments&lt;/div&gt;
-&lt;div class=&quot;comment&quot; id=&quot;comment&quot;&gt;&lt;%= markup(@ra_container.ra_comment.comment) %&gt;&lt;/div&gt;
+&lt;div class=&quot;section_title&quot; onClick=&quot;&lt;%= show_or_hide(&quot;comment&quot;) %&gt;&quot;&gt;&lt;%= @ra_container.class.type_string.capitalize %&gt; Description&lt;/div&gt;
+&lt;div class=&quot;comment&quot; id=&quot;comment&quot;&gt;&lt;%= markup_rdoc(@ra_container.ra_comment.comment) %&gt;&lt;/div&gt;
 &lt;% end %&gt;
-&lt;% if(@ra_in_files.length &gt; 0) %&gt;&lt;%= render :partial =&gt; 'doc/partials/in_file' %&gt;&lt;% end %&gt;
 &lt;% if(@ra_code_objects[RaRequire]) %&gt;&lt;%= render :partial =&gt; 'doc/partials/require' %&gt;&lt;% end %&gt;
 &lt;% if(@ra_code_objects[RaInclude]) %&gt;&lt;%= render :partial =&gt; 'doc/partials/include' %&gt;&lt;% end %&gt;     
 &lt;% if(@ra_code_objects[RaConstant]) %&gt;&lt;%= render :partial =&gt; 'doc/partials/constant' %&gt;&lt;% end %&gt;</diff>
      <filename>app/views/doc/container.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -3,19 +3,16 @@
 &lt;/div&gt;
 
 &lt;div id=&quot;body_content_wide&quot; style=&quot;padding-left: 10px;&quot;&gt;
-&lt;div style=&quot;font-size: 110%&quot;&gt;
-&lt;% @libraries.each do |name,ver_array| %&gt;
-&lt;h2&gt;Library - &lt;%= name.capitalize %&gt;
-&lt;span style=&quot;font-size: 80%&quot;&gt;[&lt;%= link_to 'history', {:controller =&gt; 'history', :action =&gt; :library, :name =&gt; name} %&gt;]&lt;/span&gt;
-&lt;/h2&gt;
-&lt;% ver_array.each do |ver| %&gt;
-ver &lt;%= ver.ver_string %&gt; - [&lt;%= link_to 'files', {:action =&gt; 'list', :type =&gt; 'files', :library =&gt; name, :version =&gt; ver.ver_string} %&gt;] 
-[&lt;%= link_to 'classes', {:action =&gt; 'list', :type =&gt; 'classes', :library =&gt; name, :version =&gt; ver.ver_string} %&gt;] 
-[&lt;%= link_to 'methods', {:action =&gt; 'list', :type =&gt; 'methods', :library =&gt; name, :version =&gt; ver.ver_string} %&gt;]
-&lt;%= ver.current ? &quot;* &quot; : &quot;&quot; %&gt;&lt;br/&gt;
+&lt;h2&gt;Libraries&lt;/h2&gt;
+&lt;table&gt;
+&lt;tr style=&quot;font-size: 70%&quot;&gt;
+&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;
+&lt;td&gt;&lt;b&gt;Description&lt;b&gt;&lt;/td&gt;
+&lt;/tr&gt;
+&lt;% @libraries.each do |library| %&gt;
+&lt;tr style=&quot;font-size: 70%&quot;&gt;
+&lt;td&gt;&lt;%= link_to_library(library) %&gt;&lt;/a&gt; &lt;/td&gt;
+&lt;td&gt;&lt;%= library.short_description %&gt;&lt;/td&gt;
+&lt;/tr&gt;
 &lt;% end %&gt;
-&lt;br/&gt;
-&lt;% end %&gt;
-* - Default library and version that is displayed when you are browsing the site.
-&lt;/div&gt;
-&lt;/div&gt;
+&lt;/div&gt;
\ No newline at end of file</diff>
      <filename>app/views/doc/libraries.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -38,7 +38,7 @@
 &lt;td align=&quot;left&quot;&gt;
 &lt;%     end
      end %&gt;
-&lt;%= link_to_doc(entry) %&gt;&lt;br/&gt;
+&lt;%= link_to_doc(entry) %&gt; &lt;% if(@show_library) %&gt;(&lt;%= entry.ra_library.name %&gt;) &lt;% end %&gt;&lt;br/&gt;
 &lt;% count = count + 1
      # if we crossed a column boundary then output a new column 
      if(count != @list.length &amp;&amp; count % rows_per_col == 0) %&gt;</diff>
      <filename>app/views/doc/list.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -7,11 +7,11 @@
 &lt;span class=&quot;container_header&quot;&gt;&lt;%= @method.name %&gt;&lt;%= @method.parameters %&gt;&lt;/span&gt; &lt;% if(@version) then %&gt;Ver: &lt;%= @version %&gt;&lt;% end %&gt;
 &lt;br/&gt;From: &lt;a href=&quot;&lt;%= @container_url %&gt;&quot;&gt;&lt;%= @container_name %&gt;&lt;/a&gt;
 &lt;% if(@version) then %&gt;Version &lt;%= @version %&gt;&lt;% end %&gt;
+Defined in: &lt;%= link_to_container @method.file_container %&gt;
 
-
-&lt;div class=&quot;section_title&quot; onClick=&quot;&lt;%= show_or_hide(&quot;commentssec&quot;) %&gt;&quot;&gt;Comments&lt;/div&gt;
+&lt;div class=&quot;section_title&quot; onClick=&quot;&lt;%= show_or_hide(&quot;commentssec&quot;) %&gt;&quot;&gt;Method Description&lt;/div&gt;
 &lt;div id=&quot;commentssec&quot; class=&quot;description&quot;&gt;
-&lt;p&gt;&lt;%= markup(@method.ra_comment.comment) %&gt;&lt;/p&gt;
+&lt;p&gt;&lt;%= markup_rdoc(@method.ra_comment.comment) %&gt;&lt;/p&gt;
 &lt;/div&gt;
   
 &lt;div class=&quot;section_title&quot; onClick=&quot;&lt;%= show_or_hide(&quot;sourcesec&quot;) %&gt;&quot;&gt;Sourcecode&lt;/div&gt;
@@ -21,10 +21,11 @@
 
 &lt;a name=&quot;notessec&quot;&gt;&lt;/a&gt;
 &lt;div class=&quot;section_title&quot; onClick=&quot;&lt;%= show_or_hide(&quot;usercommentsec&quot;) %&gt;&quot;&gt;
-&lt;span class=&quot;note_link&quot;&gt;		&lt;%= link_to('Add New Note', {:controller =&gt; 'notes', :action =&gt; 'new', :id =&gt; @method.id, :type =&gt; 'RaMethod'}) %&gt;&lt;/span&gt;
+&lt;span class=&quot;note_link&quot;&gt; &lt;%= link_to('Add New Note', {:controller =&gt; 'notes', :action =&gt; 'new', :id =&gt; @method.id, :type =&gt; 'RaMethod'}) %&gt;&lt;/span&gt;
 User Added Notes
-		&lt;/div&gt;
-		&lt;div id=&quot;usercommentsec&quot;&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;usercommentsec&quot;&gt;
 &lt;%= render_notes(@container_name, @method.name) %&gt;
 &lt;/div&gt;
 </diff>
      <filename>app/views/doc/method.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@
   &lt;tr valign='top'&gt;
     &lt;td class='attr-rw'&gt;[&lt;%= attribute.read_write %&gt;]&lt;/td&gt;
     &lt;td class='attr-name'&gt;&lt;a name=&quot;attr_&lt;%= attribute.name %&gt;&quot;&gt;&lt;/a&gt;&lt;%= attribute.name %&gt;&lt;/td&gt;
-    &lt;td class='attr-desc'&gt;&lt;%= markup(attribute.comment) %&gt;&lt;/td&gt;
+    &lt;td class='attr-desc'&gt;&lt;%= markup_rdoc(attribute.comment) %&gt;&lt;/td&gt;
   &lt;/tr&gt;
   	&lt;% end %&gt;  
 &lt;/table&gt;</diff>
      <filename>app/views/doc/partials/_attribute.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@
   &lt;% if constant.comment &amp;&amp; constant.comment.length &gt; 0 %&gt;
     &lt;tr valign='top'&gt;
       &lt;td&gt;&amp;nbsp;&lt;/td&gt;
-      &lt;td colspan=&quot;2&quot; class=&quot;attr-desc&quot;&gt;&lt;%= markup(constant.comment) %&gt;&lt;/td&gt;
+      &lt;td colspan=&quot;2&quot; class=&quot;attr-desc&quot;&gt;&lt;%= markup_rdoc(constant.comment) %&gt;&lt;/td&gt;
     &lt;/tr&gt;
   &lt;% end %&gt;
 &lt;% end %&gt;</diff>
      <filename>app/views/doc/partials/_constant.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,6 @@
+&lt;h2&gt;Library&lt;/h2&gt;
+Defined in library &lt;%= link_to_library(@ra_container.ra_library) %&gt;
+&lt;br/&gt;&lt;br/&gt;
 &lt;% if @ra_children.length &gt; 0 %&gt;
 &lt;h2&gt;Child Classes and Modules&lt;/h2&gt;
 &lt;% for child in @ra_children %&gt;</diff>
      <filename>app/views/doc/partials/_container_sidebar.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -8,10 +8,10 @@
 &lt;div class=&quot;method&quot;&gt;
   &lt;h2&gt;
   &lt;a name=&quot;&lt;%= method.name %&gt;&quot;&gt;&lt;/a&gt;
-  	&lt;b&gt;&lt;%= link_to_method(method.name, @container_type) %&gt;&lt;/b&gt; &lt;%= method.parameters %&gt;
+  	&lt;b&gt;&lt;%= link_to_method(method, @ra_container, 'Defined In File: ' + method.file_container.full_name) %&gt;&lt;/b&gt; &lt;%= method.parameters %&gt;
   &lt;/h2&gt;
   &lt;div class=&quot;description&quot;&gt;   
-  &lt;%= markup(method.ra_comment.comment) %&gt;
+  &lt;%= markup_rdoc(method.ra_comment.comment) %&gt;
   &lt;/div&gt;
   [ &lt;%= show_source_link(method.id, method.ra_source_code_id) %&gt; ]
   [ &lt;%= show_notes_link(@ra_container.full_name, method.name, method.id, &quot;RaMethod&quot;) %&gt; ]</diff>
      <filename>app/views/doc/partials/_method.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -6,9 +6,9 @@
 &lt;p&gt;
 &lt;h2&gt;Browse Docs&lt;/h2&gt;
 
-[&lt;%= link_to &quot;Classes/Modules&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;classes&quot; %&gt;]&lt;br/&gt;
-[&lt;%= link_to &quot;Methods&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;methods&quot; %&gt;]&lt;br/&gt;
-[&lt;%= link_to &quot;Files&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;files&quot;  %&gt;]&lt;br/&gt;
+[&lt;%= link_to &quot;All Classes/Modules&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;classes&quot; %&gt;]&lt;br/&gt;
+[&lt;%= link_to &quot;All Methods&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;methods&quot; %&gt;]&lt;br/&gt;
+[&lt;%= link_to &quot;All Files&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;files&quot;  %&gt;]&lt;br/&gt;
 [&lt;%= link_to &quot;Libraries&quot;, :controller =&gt; 'doc', :action =&gt; &quot;libraries&quot; %&gt;]&lt;br/&gt;
 &lt;p&gt;
 &lt;h2&gt;Site Links&lt;/h2&gt;
@@ -24,6 +24,12 @@
 &lt;a href=&quot;http://rails.outertrack.com&quot;&gt;Rannotated Rails Docs&lt;/a&gt;&lt;br/&gt;
 &lt;a href=&quot;http://www.conorhunt.com/techblog/&quot;&gt;Rannotate Blog&lt;/a&gt;&lt;/br/&gt;
 &lt;p&gt;
+&lt;h2&gt;Libraries&lt;/h2&gt;
+&lt;% libs = get_all_libs() %&gt;
+&lt;% for lib in libs %&gt;
+&lt;%= link_to_library(lib) %&gt; [&lt;%= lib.ver_string %&gt;]&lt;br/&gt;
+&lt;% end%&gt;
+&lt;p&gt;
 &lt;span style=&quot;font-size: 80%;&quot;&gt;
 This site powered by &lt;a href=&quot;http://rannotate.rubyforge.org&quot;&gt;Rannotate&lt;/a&gt;&lt;br/&gt;
 &lt;/p&gt;
\ No newline at end of file</diff>
      <filename>app/views/doc/partials/_nav_sidebar.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 &lt;div class=&quot;sourcecode&quot;&gt;
 &lt;div class=&quot;ruby&quot;&gt;
-&lt;pre&gt;&lt;%= markup_source_code(@source_code) %&gt;&lt;/pre&gt;
+&lt;%= markup_source_code(@source_code) %&gt;
 &lt;/div&gt;
 &lt;/div&gt;</diff>
      <filename>app/views/doc/partials/_source_code.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -11,9 +11,9 @@
 &lt;div id=&quot;header&quot;&gt;
   &lt;span class=&quot;header_search_links&quot;&gt; 
 		    &lt;%= form_tag :controller =&gt; 'doc', :action =&gt; 'search', :name =&gt; nil %&gt;		
-		    [&lt;%= link_to &quot;Files&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;files&quot;  %&gt;]
-		    [&lt;%= link_to &quot;Classes&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;classes&quot; %&gt;]
-		    [&lt;%= link_to &quot;Methods&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;methods&quot; %&gt;]
+		    [&lt;%= link_to &quot;All Files&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;files&quot;  %&gt;]
+		    [&lt;%= link_to &quot;All Classes&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;classes&quot; %&gt;]
+		    [&lt;%= link_to &quot;All Methods&quot;, :controller =&gt; 'doc', :action =&gt; &quot;list&quot;, :type =&gt; &quot;methods&quot; %&gt;]
 		    [&lt;%= link_to &quot;Libraries&quot;, :controller =&gt; 'doc', :action =&gt; &quot;libraries&quot; %&gt;]
 		    &lt;input type=&quot;text&quot; name=&quot;name&quot; size=&quot;20&quot;/&gt;&amp;nbsp;&lt;%= submit_tag &quot;search&quot; %&gt;
 		    &lt;%= end_form_tag %&gt; </diff>
      <filename>app/views/layouts/doc.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -10,9 +10,9 @@
 &lt;div id=&quot;header&quot;&gt;
   &lt;span class=&quot;header_search_links&quot;&gt; 
 		    &lt;%= form_tag :controller =&gt; 'doc', :action =&gt; 'search', :name =&gt; nil %&gt;		
-		    [&lt;%= link_to &quot;Files&quot;, :controller =&gt; 'doc', :action =&gt; 'list', :type =&gt; 'files'  %&gt;]
-		    [&lt;%= link_to &quot;Classes&quot;, :controller =&gt; 'doc', :action =&gt; 'list', :type =&gt; 'classes' %&gt;]
-		    [&lt;%= link_to &quot;Methods&quot;, :controller =&gt; 'doc', :action =&gt; 'list', :type =&gt; 'methods' %&gt;]
+		    [&lt;%= link_to &quot;All Files&quot;, :controller =&gt; 'doc', :action =&gt; 'list', :type =&gt; 'files'  %&gt;]
+		    [&lt;%= link_to &quot;All Classes&quot;, :controller =&gt; 'doc', :action =&gt; 'list', :type =&gt; 'classes' %&gt;]
+		    [&lt;%= link_to &quot;All Methods&quot;, :controller =&gt; 'doc', :action =&gt; 'list', :type =&gt; 'methods' %&gt;]
 		    [&lt;%= link_to &quot;Libraries&quot;, :controller =&gt; 'doc', :action =&gt; 'libraries' %&gt;]
 		    &lt;input type=&quot;text&quot; name=&quot;name&quot; size=&quot;20&quot;/&gt;&amp;nbsp;&lt;%= submit_tag 'search' %&gt;
 		    &lt;%= end_form_tag %&gt; </diff>
      <filename>app/views/layouts/notes.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,23 @@
 &lt;a name=&quot;note_&lt;%= @note.id %&gt;&quot;&gt;&lt;/a&gt;
 &lt;div class=&quot;note&quot;&gt;
-  &lt;div class=&quot;note_header&quot;&gt;
+&lt;div class=&quot;note_header&quot;&gt;
 &lt;strong&gt;&lt;%= mangle_email_for_display(@note.email) %&gt;&lt;/strong&gt;&lt;br /&gt;
+
 &lt;% if(@hide_vote == nil) %&gt;
-		&lt;span style=&quot;float: right; font-size: 80%;&quot;&gt;		
-&lt;%= if @note.total_votes &gt;= 0 then '+' else '' end %&gt;&lt;%= @note.total_votes %&gt; vote [&lt;%= link_to('up', :controller =&gt; 'notes', :action =&gt; 'vote', :value =&gt; NoteVote::USEFUL, :id =&gt; @note.id) %&gt;] 
-		[&lt;%= link_to('down', :controller =&gt; 'notes', :action =&gt; 'vote', :type =&gt; NoteVote::NOT_USEFUL, :id =&gt; @note.id)  %&gt;]
-				[&lt;%= link_to('spam', :controller =&gt; 'notes', :action =&gt; 'vote', :type =&gt; NoteVote::SPAM, :id =&gt; @note.id)  %&gt;]
-		&lt;/span&gt;    
+&lt;span style=&quot;float: right; font-size: 80%;&quot;&gt;		
+&lt;%= if @note.total_votes &gt;= 0 then '+' else '' end %&gt;
+&lt;%= @note.total_votes %&gt; vote [&lt;%= link_to('up', :controller =&gt; 'notes', :action =&gt; 'vote', :value =&gt; NoteVote::USEFUL, :id =&gt; @note.id) %&gt;] 
+[&lt;%= link_to('down', :controller =&gt; 'notes', :action =&gt; 'vote', :type =&gt; NoteVote::NOT_USEFUL, :id =&gt; @note.id)  %&gt;]
+[&lt;%= link_to('spam', :controller =&gt; 'notes', :action =&gt; 'vote', :type =&gt; NoteVote::SPAM, :id =&gt; @note.id)  %&gt;]
+&lt;/span&gt;    
 		&lt;% end %&gt;
 Added To Version &lt;%= @note.version %&gt; on &lt;a href=&quot;#&quot;&gt;&lt;%= @note.created_at.strftime(&quot;%d-%b-%Y %H:%M&quot;) %&gt;&lt;/a&gt; 
 &lt;/strong&gt;
 		  
-  &lt;/div&gt;
-  &lt;div class=&quot;note_text&quot;&gt;
-  &lt;div class=&quot;ruby&quot;&gt;
-  &lt;%= fix_note_for_display(@note.text) %&gt;
-  &lt;/div&gt;&lt;!-- ruby --&gt;
-  &lt;/div&gt;&lt;!-- text --&gt;
+&lt;/div&gt;
+&lt;div class=&quot;note_text&quot;&gt;
+&lt;div class=&quot;ruby&quot;&gt;
+&lt;%= fix_note_for_display(@note.text) %&gt;
+&lt;/div&gt;&lt;!-- ruby --&gt;
+&lt;/div&gt;&lt;!-- text --&gt;
 &lt;/div&gt;&lt;!-- note --&gt;</diff>
      <filename>app/views/notes/_note.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -1,36 +1,18 @@
 development:
   adapter: mysql
   database: rannotate
-  host: 
+  host: localhost
   username: root
-  password: 
-  port: 
-  sslcert: 
-  sslcapath: 
-  sslcipher: 
-  socket: localhost
-  sslkey: 
-  schema_order: 
-  dbfile: 
-
+  
 test:
   adapter: mysql
   database: rannotate_test
-  host: 
-  username: rails
-  password: rails
-  port: 
-  sslcert: 
-  sslcapath: 
-  sslcipher: 
-  socket: localhost
-  sslkey: 
-  schema_order: 
-  dbfile: 
+  host: localhost
+  username: root
 
 production:
   adapter: mysql
   database: rannotate_prod
   username: rails
   password: rails
-  socket: /var/lib/mysql/mysql.sock
+  socket: /var/lib/mysql/mysql.sock
\ No newline at end of file</diff>
      <filename>config/database.yml</filename>
    </modified>
    <modified>
      <diff>@@ -36,6 +36,11 @@ Rails::Initializer.run do |config|
   # (enables use of different database adapters for development and test environments)
   # config.active_record.schema_format = :ruby
 
+  # RANNOTATE addition
+  # For Rannotate we use page caching extensively. In order to make things simpler for
+  # expiration we want all of the cached pages to be in a separate folder
+  config.action_controller.page_cache_directory = RAILS_ROOT+&quot;/public/cache/&quot;   
+
   # See Rails::Configuration for more options
 end
 
@@ -52,6 +57,9 @@ end
 # Rannotate Configuration Options
 # *******************************
 
+# Specify the default library to display on the site
+RANNOTATE_DEFAULT_LIB = ''
+
 # Specify the name of the container to use as a home page
 # REQUIRED: but can be nil for the default index
 RANNOTATE_HOME_PAGE = 'vendor/rails/railties/README'</diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,37 +2,32 @@ ActionController::Routing::Routes.draw do |map|
   # Add your own custom routes here.
   # The priority is based upon order of creation: first created -&gt; highest priority.
   
-  # Here's a sample route:
-  # map.connect 'products/:id', :controller =&gt; 'catalog', :action =&gt; 'view'
-  # Keep in mind you can assign values other than :controller and :action
-
-  # You can have the root of your site routed by hooking up ''
-  map.connect '', :controller =&gt; &quot;doc&quot;  
-  map.connect 'admin/', :controller =&gt; &quot;admin/upload&quot;  
+  # Route / to /doc/index
+  map.connect '', :controller =&gt; &quot;doc&quot;
+    
+  # routing urls for container/library browsing
+  map.connect 'lib/:lib_name/:container/:method', :controller =&gt; 'doc', :action =&gt; 'container',
+    :container =&gt; nil, :method =&gt; nil
+    
+  # routing urls for container/library browsing
+  map.connect 'lib/:lib_name/:version/:container/:method', :controller =&gt; 'doc', :action =&gt; 'container',
+    :name =&gt; nil, :method =&gt; nil, :requirements =&gt; {:version =&gt; /\d\.\d\.\d/}
   
-  # routing rules to give nice URLs to class and modules with version numbers
-  map.connect 'class/:name/:version', :controller =&gt; 'doc', :action =&gt; 'classes', :requirements =&gt; {:version =&gt; /\d\.\d\.\d/}
-  map.connect 'file/:name/:version', :controller =&gt; 'doc', :action =&gt; 'files', :requirements =&gt; {:version =&gt; /\d\.\d\.\d/}
-  map.connect 'module/:name/:version', :controller =&gt; 'doc', :action =&gt; 'modules', :requirements =&gt; {:version =&gt; /\d\.\d\.\d/}
+  # route to list all classes/files/methods for a library
+  map.connect 'lib/:lib_name/list/:type', :controller =&gt; 'doc', :action =&gt; 'list'
   
-  # routing ruls to give nice ULRs to class and modules with methods and version numbers
-  map.connect 'class/:name/:method/:version', :controller =&gt; 'doc', :action =&gt; 'classes', :method =&gt; nil, :version =&gt; nil
-  map.connect 'file/:name/:method/:version', :controller =&gt; 'doc', :action =&gt; 'files', :method =&gt; nil, :version =&gt; nil
-  map.connect 'module/:name/:method/:version', :controller =&gt; 'doc', :action =&gt; 'modules', :method =&gt; nil, :version =&gt; nil
+  # routing rule to give nice url to history links for both libraries and for classes/modules in that library
+  map.connect 'lib/:lib_name/:name/history', :controller =&gt; 'doc', :action=&gt; 'history', :name =&gt; nil
   
-  # routing rule to match the list types with possible version numbers
-  map.connect 'list/:type/:library/:version', :controller =&gt; 'doc', :action =&gt; 'list', :library =&gt; nil, :version =&gt; nil
+  # route to list all classes/files/methods in the system
+  map.connect 'list/:type/:version', :controller =&gt; 'doc', :action =&gt; 'list'
   
-  # routing rule to give nice url to history of library links
-  map.connect 'history/library/:name', :controller =&gt; 'history', :action=&gt; 'library'
+  # Route to the admin portion of the site
+  map.connect 'admin/', :controller =&gt; 'admin/upload'  
   
-  # routing rule to give nice URL to history links
-  map.connect 'history/:type/:name', :controller =&gt; 'doc', :action =&gt; 'history'
+  # default route (id must be a number) 
+  map.connect ':controller/:action/:id'
   
   # routing rule to search for anything that doesn't match the above
   map.connect '/:name', :controller =&gt; 'doc', :action =&gt; 'search'
-  
-  # default route (id must be a number) 
-  map.connect ':controller/:action/:id'
-    
-end
+end
\ No newline at end of file</diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 class InitialSchema &lt; ActiveRecord::Migration
-  def self.up  	
+  def self.up  	
     create_table &quot;bans&quot;, :force =&gt; true do |t|
       t.column &quot;ip_filter&quot;, :string, :limit =&gt; 16
     end</diff>
      <filename>db/migrate/001_initial_schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,11 +2,12 @@ class NoteContainer &lt; ActiveRecord::Migration
   def self.up
     
     # Removing the container_id from the note        
-    #remove_column :notes, :ra_container_id                              
+    
+    # remove_column :notes, :ra_container_id                              
   end
 
   def self.down 
     # Removing the container_id from the note
-    #add_column :notes, :ra_container_id
+    # add_column :notes, :ra_container_id
   end
 end</diff>
      <filename>db/migrate/003_note_container.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,45 +1,25 @@
-HTML {
-  PADDING: 0px; MARGIN: 0px;
-}
-BODY {
-  PADDING: 0px; MARGIN: 0px; FONT: 1em &quot;Lucida Grande&quot;, Helvetica, sans-serif;
-}
-A {
-	  COLOR: #213449
-}
-TABLE {
-  PADDING: 0px; MARGIN: 0px; BORDER: 0px; BORDER-COLLAPSE: collapse;
-}
-TD, TR {
-  PADDING: 0px; MARGIN: 0px;
-}
-FORM {
-  DISPLAY: inline;
-}
-FORM INPUT {
-  	FONT-SIZE: 80%;
-}
-H1,H2,H3,H4,H5,H6 {
-  	MARGIN: 0 0 0 0px;
-	}
-	IMG {
-  	BORDER: 0px;
-}
-
-		#wrap {
+HTML { PADDING: 0px; MARGIN: 0px; }
+BODY { PADDING: 0px; MARGIN: 0px; FONT: 1em &quot;Lucida Grande&quot;, Helvetica, sans-serif; }
+A { COLOR: #213449 }
+TABLE { PADDING: 0px; MARGIN: 0px; BORDER: 0px; BORDER-COLLAPSE: collapse; }
+TD, TR { PADDING: 0px; MARGIN: 0px; }
+FORM { DISPLAY: inline; }
+FORM INPUT { FONT-SIZE: 80%; }
+H1,H2,H3,H4,H5,H6 { MARGIN: 0 0 0 0px; }
+IMG { BORDER: 0px; }
+
+#wrap {
   margin:0 0 0 0;
   background: #fafaea; 
-		}
-		
-	#header {
+}
+#header {
   width: 100%;
-  	font-size: 80%;  
+  font-size: 80%;  
   background-color: #213449;
   padding: 5px;
   color: #ffff66; 
-  vertical-align:middle;   
-	}
-	
+  vertical-align:middle;
+}
 .header_link {
   font-size: 140%;
   color: #ffff66;  
@@ -100,14 +80,15 @@ H1,H2,H3,H4,H5,H6 {
 }
 
 .section_title {
-  	margin: 10 0 10 0px; font-size: 120%; font-weight: bold; color: #ffff66;
+  margin: 10 0 10 0px; font-size: 120%; font-weight: bold; color: #ffff66;
   padding: 0.3em;
   background: #213449;	
+  cursor: pointer;
 }
 
-	.comment H1, H2 {
-	  	margin: 0px 0px 5px; font-size: 120%; color: #555; border-bottom: #ccc 1px dotted;  
-	}
+.comment H1, H2 {
+  margin: 0px 0px 5px; font-size: 120%; color: #555; border-bottom: #ccc 1px dotted;  
+}
 .comment PRE {
   padding: 0.5em;
   border: 1px dotted black;
@@ -168,6 +149,7 @@ H1,H2,H3,H4,H5,H6 {
 }
 
 .sourcecode {
+  font-size: 110%;
   padding: 0.5em;
   border: 1px dotted black;
   background: #fafaea; </diff>
      <filename>public/stylesheets/docs.css</filename>
    </modified>
    <modified>
      <diff>@@ -41,14 +41,14 @@ module Generators
       
       # sequences used to generate unique ids for inserts
       @seq = 1
-            
+               
       # An output filename must be specified on the commandline
       @output_file = @options.op_name
-      if @output_file == nil || !(@output_file =~ /[a-zA-Z]+-[0-9]+\.[0-9]+\.[0-9]+/)
+      if @output_file == nil || !(@output_file =~ /[a-zA-Z0-9]+-[0-9]+\.[0-9]+\.[0-9]+/)
         puts &quot;Error:&quot;
       	puts &quot;You must specify an output filename on the command line.&quot;
       	puts &quot;and it must have the format: name-[major]-[minor]-[release&quot;
-      	puts &quot;(matching the regex: [a-zA-Z]+-[0-9]+\.[0-9]+\.[0-9]+)&quot;
+      	puts &quot;(matching the regex: [a-zA-Z0-9]+-[0-9]+\.[0-9]+\.[0-9]+)&quot;
       	puts &quot;Ex: rdoc --fmt=yaml --opname=rannotate-1.2.1&quot;
       	exit
       end  
@@ -74,24 +74,24 @@ module Generators
     def process_file(file)
       putc('.')
       id = create_file(file)           
-          
+
       # Process all of the objects that this file contains
-      file.method_list.each { |child| process_method(child, file, id) }
-      file.aliases.each { |child| process_alias(child, file, id) }
-      file.constants.each { |child| process_constant(child, file, id) }
-      file.requires.each { |child| process_require(child, file, id) }
-      file.includes.each { |child| process_include(child, file, id) }
-      file.attributes.each { |child| process_attribute(child, file, id) }   
+      file.method_list.each { |child| process_method(child, file, id, id) }
+      file.aliases.each { |child| process_alias(child, file, id, id) }
+      file.constants.each { |child| process_constant(child, file, id, id) }
+      file.requires.each { |child| process_require(child, file, id, id) }
+      file.includes.each { |child| process_include(child, file, id, id) }
+      file.attributes.each { |child| process_attribute(child, file, id, id) }   
     
       # Recursively process contained subclasses and modules 
-       file.each_classmodule do |child| 
-          process_class_or_module(child, file, id)      
+      file.each_classmodule do |child|
+        process_class_or_module(child, file, id, id)      
       end       
       
     end
     
     # Process classes and modiles   
-    def process_class_or_module(obj, parent, parent_id)    
+    def process_class_or_module(obj, parent, parent_id, file_id)   
       # One important note about the code_objects.rb structure. A class or module
       # definition can be spread a cross many files in Ruby so code_objects.rb handles
       # this by keeping only *one* reference to each class or module that has a definition
@@ -100,25 +100,28 @@ module Generators
       # twice. So we need to keep track of what classes/modules we have
       # already seen and make sure we don't create two INSERT statements for the same
       # object.
-      if(!@already_processed.has_key?(obj.full_name)) then      
-        id = create_class_or_module(obj, parent_id)
-        @already_processed[obj.full_name] = id        
-          
-        # Process all of the objects that this class or module contains
-        obj.method_list.each { |child| process_method(child, obj, id) }
-        obj.aliases.each { |child| process_alias(child, obj, id) }
-        obj.constants.each { |child| process_constant(child, obj, id) }
-        obj.requires.each { |child| process_require(child, obj, id) }
-        obj.includes.each { |child| process_include(child, obj, id) }
-        obj.attributes.each { |child| process_attribute(child, obj, id) } 
-        obj.in_files.each { |child| process_in_file(child, obj, id) }  
+      if(@already_processed.has_key?(obj.full_name))      
+        id = @already_processed[obj.full_name]
+      else
+        id = create_class_or_module(obj, parent_id, file_id)
+        @already_processed[obj.full_name] = id
       end
       
-      id = @already_processed[obj.full_name]
+      # Process all of the objects that this class or module contains
+      obj.method_list.each { |child| process_method(child, obj, id, file_id) }
+      obj.aliases.each { |child| process_alias(child, obj, id, file_id) }
+      obj.constants.each { |child| process_constant(child, obj, id, file_id) }
+      obj.requires.each { |child| process_require(child, obj, id, file_id) }
+      obj.includes.each { |child| process_include(child, obj, id, file_id) }
+      obj.attributes.each { |child| process_attribute(child, obj, id, file_id) } 
+      obj.in_files.each { |child| process_in_file(child, obj, id) }  
+            
       # Recursively process contained subclasses and modules 
-      obj.each_classmodule do |child| 
-      	process_class_or_module(child, obj, id) 
+      obj.each_classmodule do |child|
+      	process_class_or_module(child, obj, id, file_id) 
       end
+      
+      # @ loop would happen when we process a class that contains itself as a class or module      
     end       
     
     def output_yaml(c)
@@ -134,9 +137,9 @@ module Generators
     end
     
     def create_file(obj)
-      comment_id = create_comment(obj)      
+      comment_id = create_comment(obj)
             
-      id = get_next_id(:files)            
+      id = get_next_id(:files)
       c = RaFile.new({
         'name' =&gt; obj.file_relative_name,
         'type' =&gt; 'RaFile', 
@@ -151,7 +154,7 @@ module Generators
       return id  
     end
     
-    def create_class_or_module(obj, parent_id)
+    def create_class_or_module(obj, parent_id, file_id)
       comment_id = create_comment(obj)      
       
       if(obj.is_module?)
@@ -169,6 +172,7 @@ module Generators
         'id' =&gt; id, 
         'ra_comment_id' =&gt; comment_id,
         'ra_library_id' =&gt; 0,
+        'file_id' =&gt; file_id,
         'full_name' =&gt; obj.full_name,
         'parent_id' =&gt; parent_id,
         'superclass' =&gt; obj.superclass
@@ -178,7 +182,7 @@ module Generators
       return id     
     end          
     
-    def process_method(obj, parent, parent_id)  
+    def process_method(obj, parent, parent_id, file_id)  
       comment_id = create_comment(obj)
             
       source_id = get_next_id(:source)
@@ -192,7 +196,9 @@ module Generators
         'visibility' =&gt; VISIBILITY[obj.visibility], 
         'name' =&gt; obj.name,
         'ra_container_id' =&gt; parent_id,
+        'file_id' =&gt; file_id,
         'parameters' =&gt; obj.params,
+        'call_seq' =&gt; obj.call_seq,
         'singleton' =&gt; bool_to_int(obj.singleton),
         'force_documentation' =&gt; bool_to_int(obj.force_documentation),
         'block_parameters' =&gt; obj.block_params,
@@ -215,16 +221,17 @@ module Generators
       })
       
       output_yaml(c)
-      return id                  
+      return id
     end
     
-    def process_alias(obj, parent, parent_id)
+    def process_alias(obj, parent, parent_id, file_id)
       id = get_next_id(:aliases)
       
       c = RaAlias.new({
         'id' =&gt; id,
         'name' =&gt; obj.old_name,
         'ra_container_id' =&gt; parent_id,
+        'file_id' =&gt; file_id,        
         'type' =&gt; 'RaAlias',
         'value' =&gt; obj.new_name,
         'comment' =&gt; obj.comment
@@ -233,13 +240,14 @@ module Generators
       return id    
     end
     
-    def process_constant(obj, parent, parent_id)
+    def process_constant(obj, parent, parent_id, file_id)
       id = get_next_id(:constants) 
       
       c = RaConstant.new({
         'id' =&gt; id,
         'name' =&gt; obj.name,
         'ra_container_id' =&gt; parent_id,
+        'file_id' =&gt; file_id,        
         'type' =&gt; 'RaConstant',
         'value' =&gt; obj.value,
         'comment' =&gt; obj.comment
@@ -248,7 +256,7 @@ module Generators
       return id     
     end
     
-    def process_attribute(obj, parent, parent_id)
+    def process_attribute(obj, parent, parent_id, file_id)
       id = get_next_id(:attributes)   
       
       c = RaAttribute.new({
@@ -257,6 +265,7 @@ module Generators
         'visibility' =&gt; VISIBILITY[obj.visibility],
         'name' =&gt; obj.name,
         'ra_container_id' =&gt; parent_id,
+        'file_id' =&gt; file_id,        
         'type' =&gt; 'RaAttribute',
         'comment' =&gt; obj.comment
       })
@@ -264,12 +273,13 @@ module Generators
       return id             
     end
     
-    def process_require(obj, parent, parent_id)
+    def process_require(obj, parent, parent_id, file_id)
       id = get_next_id(:requires)
       c = RaRequire.new({
         'id' =&gt; id,
         'name' =&gt; obj.name,
         'ra_container_id' =&gt; parent_id,
+        'file_id' =&gt; file_id,        
         'type' =&gt; 'RaRequire',
         'comment' =&gt; obj.comment
       })
@@ -277,12 +287,13 @@ module Generators
       return id
     end
     
-    def process_include(obj, parent, parent_id) 
+    def process_include(obj, parent, parent_id, file_id) 
       id = get_next_id(:includes)   
       c = RaInclude.new({
         'id' =&gt; id,
         'name' =&gt; obj.name,
         'ra_container_id' =&gt; parent_id,
+        'file_id' =&gt; file_id,        
         'type' =&gt; 'RaInclude',
         'comment' =&gt; obj.comment
       })
@@ -322,7 +333,6 @@ end
 
 # The classes below emulate the ActiveRecord models used by Rannotate
 # We emulate them so that we can output them to YAML and easily import them in the Rails App
-# TODO: Investigate importing the active record models instead of creating these mock objects
 
 class RaFile
   def initialize(attr)</diff>
      <filename>rdoc_extension/yaml_generator.rb</filename>
    </modified>
    <modified>
      <filename>script/breakpointer</filename>
    </modified>
    <modified>
      <filename>script/console</filename>
    </modified>
    <modified>
      <filename>script/destroy</filename>
    </modified>
    <modified>
      <filename>script/generate</filename>
    </modified>
    <modified>
      <filename>script/performance/benchmarker</filename>
    </modified>
    <modified>
      <filename>script/performance/profiler</filename>
    </modified>
    <modified>
      <filename>script/process/reaper</filename>
    </modified>
    <modified>
      <filename>script/process/spawner</filename>
    </modified>
    <modified>
      <filename>script/process/spinner</filename>
    </modified>
    <modified>
      <filename>script/runner</filename>
    </modified>
    <modified>
      <filename>script/server</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>app/views/doc/partials/_in_file.rhtml</filename>
    </removed>
    <removed>
      <filename>db/migrate/005_add_file_id.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>9f87402f533a3060d814921e08195a7803d855b8</id>
    </parent>
  </parents>
  <author>
    <name>conor</name>
    <email>conor@016420e5-f504-0410-9c4b-e4e4ac7be119</email>
  </author>
  <url>http://github.com/conorh/rannotate/commit/70c83cc50dd35737f6193565fe28461434c39707</url>
  <id>70c83cc50dd35737f6193565fe28461434c39707</id>
  <committed-date>2007-04-23T21:25:40-07:00</committed-date>
  <authored-date>2007-04-23T21:25:40-07:00</authored-date>
  <message>imported local changes

git-svn-id: file:///Users/conorhunt/Code/Rails/svndavrepo/rannotate/trunk@153 016420e5-f504-0410-9c4b-e4e4ac7be119</message>
  <tree>2d072307ff98864f92f10a25759eecc79c3ea4d6</tree>
  <committer>
    <name>conor</name>
    <email>conor@016420e5-f504-0410-9c4b-e4e4ac7be119</email>
  </committer>
</commit>
