thinkingtank 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc ADDED
@@ -0,0 +1,48 @@
1
+ = ThinkingTank
2
+
3
+ See documentation in: http://indextank.com/documentation/ruby-client
4
+
5
+
6
+ ActiveRecord extension that allows to define models that should be indexed
7
+ in an existing IndexTank index. It supports a very similar syntax to
8
+ ThinkingSphinx allowing to easily port an existing project.
9
+
10
+ Every indexable model should include a define_index block in its class
11
+ definition. This block supports the indexes :method and receives a field name.
12
+
13
+ Model classes now have a search method that receives one or more string
14
+ arguments with query strings (according to the query specifications) and
15
+ supports the :conditions argument as a hash from field name to query string.
16
+
17
+ In order for this extension to work you need to define a config/indextank.yml
18
+ in your application with the api_key and index_name settings for each
19
+ environment (similar to config/database.yml).
20
+
21
+ Indexed fields in ActiveRecord are prepended an underscore when sent to
22
+ IndexTank so if you plan to write query strings that use your field names you
23
+ will have to prepend the underscore to the field names.
24
+
25
+ == Rails 2
26
+ In order for the ThinkingTank to be available you need to add:
27
+
28
+ require 'thinkingtank'
29
+ require 'thinkingtank/tasks'
30
+
31
+ to your Rakefile.
32
+
33
+ == Rails 3
34
+ Just add
35
+
36
+ gem 'thinkingtank'
37
+
38
+ to your Gemfile.
39
+
40
+
41
+ == Rails 2 and 3
42
+ For both versions of Rails, you can use the following task to reindex your
43
+ entire database:
44
+
45
+ rake indextank:reindex
46
+
47
+
48
+ Copyright (c) 2011 Flaptor Inc.
@@ -1,4 +1,5 @@
1
1
  require 'thinkingtank/init'
2
+ require 'active_record'
2
3
 
3
4
  class << ActiveRecord::Base
4
5
  @indexable = false
@@ -1,3 +1,5 @@
1
+ require 'railties'
2
+
1
3
  class ThinkingTankRailtie < ::Rails::Railtie
2
4
  rake_tasks do
3
5
  require 'thinkingtank/tasks'
@@ -1,5 +1,6 @@
1
1
  # Load init for Rails 2, since it directly loads this file
2
2
  require 'thinkingtank/init'
3
+ require 'active_record'
3
4
 
4
5
  def load_models
5
6
  app_root = ThinkingTank::Configuration.instance.app_root
@@ -55,6 +56,7 @@ def reindex_models
55
56
  # Rails 3.0.0 and higher
56
57
  subclasses = ActiveRecord::Base.descendants
57
58
  elsif Object.respond_to?(:subclasses_of)
59
+ # Rails 2
58
60
  subclasses = Object.subclasses_of(ActiveRecord::Base)
59
61
  end
60
62
 
data/lib/thinkingtank.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'rails'
2
1
  require 'thinkingtank/init'
3
2
 
4
3
  if defined?(Rails::Railtie)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinkingtank
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease: false
4
+ hash: 17
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Flaptor
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-24 00:00:00 -02:00
18
+ date: 2011-02-07 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 21
29
+ hash: 25
30
30
  segments:
31
+ - 1
31
32
  - 0
32
- - 0
33
- - 5
34
- version: 0.0.5
33
+ - 7
34
+ version: 1.0.7
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  description: |-
@@ -45,11 +45,12 @@ extensions: []
45
45
  extra_rdoc_files: []
46
46
 
47
47
  files:
48
- - lib/thinkingtank/init.rb
48
+ - lib/thinkingtank.rb
49
49
  - lib/thinkingtank/railtie.rb
50
- - lib/thinkingtank/tasks.rb
51
50
  - lib/thinkingtank/activerecord_extensions.rb
52
- - lib/thinkingtank.rb
51
+ - lib/thinkingtank/init.rb
52
+ - lib/thinkingtank/tasks.rb
53
+ - README.rdoc
53
54
  has_rdoc: true
54
55
  homepage: http://indextank.com/
55
56
  licenses: []
@@ -80,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  requirements: []
81
82
 
82
83
  rubyforge_project:
83
- rubygems_version: 1.3.7
84
+ rubygems_version: 1.5.0
84
85
  signing_key:
85
86
  specification_version: 3
86
87
  summary: Thinking-Sphinx-like Indextank plugin.