merb-search 0.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ spec = Gem::Specification.new do |s|
15
15
  s.name = 'merb-search'
16
16
  s.rubyforge_project = 'uipoet'
17
17
  s.summary = 'Search for Merb'
18
- s.version = '0.2'
18
+ s.version = '0.2.1'
19
19
  end
20
20
 
21
21
  Rake::GemPackageTask.new(spec) do |pkg|
@@ -2,22 +2,24 @@ class MerbSearch::Search < MerbSearch::Application
2
2
 
3
3
  def index
4
4
 
5
- query = params[:q] || 'merb'
5
+ if @query = params[:q] and !@query.blank?
6
6
 
7
- images = boss.images.new(query, :count => 3)
8
- @images = images.resultset unless images.count == 0
9
-
10
- news = boss.news.new(query, :age => '1d', :count => 3)
11
- @news = news.resultset unless news.count == 0
12
-
13
- spelling = boss.spelling.new(query)
14
- @spelling = spelling.resultset unless spelling.count == 0
15
-
16
- web_count = 12 - (images.count + news.count)
17
- web = boss.web.new(query, :count => web_count)
18
- @web = web.resultset unless web.count == 0
7
+ images = boss.images.new(@query, :count => 3)
8
+ @images = images.resultset unless images.count == 0
9
+
10
+ news = boss.news.new(@query, :age => '1d', :count => 3)
11
+ @news = news.resultset unless news.count == 0
12
+
13
+ spelling = boss.spelling.new(@query)
14
+ @spelling = spelling.resultset unless spelling.count == 0
15
+
16
+ web_count = 12 - (images.count + news.count)
17
+ web = boss.web.new(@query, :count => web_count)
18
+ @web = web.resultset unless web.count == 0
19
+
20
+ end
19
21
 
20
- display @web
22
+ render
21
23
 
22
24
  end
23
25
 
@@ -0,0 +1,3 @@
1
+ module Merb::MerbSearch::SearchHelper
2
+
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb-search
3
3
  version: !ruby/object:Gem::Version
4
- version: "0.2"
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - UiPoet
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-17 00:00:00 -08:00
12
+ date: 2008-12-22 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -54,6 +54,8 @@ files:
54
54
  - app/controllers
55
55
  - app/controllers/application.rb
56
56
  - app/controllers/search.rb
57
+ - app/helpers
58
+ - app/helpers/search_helper.rb
57
59
  - app/views
58
60
  - app/views/search
59
61
  - app/views/search/_article.html.erb