<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>public/flash/clippy.swf</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,29 @@
 # Methods added to this helper will be available to all templates in the application.
 module ApplicationHelper
+  def clippy(text, bgcolor='#FFFFFF')
+    html = &lt;&lt;-EOF
+    &lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot;
+            width=&quot;110&quot;
+            height=&quot;14&quot;
+            id=&quot;clippy&quot; &gt;
+    &lt;param name=&quot;movie&quot; value=&quot;/flash/clippy.swf&quot;/&gt;
+    &lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot; /&gt;
+    &lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;
+    &lt;param name=&quot;scale&quot; value=&quot;noscale&quot; /&gt;
+    &lt;param NAME=&quot;FlashVars&quot; value=&quot;text=#{text}&quot;&gt;
+    &lt;param name=&quot;bgcolor&quot; value=&quot;#{bgcolor}&quot;&gt;
+    &lt;embed src=&quot;/flash/clippy.swf&quot;
+           width=&quot;110&quot;
+           height=&quot;14&quot;
+           name=&quot;clippy&quot;
+           quality=&quot;high&quot;
+           allowScriptAccess=&quot;always&quot;
+           type=&quot;application/x-shockwave-flash&quot;
+           pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot;
+           FlashVars=&quot;text=#{text}&quot;
+           bgcolor=&quot;#{bgcolor}&quot;
+    /&gt;
+    &lt;/object&gt;
+    EOF
+  end
 end</diff>
      <filename>app/helpers/application_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 class Artifact &lt; ActiveRecord::Base
+  XML_TEMPLATE = &quot;&lt;dependency&gt;\n\s\s\s&lt;groupId&gt;%s&lt;/groupId&gt;\n\s\s\s&lt;artifactId&gt;%s&lt;/artifactId&gt;\n\s\s\s&lt;version&gt;%s&lt;/version&gt;\n&lt;/dependency&gt;&quot;.freeze
   belongs_to :repository
   has_many :dependencies
   has_many :dependents, :through =&gt; :dependencies
@@ -12,6 +13,6 @@ class Artifact &lt; ActiveRecord::Base
   end
 
   def to_dep_snippet
-    
+    XML_TEMPLATE % [self.group_id, self.artifact_id, self.version]
   end
 end</diff>
      <filename>app/models/artifact.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@
 &lt;html&gt;
 &lt;head xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
   &lt;title&gt;&lt;%= h(yield(:title) || &quot;Untitled&quot;) %&gt;&lt;/title&gt;
-  &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;  
+  &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
   &lt;%= stylesheet_link_tag 'blueprint/screen', :media =&gt; 'screen,projection' %&gt;
   &lt;%= stylesheet_link_tag 'blueprint/print', :media =&gt; 'print' %&gt;
   &lt;%= stylesheet_link_tag 'application', 'harsh/cobalt' %&gt;
@@ -20,7 +20,7 @@
 
   &lt;%- if show_title? -%&gt;
       &lt;h1&gt;&lt;%= h yield(:title) %&gt;&lt;/h1&gt;
-  &lt;%- end -%&gt;
+  &lt;%- end -%&gt; 
   &lt;%= yield %&gt;
 &lt;/div&gt;
 &lt;/body&gt;</diff>
      <filename>app/views/layouts/application.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,18 @@
-&lt;h2&gt;Total results &lt;%= @search_results.count %&gt;&lt;/h2&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+    $(function() {
+        $('.artifact_result&gt;a').click(function() {
+            $(this).parent().find('.snippet').toggle();
+        });
+    });
+&lt;/script&gt;
+&lt;h2&gt;&lt;%= t 'search.results.total_results' %&gt; &lt;%= @search_results.count %&gt;&lt;/h2&gt;
 &lt;% for artifact in @search_results do %&gt;
-    &lt;%= &quot;#{artifact.group_id} &gt; #{artifact.artifact_id} &gt; #{artifact.version}&quot; %&gt; &lt;a&gt;&lt;%= t 'search.results.links.view_xml' %&gt;&lt;/a&gt;
+    &lt;div class=&quot;artifact_result&quot;&gt;
+      &lt;%= &quot;#{artifact.group_id} &gt; #{artifact.artifact_id} &gt; #{artifact.version}&quot; %&gt;
+      &lt;a&gt;&lt;%= t 'search.results.links.view_xml' %&gt;&lt;/a&gt;&lt;%= clippy artifact.to_dep_snippet %&gt;
+
+      &lt;div class=&quot;snippet&quot;&gt;
+        &lt;%= harsh artifact.to_dep_snippet, :theme =&gt; :cobalt %&gt;
+      &lt;/div&gt;
+    &lt;/div&gt;
 &lt;% end %&gt;
\ No newline at end of file</diff>
      <filename>app/views/searches/_search_results.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -10,8 +10,8 @@
     }
     $(function() {
         $('form&gt;input').focus();
-        $('#search-button').click(function() {
-            do_search();
+        $('form&gt;button').click(function() {
+            return do_search();            
         });
         $('form&gt;input').keypress(function(e) {
             if (e.which == 13) {
@@ -21,11 +21,9 @@
     });
 &lt;/script&gt;
 &lt;div class=&quot;search-box&quot;&gt;
-  &lt;h2&gt;Search more in a single place&lt;/h2&gt;
-
   &lt;form id=&quot;search-form&quot; action=&quot;&quot;&gt;
-    &lt;input name=&quot;search&quot;&gt;
-    &lt;button id=&quot;search-button&quot;&gt;&lt;%= t 'search.new.buttons.search' %&gt;&lt;/button&gt;
+    &lt;label for=&quot;search&quot;&gt;&lt;%= t 'template.header.title' %&gt;&lt;/label&gt;&lt;input id=&quot;search&quot; name=&quot;search&quot;&gt;
+    &lt;button id=&quot;search-button&quot; name=&quot;search&quot;&gt;&lt;%= t 'search.new.buttons.search' %&gt;&lt;/button&gt;
   &lt;/form&gt;
 &lt;/div&gt;
 &lt;div class=&quot;search-results&quot;&gt;&lt;/div&gt;
\ No newline at end of file</diff>
      <filename>app/views/searches/new.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-# IMPORTANT: This file was generated by Cucumber 0.4.0
+# IMPORTANT: This file was generated by Cucumber 0.4.2
 # Edit at your own peril - it's recommended to regenerate this file
 # in the future when you upgrade to a newer version of Cucumber.
 
@@ -19,6 +19,7 @@ config.action_controller.allow_forgery_protection = false
 # ActionMailer::Base.deliveries array.
 config.action_mailer.delivery_method = :test
 
-config.gem 'cucumber', :lib =&gt; false, :version =&gt; '&gt;=0.4.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber'))
+config.gem 'cucumber', :lib =&gt; false, :version =&gt; '&gt;=0.4.2' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber'))
 config.gem 'rspec', :lib =&gt; false, :version =&gt; '&gt;=1.2.8' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec'))
 config.gem 'rspec-rails', :lib =&gt; false, :version =&gt; '&gt;=1.2.7.1' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails'))
+</diff>
      <filename>config/environments/cucumber.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,4 +15,8 @@ en:
         search: &quot;Search&quot;
     results:
       links:
-        view_xml: &quot;View XML snippet&quot;
\ No newline at end of file
+        view_xml: &quot;View XML snippet&quot;
+      total_results: &quot;Total result(s)&quot;
+  template:
+    header:
+      title: &quot;MVNSearch &gt; &quot;
\ No newline at end of file</diff>
      <filename>config/locales/en.yml</filename>
    </modified>
    <modified>
      <diff>@@ -9,12 +9,14 @@ Scenario: Search by name
     | spring-core | org.springframework | 2.5.6 | Springframework | Spring is a really cool framework to use |
     | spring-core | org.springframework | 2.5.3 | Springframework | Spring is a really cool framework to use |
   When I go to the homepage
-  And I fill in &quot;spring&quot; for &quot;Search:&quot;
-  And I press &quot;search&quot;
-  Then I should see &quot;2 result(s)&quot;
+  And I fill in &quot;spring&quot; for &quot;MVNSearch &gt;&quot;
+  And I press &quot;Search&quot;
+  And I wait for the AJAX call to finish
+  Then I should see &quot;Total result(s) 0&quot;
   And I should see the following rows in the search results:
-      | spring-core | org.springframework | 2.5.6 | Springframework |
-      | spring-core | org.springframework | 2.5.3 | Springframework |
+      | artifact_id | group_id | version |
+      | spring-core | org.springframework | 2.5.6 |
+      | spring-core | org.springframework | 2.5.3 |
 
 Scenario: Search by name and version
   Given there is 1 repository
@@ -23,8 +25,10 @@ Scenario: Search by name and version
     | spring-core | org.springframework | 2.5.6 | Springframework | Spring is a really cool framework to use |
     | spring-core | org.springframework | 2.5.3 | Springframework | Spring is a really cool framework to use |
   When I go to the homepage
-  And I fill in &quot;spring 2.5.6&quot; for &quot;Search:&quot;
-  And I press &quot;search&quot;
-  Then I should see &quot;1 result(s)&quot;
+  And I fill in &quot;spring 2.5.6&quot; for &quot;MVNSearch &gt;&quot;
+  And I press &quot;Search&quot;
+  And I wait for the AJAX call to finish
+  Then I should see &quot;Total result(s) 1&quot;
   And I should see the following rows in the search results:
-      | spring-core | org.springframework | 2.5.6 | Springframework |      
\ No newline at end of file
+      | artifact_id | group_id | version |
+      | spring-core | org.springframework | 2.5.6 |      
\ No newline at end of file</diff>
      <filename>features/search_artifacts.feature</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ Before do
   $rails_server ||= Culerity::run_rails
   sleep 5
   $server ||= Culerity::run_server
-  $browser = Culerity::RemoteBrowserProxy.new $server, {:browser =&gt; :firefox}
+  $browser = Culerity::RemoteBrowserProxy.new $server, {:browser =&gt; :firefox, :resynchronize =&gt; true, :javascript_exceptions =&gt; true, :log_level =&gt; :all}
   @host = 'http://localhost:3001'
 end
 
@@ -15,8 +15,9 @@ at_exit do
 end
 
 When /I press &quot;(.*)&quot;/ do |button|
-  $browser.button(:text, button).click
-  assert_successful_response
+  button = [$browser.button(:text, button), $browser.button(:id, button)].find(&amp;:exist?)
+  button.click
+  When 'I wait for the AJAX call to finish'
 end
 
 When /I follow &quot;(.*)&quot; link/ do |link|
@@ -70,17 +71,17 @@ Then /I should not see &quot;(.*)&quot;/ do |text|
 end
 
 Then /^I should see a &quot;([^\&quot;]*)&quot; link$/ do |link|
-  $browser.link(:text, /#{link}/).exists?.should == true  
+  $browser.link(:text, /#{link}/).exists?.should == true
 end
 
 When /^I click the &quot;([^\&quot;]*)&quot; link$/ do |link|
-   $browser.link(:text, /#{link}/).click
+  $browser.link(:text, /#{link}/).click
   assert_successful_response
 end
 
 When /^I confirm the &quot;([^\&quot;]*)&quot; action$/ do |action|
   $browser.confirm true do
-    
+
   end
 end
 
@@ -90,7 +91,7 @@ end
 
 def assert_successful_response
   status = $browser.page.web_response.status_code
-  if(status == 302 || status == 301)
+  if (status == 302 || status == 301)
     location = $browser.page.web_response.get_response_header_value('Location')
     puts &quot;Being redirected to #{location}&quot;
     $browser.goto location</diff>
      <filename>features/step_definitions/common_celerity_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,9 +9,9 @@ Given /^there is an artifact with\:$/ do | artifact_info |
   end
 
 end
-When /^I should see the following rows in the search results\:$/ do | results |
-  table = $browser.table(:id, 'search_results')
-  table.exists?.should == true
-  table_data = table.to_a
-  table_data.to_a[1..table_data.size].diff!(results)
+
+Then /^I should see the following rows in the search results\:$/ do | results |
+  results[1..results.size].each do |row|
+    Then &quot;I should see \&quot;#{row.join(' &gt; ')}\&quot;&quot;
+  end
 end
\ No newline at end of file</diff>
      <filename>features/step_definitions/search_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ module NavigationHelpers
   #
   #   When /^I go to (.+)$/ do |page_name|
   #
-  # step definition in webrat_steps.rb
+  # step definition in common_celerity_steps.rb
   #
   def path_to(page_name)
     case page_name</diff>
      <filename>features/support/paths.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,13 @@
-if Cucumber::VERSION::STRING != '0.4.0'
+if Cucumber::VERSION != '0.4.2'
 warning = &lt;&lt;-WARNING
 (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) 
 
          (::)   R O T T E N   C U C U M B E R   A L E R T    (::)
 
-Your #{__FILE__.gsub(/version_check.rb$/, 'env.rb')} file was generated with Cucumber 0.4.0,
-but you seem to be running Cucumber #{Cucumber::VERSION::STRING}. If you're running an older 
-version than #{Cucumber::VERSION::STRING}, just upgrade your gem. If you're running a newer 
-version than #{Cucumber::VERSION::STRING} you should:
+Your #{__FILE__.gsub(/version_check.rb$/, 'env.rb')} file was generated with Cucumber 0.4.2,
+but you seem to be running Cucumber #{Cucumber::VERSION}. If you're running an older 
+version than #{Cucumber::VERSION}, just upgrade your gem. If you're running a newer 
+version than #{Cucumber::VERSION} you should:
 
   1) Read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
   </diff>
      <filename>features/support/version_check.rb</filename>
    </modified>
    <modified>
      <diff>@@ -89,6 +89,13 @@ table.repositories thead tr {
 
 div.search-box {
     text-align: center;
+    margin-top:50px;
+}
+
+div.search-box label {
+    font-size: 35px;
+    color: #333333;
+    vertical-align:middle;
 }
 
 div.search-box input {
@@ -105,8 +112,14 @@ div.search-box button {
 
 div.search-results {
     font-size: x-large;
+    padding-top:50px;
 }
 
 div.search-results a {
-    font-size: medium;    
-}
\ No newline at end of file
+    font-size: medium;
+    cursor: pointer;
+}
+
+div.search-results div.snippet {
+    display: none;
+}</diff>
      <filename>public/stylesheets/application.css</filename>
    </modified>
    <modified>
      <diff>@@ -5,8 +5,14 @@ describe SearchesController do
 
   it &quot;should render the new template on GET to the new action&quot; do
     get 'new'
-    response.should render_template(&quot;new&quot;)
-    assigns[:search].should_not be_nil
+    response.should render_template(&quot;new&quot;)    
   end
 
+  it &quot;should render the search results partial on POST to the create action&quot; do
+    Factory(:artifact)
+    post 'create', :search =&gt; 'spring', :page =&gt; 1
+    assigns[:search_results].should_not be_nil
+    response.should be_success
+    response.should render_template(&quot;searches/_search_results&quot;)
+  end
 end</diff>
      <filename>spec/controllers/searches_controller_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,4 +56,17 @@ describe Artifact do
     new_artifact.should_not be_valid
     new_artifact.save.should == false    
   end
+
+  it &quot;should return the proper XML dep snippet&quot; do
+    @artifact.to_dep_snippet.should_not be_nil
+    @artifact.to_dep_snippet.should be_an(String)
+    @artifact.to_dep_snippet.should == &quot;&lt;dependency&gt;\n\s\s\s&lt;groupId&gt;%s&lt;/groupId&gt;\n\s\s\s&lt;artifactId&gt;%s&lt;/artifactId&gt;\n\s\s\s&lt;version&gt;%s&lt;/version&gt;\n&lt;/dependency&gt;&quot; % [@artifact.group_id, @artifact.artifact_id, @artifact.version]
+  end
+
+  it &quot;should return N results when searching an artifact&quot; do
+    @artifact.save
+    artifact_search = Artifact.search('spring', {:page =&gt; 1})
+    artifact_search.should_not be_nil
+    artifact_search.size.should == 1
+  end
 end</diff>
      <filename>spec/models/artifact_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4ca0a46e00b4b53f139a9c19a56da87412ab7830</id>
    </parent>
  </parents>
  <author>
    <name>Julio Arias</name>
    <email>julio.arias@fresisoft.com</email>
  </author>
  <url>http://github.com/jarias/mvnsearch/commit/135f30b2d016ae8572203dee88c62f168cd77dcb</url>
  <id>135f30b2d016ae8572203dee88c62f168cd77dcb</id>
  <committed-date>2009-10-27T12:38:03-07:00</committed-date>
  <authored-date>2009-10-27T12:38:03-07:00</authored-date>
  <message>Finish adding features to the search results, including copy dep snippet to the clipboard</message>
  <tree>ebdce8a5c93c61eeda6b3d665843466806efac72</tree>
  <committer>
    <name>Julio Arias</name>
    <email>julio.arias@fresisoft.com</email>
  </committer>
</commit>
