From b728fbd981b2e59f1ec885b097c3216f1aa9b6e5 Mon Sep 17 00:00:00 2001 From: Ivan Kourza Date: Mon, 28 Jan 2013 14:07:28 +0200 Subject: [PATCH 1/6] Remove :per_page fatal error A variant of solution without changing rsolr --- lib/rsolr-ext/response.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rsolr-ext/response.rb b/lib/rsolr-ext/response.rb index a700c6a..cf962a7 100644 --- a/lib/rsolr-ext/response.rb +++ b/lib/rsolr-ext/response.rb @@ -24,7 +24,7 @@ def header end def rows - params[:rows].to_i + params[:rows].first.to_i end def params @@ -58,4 +58,4 @@ def start end -end \ No newline at end of file +end From abe95546781e8fb3d2f25f79f5f74320ccb2757f Mon Sep 17 00:00:00 2001 From: Ivan Kourza Date: Mon, 28 Jan 2013 17:09:35 +0200 Subject: [PATCH 2/6] Try to support kaminari --- lib/rsolr-ext/response/docs.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/rsolr-ext/response/docs.rb b/lib/rsolr-ext/response/docs.rb index 533c2d9..cf53d63 100644 --- a/lib/rsolr-ext/response/docs.rb +++ b/lib/rsolr-ext/response/docs.rb @@ -22,6 +22,10 @@ def current_page @current_page ||= (start / per_page_normalized).ceil + 1 end + def limit_value + per_page + end + # Calcuates the total pages from 'numFound' and 'rows' # WillPaginate hook def total_pages @@ -56,4 +60,4 @@ def docs end end -end \ No newline at end of file +end From c4b028b5455c86a7dc4973c160a5ea28e8ef7aad Mon Sep 17 00:00:00 2001 From: Ivan Kourza Date: Mon, 28 Jan 2013 17:20:28 +0200 Subject: [PATCH 3/6] Remove undefined method error --- lib/rsolr-ext/response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rsolr-ext/response.rb b/lib/rsolr-ext/response.rb index cf962a7..32fa264 100644 --- a/lib/rsolr-ext/response.rb +++ b/lib/rsolr-ext/response.rb @@ -24,7 +24,7 @@ def header end def rows - params[:rows].first.to_i + params[:rows].try(:first).to_i end def params From d1c64fcb19767a07bbba16137f5b6bcf402cc359 Mon Sep 17 00:00:00 2001 From: Ivan Kourza Date: Mon, 28 Jan 2013 17:58:50 +0200 Subject: [PATCH 4/6] Heroku debug --- rsolr-ext.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rsolr-ext.gemspec b/rsolr-ext.gemspec index 3170b93..307a18b 100644 --- a/rsolr-ext.gemspec +++ b/rsolr-ext.gemspec @@ -1,14 +1,14 @@ # -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) -require 'rsolr-ext' +#require 'rsolr-ext' Gem::Specification.new do |s| s.name = %q{rsolr-ext} s.version = RSolr::Ext.version s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Matt Mitchell", "James Davidson", "Chris Beer", "Jason Ronallo", "Eric Lindvall", "Andreas Kemkes"] + s.authors = ["Matt Mitchell", "James Davidson", "Chris Beer", "Jason Ronallo", "Eric Lindvall", "Andreas Kemkes", "Ivan Kourza"] s.date = %q{2011-06-08} s.description = %q{A query/response extension lib for RSolr} s.email = %q{goodieboy@gmail.com} From aea2ab808150c1bb33d489ff5f68f7cade09e715 Mon Sep 17 00:00:00 2001 From: Ivan Kourza Date: Mon, 28 Jan 2013 18:02:56 +0200 Subject: [PATCH 5/6] Debug failed :) --- rsolr-ext.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rsolr-ext.gemspec b/rsolr-ext.gemspec index 307a18b..1688de3 100644 --- a/rsolr-ext.gemspec +++ b/rsolr-ext.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) -#require 'rsolr-ext' +require 'rsolr-ext' Gem::Specification.new do |s| s.name = %q{rsolr-ext} From 3c793302dca2f6af8edda38a084c591dfa0c4dab Mon Sep 17 00:00:00 2001 From: Ivan Kourza Date: Tue, 29 Jan 2013 10:26:57 +0200 Subject: [PATCH 6/6] Heroku fix --- rsolr-ext.gemspec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rsolr-ext.gemspec b/rsolr-ext.gemspec index 1688de3..d88e6ca 100644 --- a/rsolr-ext.gemspec +++ b/rsolr-ext.gemspec @@ -1,11 +1,10 @@ # -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) -require 'rsolr-ext' +#require 'rsolr-ext' Gem::Specification.new do |s| s.name = %q{rsolr-ext} - s.version = RSolr::Ext.version s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Matt Mitchell", "James Davidson", "Chris Beer", "Jason Ronallo", "Eric Lindvall", "Andreas Kemkes", "Ivan Kourza"] @@ -18,6 +17,9 @@ Gem::Specification.new do |s| s.test_files = `git ls-files -- {spec}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } s.require_paths = ["lib"] + s.autorequire = 'rsolr-ext' + + s.version = "1.1.0" s.add_dependency 'rsolr', ">= 1.0.1" @@ -26,4 +28,3 @@ Gem::Specification.new do |s| s.add_development_dependency 'rspec', '~> 2.6.0' s.add_development_dependency 'rcov' end -