I reckon lines 47-51 could be simplified a bit by using an ERB template.  This would isolate the HTML into its own file and allow you to add embedded Ruby code.  This avoids having to construct the HTML in code and makes it easier to manage and change in the future.  To do this you'd need to:

- Change line 44 to use an instance variable for storing the results, so ```@results = WebLibrary...``` rather than ```results = WebLibrary....```

- Create a subdirectory called ```views``` under the ```lib``` directory.

- Create a file in the views directory called ```search_results.erb``` containing the following (taken from your code):

```
<html><body><ul id="search_results">
  <% @results.each do |r_item| %>
      <li><%= r_item %></li>
  <% end %>
</ul></body></html>
```

- You can now delete lines 47-51 and replace them with a call to the new template:

```
erb :search_results
```