acts_as_indexed 0.7.7 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ ===0.7.8 [14 March 2011]
2
+ - Fixed bug with file renaming on Windows. Fixes issue #21. [gabynamian - Gabriel Namiman]
3
+
1
4
  ===0.7.7 [14 November 2011]
2
5
  - Fixed bug with out-of-date indexes on Windows. Fixes issue #20. [parndt - Philip Arndt]
3
6
 
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rdoc/task'
4
4
 
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
@@ -49,35 +49,3 @@ begin
49
49
  rescue LoadError
50
50
  puts "Jeweler not available. Install it with: sudo gem install jeweler"
51
51
  end
52
-
53
- namespace :rvm do
54
- AR_VERSIONS = %w{2.1.2 2.2.3 2.3.12 3.0.9}
55
- INSTALLED_GEMSETS = `rvm gemset list`.scan(/aai_ar[^\n]+/)
56
-
57
- desc "Setup RVM gemsets to test different versions of ActiveRecord"
58
- task :test do
59
- AR_VERSIONS.each do |version|
60
- gemset_name = "aai_ar_#{ version }"
61
-
62
- unless INSTALLED_GEMSETS.include?(gemset_name)
63
- sh "rvm gemset create #{ gemset_name }"
64
- sh "rvm gemset use aai_ar_#{ version }"
65
- sh "gem install bundler --no-rdoc --no-ri"
66
- sh "bundle install"
67
- sh "gem install activerecord --version #{version} --no-rdoc --no-ri"
68
- end
69
-
70
- puts "Testing with Activerecord #{ version }"
71
- puts "="*20
72
- sh "rake test"
73
- puts "="*20
74
- end
75
- end
76
-
77
- task :cleanup do
78
- INSTALLED_GEMSETS.each do |gemset|
79
- sh "rvm --force gemset delete #{ gemset }"
80
- end
81
- end
82
-
83
- end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.7
1
+ 0.7.8
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{acts_as_indexed}
8
- s.version = "0.7.7"
7
+ s.name = "acts_as_indexed"
8
+ s.version = "0.7.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Douglas F Shearer}]
12
- s.date = %q{2011-11-14}
13
- s.description = %q{Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app}
14
- s.email = %q{dougal.s@gmail.com}
11
+ s.authors = ["Douglas F Shearer"]
12
+ s.date = "2012-03-14"
13
+ s.description = "Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app"
14
+ s.email = "dougal.s@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "README.rdoc"
17
17
  ]
@@ -44,19 +44,10 @@ Gem::Specification.new do |s|
44
44
  "test/search_atom_test.rb",
45
45
  "test/search_index_test.rb"
46
46
  ]
47
- s.homepage = %q{http://github.com/dougal/acts_as_indexed}
48
- s.require_paths = [%q{lib}]
49
- s.rubygems_version = %q{1.8.6}
50
- s.summary = %q{Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app}
51
- s.test_files = [
52
- "test/abstract_unit.rb",
53
- "test/acts_as_indexed_test.rb",
54
- "test/configuration_test.rb",
55
- "test/fixtures/post.rb",
56
- "test/schema.rb",
57
- "test/search_atom_test.rb",
58
- "test/search_index_test.rb"
59
- ]
47
+ s.homepage = "http://github.com/dougal/acts_as_indexed"
48
+ s.require_paths = ["lib"]
49
+ s.rubygems_version = "1.8.11"
50
+ s.summary = "Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app"
60
51
 
61
52
  if s.respond_to? :specification_version then
62
53
  s.specification_version = 3
@@ -115,7 +115,7 @@ module ActsAsIndexed #:nodoc:
115
115
  version_path = @path.join('version')
116
116
 
117
117
  if @path.exist?
118
- version_path_to_check = Pathname.new(version_path.to_s + (TEMP_FILE_EXTENSION if windows?).to_s)
118
+ version_path_to_check = Pathname.new(version_path.to_s)
119
119
  unless version_path_to_check.exist? && version_path_to_check.read == ActsAsIndexed::INDEX_VERSION
120
120
  raise OldIndexVersion, "Index was created prior to version #{ActsAsIndexed::INDEX_VERSION}. Please delete it, it will be rebuilt automatically."
121
121
  end
@@ -162,7 +162,7 @@ module ActsAsIndexed #:nodoc:
162
162
  # https://github.com/dougal/acts_as_indexed/issues/15
163
163
  writeable_file = windows? ? new_file : tmp_file
164
164
 
165
- File.open(tmp_file, 'w+') do |f|
165
+ File.open(writeable_file, 'w+') do |f|
166
166
  yield(f)
167
167
  end
168
168
 
@@ -9,17 +9,19 @@ module ActsAsIndexed
9
9
  module Search
10
10
 
11
11
  def paginate_search(query, options)
12
- page, per_page, total_entries = wp_parse_options(options)
12
+ page = options.fetch(:page) { raise ArgumentError, ":page parameter required" }
13
+ per_page = options.delete(:per_page) || self.per_page
14
+ total_entries = options.delete(:total_entries)
13
15
 
14
16
  total_entries ||= find_with_index(query,{},{:ids_only => true}).size
15
17
 
16
- returning ::WillPaginate::Collection.new(page, per_page, total_entries) do |pager|
17
- options.update :offset => pager.offset, :limit => pager.per_page
18
+ pager = ::WillPaginate::Collection.new(page, per_page, total_entries)
19
+ options.update :offset => pager.offset, :limit => pager.per_page
18
20
 
19
- options = options.delete_if {|key, value| [:page, :per_page].include?(key) }
21
+ options = options.delete_if {|key, value| [:page, :per_page].include?(key) }
20
22
 
21
- pager.replace find_with_index(query, options)
22
- end
23
+ pager.replace find_with_index(query, options)
24
+ pager
23
25
  end
24
26
 
25
27
  end
metadata CHANGED
@@ -1,32 +1,24 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: acts_as_indexed
3
- version: !ruby/object:Gem::Version
4
- hash: 13
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.8
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 7
9
- - 7
10
- version: 0.7.7
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Douglas F Shearer
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-11-14 00:00:00 Z
12
+ date: 2012-03-14 00:00:00.000000000 Z
19
13
  dependencies: []
20
-
21
- description: Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app
14
+ description: Acts As Indexed is a plugin which provides a pain-free way to add fulltext
15
+ search to your Ruby on Rails app
22
16
  email: dougal.s@gmail.com
23
17
  executables: []
24
-
25
18
  extensions: []
26
-
27
- extra_rdoc_files:
19
+ extra_rdoc_files:
28
20
  - README.rdoc
29
- files:
21
+ files:
30
22
  - CHANGELOG
31
23
  - Gemfile
32
24
  - Gemfile.lock
@@ -56,42 +48,27 @@ files:
56
48
  - test/search_index_test.rb
57
49
  homepage: http://github.com/dougal/acts_as_indexed
58
50
  licenses: []
59
-
60
51
  post_install_message:
61
52
  rdoc_options: []
62
-
63
- require_paths:
53
+ require_paths:
64
54
  - lib
65
- required_ruby_version: !ruby/object:Gem::Requirement
55
+ required_ruby_version: !ruby/object:Gem::Requirement
66
56
  none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- hash: 3
71
- segments:
72
- - 0
73
- version: "0"
74
- required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
62
  none: false
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- hash: 3
80
- segments:
81
- - 0
82
- version: "0"
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
83
67
  requirements: []
84
-
85
68
  rubyforge_project:
86
- rubygems_version: 1.8.6
69
+ rubygems_version: 1.8.11
87
70
  signing_key:
88
71
  specification_version: 3
89
- summary: Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app
90
- test_files:
91
- - test/abstract_unit.rb
92
- - test/acts_as_indexed_test.rb
93
- - test/configuration_test.rb
94
- - test/fixtures/post.rb
95
- - test/schema.rb
96
- - test/search_atom_test.rb
97
- - test/search_index_test.rb
72
+ summary: Acts As Indexed is a plugin which provides a pain-free way to add fulltext
73
+ search to your Ruby on Rails app
74
+ test_files: []