acts_as_ferret 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +32 -6
- data/acts_as_ferret.gemspec +260 -0
- data/config/ferret_server.yml +1 -0
- data/doc/demo/README +154 -0
- data/doc/demo/README_DEMO +23 -0
- data/doc/demo/Rakefile +10 -0
- data/doc/demo/app/controllers/admin/backend_controller.rb +14 -0
- data/doc/demo/app/controllers/admin_area_controller.rb +4 -0
- data/doc/demo/app/controllers/application.rb +5 -0
- data/doc/demo/app/controllers/contents_controller.rb +49 -0
- data/doc/demo/app/controllers/searches_controller.rb +8 -0
- data/doc/demo/app/helpers/admin/backend_helper.rb +2 -0
- data/doc/demo/app/helpers/application_helper.rb +3 -0
- data/doc/demo/app/helpers/content_helper.rb +2 -0
- data/doc/demo/app/helpers/search_helper.rb +2 -0
- data/doc/demo/app/models/comment.rb +48 -0
- data/doc/demo/app/models/content.rb +12 -0
- data/doc/demo/app/models/content_base.rb +28 -0
- data/doc/demo/app/models/search.rb +19 -0
- data/doc/demo/app/models/shared_index1.rb +3 -0
- data/doc/demo/app/models/shared_index2.rb +3 -0
- data/doc/demo/app/models/special_content.rb +3 -0
- data/doc/demo/app/models/stats.rb +20 -0
- data/doc/demo/app/views/admin/backend/search.rhtml +18 -0
- data/doc/demo/app/views/contents/_form.rhtml +10 -0
- data/doc/demo/app/views/contents/edit.rhtml +9 -0
- data/doc/demo/app/views/contents/index.rhtml +24 -0
- data/doc/demo/app/views/contents/new.rhtml +8 -0
- data/doc/demo/app/views/contents/show.rhtml +8 -0
- data/doc/demo/app/views/layouts/application.html.erb +17 -0
- data/doc/demo/app/views/searches/_content.html.erb +2 -0
- data/doc/demo/app/views/searches/search.html.erb +20 -0
- data/doc/demo/config/boot.rb +109 -0
- data/doc/demo/config/database.yml +38 -0
- data/doc/demo/config/environment.rb +69 -0
- data/doc/demo/config/environments/development.rb +16 -0
- data/doc/demo/config/environments/production.rb +19 -0
- data/doc/demo/config/environments/test.rb +21 -0
- data/doc/demo/config/ferret_server.yml +18 -0
- data/doc/demo/config/lighttpd.conf +40 -0
- data/doc/demo/config/routes.rb +9 -0
- data/doc/demo/db/development_structure.sql +15 -0
- data/doc/demo/db/migrate/001_initial_migration.rb +18 -0
- data/doc/demo/db/migrate/002_add_type_to_contents.rb +9 -0
- data/doc/demo/db/migrate/003_create_shared_index1s.rb +11 -0
- data/doc/demo/db/migrate/004_create_shared_index2s.rb +11 -0
- data/doc/demo/db/migrate/005_special_field.rb +9 -0
- data/doc/demo/db/migrate/006_create_stats.rb +15 -0
- data/doc/demo/db/schema.sql +18 -0
- data/doc/demo/doc/README_FOR_APP +2 -0
- data/doc/demo/doc/howto.txt +70 -0
- data/doc/demo/public/.htaccess +40 -0
- data/doc/demo/public/404.html +8 -0
- data/doc/demo/public/500.html +8 -0
- data/doc/demo/public/dispatch.cgi +10 -0
- data/doc/demo/public/dispatch.fcgi +24 -0
- data/doc/demo/public/dispatch.rb +10 -0
- data/doc/demo/public/favicon.ico +0 -0
- data/doc/demo/public/images/rails.png +0 -0
- data/doc/demo/public/index.html +277 -0
- data/doc/demo/public/robots.txt +1 -0
- data/doc/demo/public/stylesheets/scaffold.css +74 -0
- data/doc/demo/script/about +3 -0
- data/doc/demo/script/breakpointer +3 -0
- data/doc/demo/script/console +3 -0
- data/doc/demo/script/destroy +3 -0
- data/doc/demo/script/ferret_server +10 -0
- data/doc/demo/script/generate +3 -0
- data/doc/demo/script/performance/benchmarker +3 -0
- data/doc/demo/script/performance/profiler +3 -0
- data/doc/demo/script/plugin +3 -0
- data/doc/demo/script/process/inspector +3 -0
- data/doc/demo/script/process/reaper +3 -0
- data/doc/demo/script/process/spawner +3 -0
- data/doc/demo/script/process/spinner +3 -0
- data/doc/demo/script/runner +3 -0
- data/doc/demo/script/server +3 -0
- data/doc/demo/test/fixtures/comments.yml +12 -0
- data/doc/demo/test/fixtures/contents.yml +13 -0
- data/doc/demo/test/fixtures/remote_contents.yml +9 -0
- data/doc/demo/test/fixtures/shared_index1s.yml +7 -0
- data/doc/demo/test/fixtures/shared_index2s.yml +7 -0
- data/doc/demo/test/functional/admin/backend_controller_test.rb +35 -0
- data/doc/demo/test/functional/contents_controller_test.rb +81 -0
- data/doc/demo/test/functional/searches_controller_test.rb +71 -0
- data/doc/demo/test/smoke/drb_smoke_test.rb +321 -0
- data/doc/demo/test/smoke/process_stats.rb +21 -0
- data/doc/demo/test/test_helper.rb +30 -0
- data/doc/demo/test/unit/comment_test.rb +217 -0
- data/doc/demo/test/unit/content_test.rb +705 -0
- data/doc/demo/test/unit/ferret_result_test.rb +24 -0
- data/doc/demo/test/unit/multi_index_test.rb +329 -0
- data/doc/demo/test/unit/remote_index_test.rb +23 -0
- data/doc/demo/test/unit/shared_index1_test.rb +108 -0
- data/doc/demo/test/unit/shared_index2_test.rb +13 -0
- data/doc/demo/test/unit/sort_test.rb +21 -0
- data/doc/demo/test/unit/special_content_test.rb +25 -0
- data/doc/demo/vendor/plugins/will_paginate/LICENSE +18 -0
- data/doc/demo/vendor/plugins/will_paginate/README +108 -0
- data/doc/demo/vendor/plugins/will_paginate/Rakefile +23 -0
- data/doc/demo/vendor/plugins/will_paginate/init.rb +21 -0
- data/doc/demo/vendor/plugins/will_paginate/lib/will_paginate/collection.rb +45 -0
- data/doc/demo/vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb +44 -0
- data/doc/demo/vendor/plugins/will_paginate/lib/will_paginate/finder.rb +159 -0
- data/doc/demo/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb +95 -0
- data/doc/demo/vendor/plugins/will_paginate/test/array_pagination_test.rb +23 -0
- data/doc/demo/vendor/plugins/will_paginate/test/boot.rb +27 -0
- data/doc/demo/vendor/plugins/will_paginate/test/console +10 -0
- data/doc/demo/vendor/plugins/will_paginate/test/finder_test.rb +219 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/admin.rb +3 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/companies.yml +24 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb +23 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/developer.rb +11 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/developers_projects.yml +13 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/project.rb +4 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/projects.yml +7 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/replies.yml +20 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/reply.rb +5 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/schema.sql +44 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb +19 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/topics.yml +30 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/user.rb +2 -0
- data/doc/demo/vendor/plugins/will_paginate/test/fixtures/users.yml +35 -0
- data/doc/demo/vendor/plugins/will_paginate/test/helper.rb +42 -0
- data/doc/demo/vendor/plugins/will_paginate/test/lib/activerecord_test_connector.rb +64 -0
- data/doc/demo/vendor/plugins/will_paginate/test/lib/load_fixtures.rb +10 -0
- data/doc/demo/vendor/plugins/will_paginate/test/pagination_test.rb +136 -0
- data/init.rb +2 -0
- data/lib/act_methods.rb +50 -157
- data/lib/acts_as_ferret.rb +457 -23
- data/lib/ar_mysql_auto_reconnect_patch.rb +41 -0
- data/lib/blank_slate.rb +53 -0
- data/lib/bulk_indexer.rb +4 -1
- data/lib/class_methods.rb +106 -295
- data/lib/ferret_extensions.rb +78 -5
- data/lib/ferret_find_methods.rb +141 -0
- data/lib/ferret_result.rb +26 -9
- data/lib/ferret_server.rb +100 -65
- data/lib/index.rb +83 -15
- data/lib/instance_methods.rb +32 -17
- data/lib/local_index.rb +106 -112
- data/lib/more_like_this.rb +13 -13
- data/lib/multi_index.rb +115 -72
- data/lib/rdig_adapter.rb +148 -0
- data/lib/remote_functions.rb +43 -0
- data/lib/remote_index.rb +25 -21
- data/lib/remote_multi_index.rb +20 -0
- data/lib/search_results.rb +7 -10
- data/lib/server_manager.rb +16 -4
- data/lib/unix_daemon.rb +23 -0
- data/lib/without_ar.rb +52 -0
- data/rakefile +23 -16
- data/recipes/aaf_recipes.rb +114 -0
- data/tasks/ferret.rake +22 -0
- metadata +233 -54
- data/lib/ferret_cap_tasks.rb +0 -21
- data/lib/shared_index.rb +0 -14
- data/lib/shared_index_class_methods.rb +0 -90
data/README
CHANGED
@@ -6,24 +6,51 @@ It is heavily based on the original acts_as_ferret plugin done by
|
|
6
6
|
Kasper Weibel and a modified version done by Thomas Lockney, which
|
7
7
|
both can be found on http://ferret.davebalmain.com/trac/wiki/FerretOnRails
|
8
8
|
|
9
|
+
== Project Homepage
|
10
|
+
|
11
|
+
http://rm.jkraemer.net/projects/show/aaf
|
12
|
+
|
9
13
|
== Installation
|
10
14
|
|
15
|
+
Aaf is available via git from rubyforge.org and github.com. Github also offers
|
16
|
+
tarball downloads, check out http://github.com/jkraemer/acts_as_ferret/tree/master .
|
17
|
+
|
18
|
+
=== Installation inside your Rails > 2.1 project via gem management
|
19
|
+
|
20
|
+
Add this to your projects config/environment.rb:
|
21
|
+
|
22
|
+
<tt>config.gem 'acts_as_ferret', :version => '~> 0.4.4'</tt>
|
23
|
+
|
24
|
+
Or, use github:
|
25
|
+
|
26
|
+
<tt>config.gem 'jkraemer-acts_as_ferret', :version => '~> 0.4.4', :lib => 'acts_as_ferret', :source => 'http://gems.github.com'"</tt>
|
27
|
+
|
11
28
|
=== Installation inside your Rails project via script/plugin
|
12
29
|
|
13
|
-
script/plugin install
|
30
|
+
script/plugin install git://github.com/jkraemer/acts_as_ferret.git
|
31
|
+
|
32
|
+
The rubyforge repository is located at git://rubyforge.org/actsasferret.git
|
14
33
|
|
34
|
+
=== Old SVN repository
|
35
|
+
|
36
|
+
In november 2008 I stopped updating the svn repository that has been the main
|
37
|
+
repository for aaf for several years. In case you want to retrieve any of the
|
38
|
+
older versions of the plugin, it's still there at
|
39
|
+
|
40
|
+
svn://code.jkraemer.net/acts_as_ferret/
|
15
41
|
|
16
42
|
=== System-wide installation with Rubygems
|
17
43
|
|
18
44
|
<tt>sudo gem install acts_as_ferret</tt>
|
19
45
|
|
20
|
-
To use acts_as_ferret in your project, add the following line to your
|
46
|
+
To use acts_as_ferret in your project, add the following line to the end of your
|
21
47
|
project's config/environment.rb:
|
22
48
|
|
23
49
|
<tt>require 'acts_as_ferret'</tt>
|
24
50
|
|
25
|
-
Call the aaf_install script
|
26
|
-
config file and the drb server start/stop
|
51
|
+
Call the aaf_install script that came with the gem inside your project
|
52
|
+
directory to install the sample config file and the drb server start/stop
|
53
|
+
script.
|
27
54
|
|
28
55
|
|
29
56
|
== Usage
|
@@ -32,7 +59,7 @@ include the following in your model class (specifiying the fields you want to ge
|
|
32
59
|
|
33
60
|
<tt>acts_as_ferret :fields => [ :title, :description ]</tt>
|
34
61
|
|
35
|
-
now you can use ModelClass.
|
62
|
+
now you can use ModelClass.find_with_ferret(query) to find instances of your model
|
36
63
|
whose indexed fields match a given query. All query terms are required by default,
|
37
64
|
but explicit OR queries are possible. This differs from the ferret default, but
|
38
65
|
imho is the more often needed/expected behaviour (more query terms result in
|
@@ -49,4 +76,3 @@ Released under the MIT license.
|
|
49
76
|
* Kasper Weibel Nielsen-Refs (original author)
|
50
77
|
* Jens Kraemer <jk@jkraemer.net> (current maintainer)
|
51
78
|
|
52
|
-
|
@@ -0,0 +1,260 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: acts_as_ferret
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jens Kraemer
|
8
|
+
autorequire: acts_as_ferret
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-05-28 00:00:00 +02:00
|
13
|
+
default_executable: aaf_install
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description:
|
17
|
+
email: jk@jkraemer.net
|
18
|
+
executables:
|
19
|
+
- aaf_install
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- acts_as_ferret.gemspec
|
26
|
+
- bin
|
27
|
+
- bin/aaf_install
|
28
|
+
- config
|
29
|
+
- config/ferret_server.yml
|
30
|
+
- doc
|
31
|
+
- doc/demo
|
32
|
+
- doc/demo/app
|
33
|
+
- doc/demo/app/controllers
|
34
|
+
- doc/demo/app/controllers/admin
|
35
|
+
- doc/demo/app/controllers/admin/backend_controller.rb
|
36
|
+
- doc/demo/app/controllers/admin_area_controller.rb
|
37
|
+
- doc/demo/app/controllers/application.rb
|
38
|
+
- doc/demo/app/controllers/contents_controller.rb
|
39
|
+
- doc/demo/app/controllers/searches_controller.rb
|
40
|
+
- doc/demo/app/helpers
|
41
|
+
- doc/demo/app/helpers/admin
|
42
|
+
- doc/demo/app/helpers/admin/backend_helper.rb
|
43
|
+
- doc/demo/app/helpers/application_helper.rb
|
44
|
+
- doc/demo/app/helpers/content_helper.rb
|
45
|
+
- doc/demo/app/helpers/search_helper.rb
|
46
|
+
- doc/demo/app/models
|
47
|
+
- doc/demo/app/models/comment.rb
|
48
|
+
- doc/demo/app/models/content.rb
|
49
|
+
- doc/demo/app/models/content_base.rb
|
50
|
+
- doc/demo/app/models/search.rb
|
51
|
+
- doc/demo/app/models/shared_index1.rb
|
52
|
+
- doc/demo/app/models/shared_index2.rb
|
53
|
+
- doc/demo/app/models/special_content.rb
|
54
|
+
- doc/demo/app/models/stats.rb
|
55
|
+
- doc/demo/app/views
|
56
|
+
- doc/demo/app/views/admin
|
57
|
+
- doc/demo/app/views/admin/backend
|
58
|
+
- doc/demo/app/views/admin/backend/search.rhtml
|
59
|
+
- doc/demo/app/views/contents
|
60
|
+
- doc/demo/app/views/contents/_form.rhtml
|
61
|
+
- doc/demo/app/views/contents/edit.rhtml
|
62
|
+
- doc/demo/app/views/contents/index.rhtml
|
63
|
+
- doc/demo/app/views/contents/new.rhtml
|
64
|
+
- doc/demo/app/views/contents/show.rhtml
|
65
|
+
- doc/demo/app/views/layouts
|
66
|
+
- doc/demo/app/views/layouts/application.html.erb
|
67
|
+
- doc/demo/app/views/searches
|
68
|
+
- doc/demo/app/views/searches/_content.html.erb
|
69
|
+
- doc/demo/app/views/searches/search.html.erb
|
70
|
+
- doc/demo/config
|
71
|
+
- doc/demo/config/boot.rb
|
72
|
+
- doc/demo/config/database.yml
|
73
|
+
- doc/demo/config/environment.rb
|
74
|
+
- doc/demo/config/environments
|
75
|
+
- doc/demo/config/environments/development.rb
|
76
|
+
- doc/demo/config/environments/production.rb
|
77
|
+
- doc/demo/config/environments/test.rb
|
78
|
+
- doc/demo/config/ferret_server.yml
|
79
|
+
- doc/demo/config/lighttpd.conf
|
80
|
+
- doc/demo/config/routes.rb
|
81
|
+
- doc/demo/db
|
82
|
+
- doc/demo/db/development_structure.sql
|
83
|
+
- doc/demo/db/migrate
|
84
|
+
- doc/demo/db/migrate/001_initial_migration.rb
|
85
|
+
- doc/demo/db/migrate/002_add_type_to_contents.rb
|
86
|
+
- doc/demo/db/migrate/003_create_shared_index1s.rb
|
87
|
+
- doc/demo/db/migrate/004_create_shared_index2s.rb
|
88
|
+
- doc/demo/db/migrate/005_special_field.rb
|
89
|
+
- doc/demo/db/migrate/006_create_stats.rb
|
90
|
+
- doc/demo/db/schema.sql
|
91
|
+
- doc/demo/doc
|
92
|
+
- doc/demo/doc/howto.txt
|
93
|
+
- doc/demo/doc/README_FOR_APP
|
94
|
+
- doc/demo/log
|
95
|
+
- doc/demo/public
|
96
|
+
- doc/demo/public/.htaccess
|
97
|
+
- doc/demo/public/404.html
|
98
|
+
- doc/demo/public/500.html
|
99
|
+
- doc/demo/public/dispatch.cgi
|
100
|
+
- doc/demo/public/dispatch.fcgi
|
101
|
+
- doc/demo/public/dispatch.rb
|
102
|
+
- doc/demo/public/favicon.ico
|
103
|
+
- doc/demo/public/images
|
104
|
+
- doc/demo/public/images/rails.png
|
105
|
+
- doc/demo/public/index.html
|
106
|
+
- doc/demo/public/robots.txt
|
107
|
+
- doc/demo/public/stylesheets
|
108
|
+
- doc/demo/public/stylesheets/scaffold.css
|
109
|
+
- doc/demo/Rakefile
|
110
|
+
- doc/demo/README
|
111
|
+
- doc/demo/README_DEMO
|
112
|
+
- doc/demo/script
|
113
|
+
- doc/demo/script/about
|
114
|
+
- doc/demo/script/breakpointer
|
115
|
+
- doc/demo/script/console
|
116
|
+
- doc/demo/script/destroy
|
117
|
+
- doc/demo/script/ferret_server
|
118
|
+
- doc/demo/script/generate
|
119
|
+
- doc/demo/script/performance
|
120
|
+
- doc/demo/script/performance/benchmarker
|
121
|
+
- doc/demo/script/performance/profiler
|
122
|
+
- doc/demo/script/plugin
|
123
|
+
- doc/demo/script/process
|
124
|
+
- doc/demo/script/process/inspector
|
125
|
+
- doc/demo/script/process/reaper
|
126
|
+
- doc/demo/script/process/spawner
|
127
|
+
- doc/demo/script/process/spinner
|
128
|
+
- doc/demo/script/runner
|
129
|
+
- doc/demo/script/server
|
130
|
+
- doc/demo/test
|
131
|
+
- doc/demo/test/fixtures
|
132
|
+
- doc/demo/test/fixtures/comments.yml
|
133
|
+
- doc/demo/test/fixtures/contents.yml
|
134
|
+
- doc/demo/test/fixtures/remote_contents.yml
|
135
|
+
- doc/demo/test/fixtures/shared_index1s.yml
|
136
|
+
- doc/demo/test/fixtures/shared_index2s.yml
|
137
|
+
- doc/demo/test/functional
|
138
|
+
- doc/demo/test/functional/admin
|
139
|
+
- doc/demo/test/functional/admin/backend_controller_test.rb
|
140
|
+
- doc/demo/test/functional/contents_controller_test.rb
|
141
|
+
- doc/demo/test/functional/searches_controller_test.rb
|
142
|
+
- doc/demo/test/smoke
|
143
|
+
- doc/demo/test/smoke/drb_smoke_test.rb
|
144
|
+
- doc/demo/test/smoke/process_stats.rb
|
145
|
+
- doc/demo/test/test_helper.rb
|
146
|
+
- doc/demo/test/unit
|
147
|
+
- doc/demo/test/unit/comment_test.rb
|
148
|
+
- doc/demo/test/unit/content_test.rb
|
149
|
+
- doc/demo/test/unit/ferret_result_test.rb
|
150
|
+
- doc/demo/test/unit/multi_index_test.rb
|
151
|
+
- doc/demo/test/unit/remote_index_test.rb
|
152
|
+
- doc/demo/test/unit/shared_index1_test.rb
|
153
|
+
- doc/demo/test/unit/shared_index2_test.rb
|
154
|
+
- doc/demo/test/unit/sort_test.rb
|
155
|
+
- doc/demo/test/unit/special_content_test.rb
|
156
|
+
- doc/demo/vendor
|
157
|
+
- doc/demo/vendor/plugins
|
158
|
+
- doc/demo/vendor/plugins/will_paginate
|
159
|
+
- doc/demo/vendor/plugins/will_paginate/init.rb
|
160
|
+
- doc/demo/vendor/plugins/will_paginate/lib
|
161
|
+
- doc/demo/vendor/plugins/will_paginate/lib/will_paginate
|
162
|
+
- doc/demo/vendor/plugins/will_paginate/lib/will_paginate/collection.rb
|
163
|
+
- doc/demo/vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb
|
164
|
+
- doc/demo/vendor/plugins/will_paginate/lib/will_paginate/finder.rb
|
165
|
+
- doc/demo/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb
|
166
|
+
- doc/demo/vendor/plugins/will_paginate/LICENSE
|
167
|
+
- doc/demo/vendor/plugins/will_paginate/Rakefile
|
168
|
+
- doc/demo/vendor/plugins/will_paginate/README
|
169
|
+
- doc/demo/vendor/plugins/will_paginate/test
|
170
|
+
- doc/demo/vendor/plugins/will_paginate/test/array_pagination_test.rb
|
171
|
+
- doc/demo/vendor/plugins/will_paginate/test/boot.rb
|
172
|
+
- doc/demo/vendor/plugins/will_paginate/test/console
|
173
|
+
- doc/demo/vendor/plugins/will_paginate/test/finder_test.rb
|
174
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures
|
175
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/admin.rb
|
176
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/companies.yml
|
177
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/company.rb
|
178
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/developer.rb
|
179
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/developers_projects.yml
|
180
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/project.rb
|
181
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/projects.yml
|
182
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/replies.yml
|
183
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/reply.rb
|
184
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/schema.sql
|
185
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/topic.rb
|
186
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/topics.yml
|
187
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/user.rb
|
188
|
+
- doc/demo/vendor/plugins/will_paginate/test/fixtures/users.yml
|
189
|
+
- doc/demo/vendor/plugins/will_paginate/test/helper.rb
|
190
|
+
- doc/demo/vendor/plugins/will_paginate/test/lib
|
191
|
+
- doc/demo/vendor/plugins/will_paginate/test/lib/activerecord_test_connector.rb
|
192
|
+
- doc/demo/vendor/plugins/will_paginate/test/lib/load_fixtures.rb
|
193
|
+
- doc/demo/vendor/plugins/will_paginate/test/pagination_test.rb
|
194
|
+
- doc/monit-example
|
195
|
+
- doc/README.win32
|
196
|
+
- init.rb
|
197
|
+
- install.rb
|
198
|
+
- lib
|
199
|
+
- lib/act_methods.rb
|
200
|
+
- lib/acts_as_ferret.rb
|
201
|
+
- lib/ar_mysql_auto_reconnect_patch.rb
|
202
|
+
- lib/blank_slate.rb
|
203
|
+
- lib/bulk_indexer.rb
|
204
|
+
- lib/class_methods.rb
|
205
|
+
- lib/ferret_extensions.rb
|
206
|
+
- lib/ferret_find_methods.rb
|
207
|
+
- lib/ferret_result.rb
|
208
|
+
- lib/ferret_server.rb
|
209
|
+
- lib/index.rb
|
210
|
+
- lib/instance_methods.rb
|
211
|
+
- lib/local_index.rb
|
212
|
+
- lib/more_like_this.rb
|
213
|
+
- lib/multi_index.rb
|
214
|
+
- lib/rdig_adapter.rb
|
215
|
+
- lib/remote_functions.rb
|
216
|
+
- lib/remote_index.rb
|
217
|
+
- lib/remote_multi_index.rb
|
218
|
+
- lib/search_results.rb
|
219
|
+
- lib/server_manager.rb
|
220
|
+
- lib/unix_daemon.rb
|
221
|
+
- lib/without_ar.rb
|
222
|
+
- LICENSE
|
223
|
+
- rakefile
|
224
|
+
- README
|
225
|
+
- recipes
|
226
|
+
- recipes/aaf_recipes.rb
|
227
|
+
- script
|
228
|
+
- script/ferret_daemon
|
229
|
+
- script/ferret_server
|
230
|
+
- script/ferret_service
|
231
|
+
- tasks
|
232
|
+
- tasks/ferret.rake
|
233
|
+
has_rdoc: true
|
234
|
+
homepage: http://projects.jkraemer.net/acts_as_ferret
|
235
|
+
post_install_message:
|
236
|
+
rdoc_options: []
|
237
|
+
|
238
|
+
require_paths:
|
239
|
+
- lib
|
240
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
241
|
+
requirements:
|
242
|
+
- - ">="
|
243
|
+
- !ruby/object:Gem::Version
|
244
|
+
version: "0"
|
245
|
+
version:
|
246
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: "0"
|
251
|
+
version:
|
252
|
+
requirements: []
|
253
|
+
|
254
|
+
rubyforge_project:
|
255
|
+
rubygems_version: 1.3.1
|
256
|
+
signing_key:
|
257
|
+
specification_version: 2
|
258
|
+
summary: acts_as_ferret - Ferret based full text search for any ActiveRecord model
|
259
|
+
test_files: []
|
260
|
+
|
data/config/ferret_server.yml
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# configuration for the acts_as_ferret DRb server
|
2
2
|
# host: where to reach the DRb server (used by application processes to contact the server)
|
3
3
|
# port: which port the server should listen on
|
4
|
+
# socket: where the DRb server should create the socket (absolute path), this setting overrides host:port configuration
|
4
5
|
# pid_file: location of the server's pid file (relative to RAILS_ROOT)
|
5
6
|
# log_file: log file (default: RAILS_ROOT/log/ferret_server.log
|
6
7
|
# log_level: log level for the server's logger
|
data/doc/demo/README
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
== Welcome to Rails
|
2
|
+
|
3
|
+
|
4
|
+
Rails is a web-application and persistence framework that includes everything
|
5
|
+
needed to create database-backed web-applications according to the
|
6
|
+
Model-View-Control pattern of separation. This pattern splits the view (also
|
7
|
+
called the presentation) into "dumb" templates that are primarily responsible
|
8
|
+
for inserting pre-built data in between HTML tags. The model contains the
|
9
|
+
"smart" domain objects (such as Account, Product, Person, Post) that holds all
|
10
|
+
the business logic and knows how to persist themselves to a database. The
|
11
|
+
controller handles the incoming requests (such as Save New Account, Update
|
12
|
+
Product, Show Post) by manipulating the model and directing data to the view.
|
13
|
+
|
14
|
+
In Rails, the model is handled by what's called an object-relational mapping
|
15
|
+
layer entitled Active Record. This layer allows you to present the data from
|
16
|
+
database rows as objects and embellish these data objects with business logic
|
17
|
+
methods. You can read more about Active Record in
|
18
|
+
link:files/vendor/rails/activerecord/README.html.
|
19
|
+
|
20
|
+
The controller and view are handled by the Action Pack, which handles both
|
21
|
+
layers by its two parts: Action View and Action Controller. These two layers
|
22
|
+
are bundled in a single package due to their heavy interdependence. This is
|
23
|
+
unlike the relationship between the Active Record and Action Pack that is much
|
24
|
+
more separate. Each of these packages can be used independently outside of
|
25
|
+
Rails. You can read more about Action Pack in
|
26
|
+
link:files/vendor/rails/actionpack/README.html.
|
27
|
+
|
28
|
+
|
29
|
+
== Getting started
|
30
|
+
|
31
|
+
1. Run the WEBrick servlet: <tt>ruby script/server</tt> (run with --help for options)
|
32
|
+
...or if you have lighttpd installed: <tt>ruby script/lighttpd</tt> (it's faster)
|
33
|
+
2. Go to http://localhost:3000/ and get "Congratulations, you've put Ruby on Rails!"
|
34
|
+
3. Follow the guidelines on the "Congratulations, you've put Ruby on Rails!" screen
|
35
|
+
|
36
|
+
|
37
|
+
== Example for Apache conf
|
38
|
+
|
39
|
+
<VirtualHost *:80>
|
40
|
+
ServerName rails
|
41
|
+
DocumentRoot /path/application/public/
|
42
|
+
ErrorLog /path/application/log/server.log
|
43
|
+
|
44
|
+
<Directory /path/application/public/>
|
45
|
+
Options ExecCGI FollowSymLinks
|
46
|
+
AllowOverride all
|
47
|
+
Allow from all
|
48
|
+
Order allow,deny
|
49
|
+
</Directory>
|
50
|
+
</VirtualHost>
|
51
|
+
|
52
|
+
NOTE: Be sure that CGIs can be executed in that directory as well. So ExecCGI
|
53
|
+
should be on and ".cgi" should respond. All requests from 127.0.0.1 go
|
54
|
+
through CGI, so no Apache restart is necessary for changes. All other requests
|
55
|
+
go through FCGI (or mod_ruby), which requires a restart to show changes.
|
56
|
+
|
57
|
+
|
58
|
+
== Debugging Rails
|
59
|
+
|
60
|
+
Have "tail -f" commands running on both the server.log, production.log, and
|
61
|
+
test.log files. Rails will automatically display debugging and runtime
|
62
|
+
information to these files. Debugging info will also be shown in the browser
|
63
|
+
on requests from 127.0.0.1.
|
64
|
+
|
65
|
+
|
66
|
+
== Breakpoints
|
67
|
+
|
68
|
+
Breakpoint support is available through the script/breakpointer client. This
|
69
|
+
means that you can break out of execution at any point in the code, investigate
|
70
|
+
and change the model, AND then resume execution! Example:
|
71
|
+
|
72
|
+
class WeblogController < ActionController::Base
|
73
|
+
def index
|
74
|
+
@posts = Post.find_all
|
75
|
+
breakpoint "Breaking out from the list"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
So the controller will accept the action, run the first line, then present you
|
80
|
+
with a IRB prompt in the breakpointer window. Here you can do things like:
|
81
|
+
|
82
|
+
Executing breakpoint "Breaking out from the list" at .../webrick_server.rb:16 in 'breakpoint'
|
83
|
+
|
84
|
+
>> @posts.inspect
|
85
|
+
=> "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
|
86
|
+
#<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
|
87
|
+
>> @posts.first.title = "hello from a breakpoint"
|
88
|
+
=> "hello from a breakpoint"
|
89
|
+
|
90
|
+
...and even better is that you can examine how your runtime objects actually work:
|
91
|
+
|
92
|
+
>> f = @posts.first
|
93
|
+
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
|
94
|
+
>> f.
|
95
|
+
Display all 152 possibilities? (y or n)
|
96
|
+
|
97
|
+
Finally, when you're ready to resume execution, you press CTRL-D
|
98
|
+
|
99
|
+
|
100
|
+
== Console
|
101
|
+
|
102
|
+
You can interact with the domain model by starting the console through script/console.
|
103
|
+
Here you'll have all parts of the application configured, just like it is when the
|
104
|
+
application is running. You can inspect domain models, change values, and save to the
|
105
|
+
database. Starting the script without arguments will launch it in the development environment.
|
106
|
+
Passing an argument will specify a different environment, like <tt>console production</tt>.
|
107
|
+
|
108
|
+
|
109
|
+
== Description of contents
|
110
|
+
|
111
|
+
app
|
112
|
+
Holds all the code that's specific to this particular application.
|
113
|
+
|
114
|
+
app/controllers
|
115
|
+
Holds controllers that should be named like weblog_controller.rb for
|
116
|
+
automated URL mapping. All controllers should descend from
|
117
|
+
ActionController::Base.
|
118
|
+
|
119
|
+
app/models
|
120
|
+
Holds models that should be named like post.rb.
|
121
|
+
Most models will descend from ActiveRecord::Base.
|
122
|
+
|
123
|
+
app/views
|
124
|
+
Holds the template files for the view that should be named like
|
125
|
+
weblog/index.rhtml for the WeblogController#index action. All views use eRuby
|
126
|
+
syntax. This directory can also be used to keep stylesheets, images, and so on
|
127
|
+
that can be symlinked to public.
|
128
|
+
|
129
|
+
app/helpers
|
130
|
+
Holds view helpers that should be named like weblog_helper.rb.
|
131
|
+
|
132
|
+
config
|
133
|
+
Configuration files for the Rails environment, the routing map, the database, and other dependencies.
|
134
|
+
|
135
|
+
components
|
136
|
+
Self-contained mini-applications that can bundle together controllers, models, and views.
|
137
|
+
|
138
|
+
lib
|
139
|
+
Application specific libraries. Basically, any kind of custom code that doesn't
|
140
|
+
belong under controllers, models, or helpers. This directory is in the load path.
|
141
|
+
|
142
|
+
public
|
143
|
+
The directory available for the web server. Contains subdirectories for images, stylesheets,
|
144
|
+
and javascripts. Also contains the dispatchers and the default HTML files.
|
145
|
+
|
146
|
+
script
|
147
|
+
Helper scripts for automation and generation.
|
148
|
+
|
149
|
+
test
|
150
|
+
Unit and functional tests along with fixtures.
|
151
|
+
|
152
|
+
vendor
|
153
|
+
External libraries that the application depends on. Also includes the plugins subdirectory.
|
154
|
+
This directory is in the load path.
|