fulltext_searchable 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. data/.document +5 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +20 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.md +4 -0
  7. data/Rakefile +1 -0
  8. data/app/models/fulltext_index.rb +163 -0
  9. data/fulltext_searchable.gemspec +33 -0
  10. data/lib/fulltext_searchable/active_record.rb +208 -0
  11. data/lib/fulltext_searchable/engine.rb +4 -0
  12. data/lib/fulltext_searchable/mysql2_adapter.rb +64 -0
  13. data/lib/fulltext_searchable/version.rb +3 -0
  14. data/lib/fulltext_searchable.rb +50 -0
  15. data/lib/rails/generators/fulltext_searchable/fulltext_searchable_generator.rb +46 -0
  16. data/lib/rails/generators/fulltext_searchable/templates/initializer.rb +7 -0
  17. data/lib/rails/generators/fulltext_searchable/templates/migration.rb +9 -0
  18. data/lib/rails/generators/fulltext_searchable/templates/schema.rb +5 -0
  19. data/lib/tasks/fulltext_searchable.rake +27 -0
  20. data/spec/dummy/Rakefile +7 -0
  21. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  22. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  23. data/spec/dummy/app/models/blog.rb +7 -0
  24. data/spec/dummy/app/models/comment.rb +6 -0
  25. data/spec/dummy/app/models/news.rb +4 -0
  26. data/spec/dummy/app/models/reply.rb +4 -0
  27. data/spec/dummy/app/models/user.rb +5 -0
  28. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  29. data/spec/dummy/config/application.rb +44 -0
  30. data/spec/dummy/config/boot.rb +10 -0
  31. data/spec/dummy/config/database.yml.example +19 -0
  32. data/spec/dummy/config/environment.rb +5 -0
  33. data/spec/dummy/config/environments/development.rb +26 -0
  34. data/spec/dummy/config/environments/production.rb +49 -0
  35. data/spec/dummy/config/environments/test.rb +35 -0
  36. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  37. data/spec/dummy/config/initializers/fulltext_searchable.rb +7 -0
  38. data/spec/dummy/config/initializers/inflections.rb +10 -0
  39. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  40. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  41. data/spec/dummy/config/initializers/session_store.rb +8 -0
  42. data/spec/dummy/config/locales/en.yml +5 -0
  43. data/spec/dummy/config/routes.rb +66 -0
  44. data/spec/dummy/config.ru +4 -0
  45. data/spec/dummy/db/migrate/20110119090740_create_blogs.rb +15 -0
  46. data/spec/dummy/db/migrate/20110119090753_create_news.rb +15 -0
  47. data/spec/dummy/db/migrate/20110124031824_create_users.rb +13 -0
  48. data/spec/dummy/db/migrate/20110203091209_create_comments.rb +14 -0
  49. data/spec/dummy/db/migrate/20110215091428_create_fulltext_indices_table.rb +9 -0
  50. data/spec/dummy/public/404.html +26 -0
  51. data/spec/dummy/public/422.html +26 -0
  52. data/spec/dummy/public/500.html +26 -0
  53. data/spec/dummy/public/favicon.ico +0 -0
  54. data/spec/dummy/public/javascripts/application.js +2 -0
  55. data/spec/dummy/public/javascripts/controls.js +965 -0
  56. data/spec/dummy/public/javascripts/dragdrop.js +974 -0
  57. data/spec/dummy/public/javascripts/effects.js +1123 -0
  58. data/spec/dummy/public/javascripts/prototype.js +6001 -0
  59. data/spec/dummy/public/javascripts/rails.js +175 -0
  60. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  61. data/spec/dummy/public/stylesheets/scaffold.css +56 -0
  62. data/spec/dummy/script/rails +6 -0
  63. data/spec/fulltext_searchable_spec.rb +7 -0
  64. data/spec/models/blog_spec.rb +132 -0
  65. data/spec/models/comment_spec.rb +9 -0
  66. data/spec/models/fulltext_index_spec.rb +114 -0
  67. data/spec/models/news_spec.rb +100 -0
  68. data/spec/spec_helper.rb +44 -0
  69. data/spec/support/factories/blogs.rb +29 -0
  70. data/spec/support/factories/comments.rb +7 -0
  71. data/spec/support/factories/news.rb +23 -0
  72. data/spec/support/factories/users.rb +27 -0
  73. metadata +364 -0
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+
3
+ FactoryGirl.define do
4
+ factory :taisyaku, :class => News do
5
+ title '貸借対照表'
6
+ body '営業年度の終了時、決算において資産、負債、資本がどれだけあるかを一定のルールにのっとって財務状態を表にしたもの'
7
+ end
8
+
9
+ factory :soneki, :class => News do
10
+ title '損益計算書'
11
+ body '営業年度中の売り上げと経費、それを差し引いた利益(損失)を記載して表にしたもの'
12
+ end
13
+
14
+ factory :eigyo, :class => News do
15
+ title '営業報告書'
16
+ body '会社の営業の概況、会社の状態を報告したもの'
17
+ end
18
+
19
+ factory :rieki, :class => News do
20
+ title '利益処分案'
21
+ body '営業年度で得た利益をどのように処分したかを記載するもの'
22
+ end
23
+ end
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+
3
+ FactoryGirl.define do
4
+ factory :taro, :class => User do
5
+ name '太郎'
6
+ blogs {[ FactoryGirl.create(:today), FactoryGirl.create(:tomorrow) ]}
7
+ end
8
+
9
+ factory :jiro, :class => User do
10
+ name '次郎'
11
+ blogs {[ FactoryGirl.create(:day_after_tomorrow) ]}
12
+ end
13
+
14
+ factory :hanako, :class => User do
15
+ name '花子'
16
+ end
17
+
18
+ factory :john, :class => User do
19
+ name 'john'
20
+ blogs {[ FactoryGirl.create(:yesterday) ]}
21
+ end
22
+
23
+ factory :user do
24
+ name 'test'
25
+ blogs {(1..10).map{ FactoryGirl.create(:blog) } }
26
+ end
27
+ end
metadata ADDED
@@ -0,0 +1,364 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fulltext_searchable
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - M.Shibuya
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-06-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activerecord
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: mysql2
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: htmlentities
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: bundler
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '1.3'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '1.3'
78
+ - !ruby/object:Gem::Dependency
79
+ name: cover_me
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: database_cleaner
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: factory_girl
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: faker
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: jeweler
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: rake
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ - !ruby/object:Gem::Dependency
175
+ name: rdoc
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ - !ruby/object:Gem::Dependency
191
+ name: rspec-rails
192
+ requirement: !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ! '>='
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
206
+ description: Rails engine that provides fulltext-search capability using mroonga(formerly.
207
+ groonga storage engine). Requires Rails ~> 3.0
208
+ email:
209
+ - mit.shibuya@gmail.com
210
+ executables: []
211
+ extensions: []
212
+ extra_rdoc_files: []
213
+ files:
214
+ - .document
215
+ - .gitignore
216
+ - .rspec
217
+ - Gemfile
218
+ - LICENSE.txt
219
+ - README.md
220
+ - Rakefile
221
+ - app/models/fulltext_index.rb
222
+ - fulltext_searchable.gemspec
223
+ - lib/fulltext_searchable.rb
224
+ - lib/fulltext_searchable/active_record.rb
225
+ - lib/fulltext_searchable/engine.rb
226
+ - lib/fulltext_searchable/mysql2_adapter.rb
227
+ - lib/fulltext_searchable/version.rb
228
+ - lib/rails/generators/fulltext_searchable/fulltext_searchable_generator.rb
229
+ - lib/rails/generators/fulltext_searchable/templates/initializer.rb
230
+ - lib/rails/generators/fulltext_searchable/templates/migration.rb
231
+ - lib/rails/generators/fulltext_searchable/templates/schema.rb
232
+ - lib/tasks/fulltext_searchable.rake
233
+ - spec/dummy/Rakefile
234
+ - spec/dummy/app/controllers/application_controller.rb
235
+ - spec/dummy/app/helpers/application_helper.rb
236
+ - spec/dummy/app/models/blog.rb
237
+ - spec/dummy/app/models/comment.rb
238
+ - spec/dummy/app/models/news.rb
239
+ - spec/dummy/app/models/reply.rb
240
+ - spec/dummy/app/models/user.rb
241
+ - spec/dummy/app/views/layouts/application.html.erb
242
+ - spec/dummy/config.ru
243
+ - spec/dummy/config/application.rb
244
+ - spec/dummy/config/boot.rb
245
+ - spec/dummy/config/database.yml.example
246
+ - spec/dummy/config/environment.rb
247
+ - spec/dummy/config/environments/development.rb
248
+ - spec/dummy/config/environments/production.rb
249
+ - spec/dummy/config/environments/test.rb
250
+ - spec/dummy/config/initializers/backtrace_silencers.rb
251
+ - spec/dummy/config/initializers/fulltext_searchable.rb
252
+ - spec/dummy/config/initializers/inflections.rb
253
+ - spec/dummy/config/initializers/mime_types.rb
254
+ - spec/dummy/config/initializers/secret_token.rb
255
+ - spec/dummy/config/initializers/session_store.rb
256
+ - spec/dummy/config/locales/en.yml
257
+ - spec/dummy/config/routes.rb
258
+ - spec/dummy/db/migrate/20110119090740_create_blogs.rb
259
+ - spec/dummy/db/migrate/20110119090753_create_news.rb
260
+ - spec/dummy/db/migrate/20110124031824_create_users.rb
261
+ - spec/dummy/db/migrate/20110203091209_create_comments.rb
262
+ - spec/dummy/db/migrate/20110215091428_create_fulltext_indices_table.rb
263
+ - spec/dummy/public/404.html
264
+ - spec/dummy/public/422.html
265
+ - spec/dummy/public/500.html
266
+ - spec/dummy/public/favicon.ico
267
+ - spec/dummy/public/javascripts/application.js
268
+ - spec/dummy/public/javascripts/controls.js
269
+ - spec/dummy/public/javascripts/dragdrop.js
270
+ - spec/dummy/public/javascripts/effects.js
271
+ - spec/dummy/public/javascripts/prototype.js
272
+ - spec/dummy/public/javascripts/rails.js
273
+ - spec/dummy/public/stylesheets/.gitkeep
274
+ - spec/dummy/public/stylesheets/scaffold.css
275
+ - spec/dummy/script/rails
276
+ - spec/fulltext_searchable_spec.rb
277
+ - spec/models/blog_spec.rb
278
+ - spec/models/comment_spec.rb
279
+ - spec/models/fulltext_index_spec.rb
280
+ - spec/models/news_spec.rb
281
+ - spec/spec_helper.rb
282
+ - spec/support/factories/blogs.rb
283
+ - spec/support/factories/comments.rb
284
+ - spec/support/factories/news.rb
285
+ - spec/support/factories/users.rb
286
+ homepage: https://github.com/greenbell/fulltext_searchable
287
+ licenses:
288
+ - MIT
289
+ post_install_message:
290
+ rdoc_options: []
291
+ require_paths:
292
+ - lib
293
+ required_ruby_version: !ruby/object:Gem::Requirement
294
+ none: false
295
+ requirements:
296
+ - - ! '>='
297
+ - !ruby/object:Gem::Version
298
+ version: '0'
299
+ required_rubygems_version: !ruby/object:Gem::Requirement
300
+ none: false
301
+ requirements:
302
+ - - ! '>='
303
+ - !ruby/object:Gem::Version
304
+ version: '0'
305
+ requirements: []
306
+ rubyforge_project:
307
+ rubygems_version: 1.8.25
308
+ signing_key:
309
+ specification_version: 3
310
+ summary: Rails engine that provides fulltext-search capability using mroonga
311
+ test_files:
312
+ - spec/dummy/Rakefile
313
+ - spec/dummy/app/controllers/application_controller.rb
314
+ - spec/dummy/app/helpers/application_helper.rb
315
+ - spec/dummy/app/models/blog.rb
316
+ - spec/dummy/app/models/comment.rb
317
+ - spec/dummy/app/models/news.rb
318
+ - spec/dummy/app/models/reply.rb
319
+ - spec/dummy/app/models/user.rb
320
+ - spec/dummy/app/views/layouts/application.html.erb
321
+ - spec/dummy/config.ru
322
+ - spec/dummy/config/application.rb
323
+ - spec/dummy/config/boot.rb
324
+ - spec/dummy/config/database.yml.example
325
+ - spec/dummy/config/environment.rb
326
+ - spec/dummy/config/environments/development.rb
327
+ - spec/dummy/config/environments/production.rb
328
+ - spec/dummy/config/environments/test.rb
329
+ - spec/dummy/config/initializers/backtrace_silencers.rb
330
+ - spec/dummy/config/initializers/fulltext_searchable.rb
331
+ - spec/dummy/config/initializers/inflections.rb
332
+ - spec/dummy/config/initializers/mime_types.rb
333
+ - spec/dummy/config/initializers/secret_token.rb
334
+ - spec/dummy/config/initializers/session_store.rb
335
+ - spec/dummy/config/locales/en.yml
336
+ - spec/dummy/config/routes.rb
337
+ - spec/dummy/db/migrate/20110119090740_create_blogs.rb
338
+ - spec/dummy/db/migrate/20110119090753_create_news.rb
339
+ - spec/dummy/db/migrate/20110124031824_create_users.rb
340
+ - spec/dummy/db/migrate/20110203091209_create_comments.rb
341
+ - spec/dummy/db/migrate/20110215091428_create_fulltext_indices_table.rb
342
+ - spec/dummy/public/404.html
343
+ - spec/dummy/public/422.html
344
+ - spec/dummy/public/500.html
345
+ - spec/dummy/public/favicon.ico
346
+ - spec/dummy/public/javascripts/application.js
347
+ - spec/dummy/public/javascripts/controls.js
348
+ - spec/dummy/public/javascripts/dragdrop.js
349
+ - spec/dummy/public/javascripts/effects.js
350
+ - spec/dummy/public/javascripts/prototype.js
351
+ - spec/dummy/public/javascripts/rails.js
352
+ - spec/dummy/public/stylesheets/.gitkeep
353
+ - spec/dummy/public/stylesheets/scaffold.css
354
+ - spec/dummy/script/rails
355
+ - spec/fulltext_searchable_spec.rb
356
+ - spec/models/blog_spec.rb
357
+ - spec/models/comment_spec.rb
358
+ - spec/models/fulltext_index_spec.rb
359
+ - spec/models/news_spec.rb
360
+ - spec/spec_helper.rb
361
+ - spec/support/factories/blogs.rb
362
+ - spec/support/factories/comments.rb
363
+ - spec/support/factories/news.rb
364
+ - spec/support/factories/users.rb