pose 0.0.3 → 0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/generators/pose_generator.rb +1 -1
- data/lib/generators/templates/migration.rb +5 -4
- data/lib/pose/railtie.rb +11 -0
- data/lib/pose/version.rb +1 -1
- data/lib/pose.rb +26 -12
- data/lib/pose_assignment.rb +25 -1
- data/lib/pose_word.rb +10 -1
- data/lib/tasks/pose_tasks.rake +12 -9
- data/spec/factories.rb +12 -0
- data/spec/pose_assignment_spec.rb +48 -0
- data/spec/pose_spec.rb +65 -48
- data/spec/pose_word_spec.rb +23 -0
- data/spec/spec_helper.rb +50 -1
- metadata +54 -14
@@ -6,7 +6,7 @@ class PoseGenerator < Rails::Generators::Base
|
|
6
6
|
source_root File.expand_path('../templates', __FILE__)
|
7
7
|
|
8
8
|
def create_migration_file
|
9
|
-
migration_template 'migration.rb', 'db/migrate/
|
9
|
+
migration_template 'migration.rb', 'db/migrate/add_pose_tables.rb'
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.next_migration_number(path)
|
@@ -1,4 +1,5 @@
|
|
1
|
-
class
|
1
|
+
class AddPoseTables < ActiveRecord::Migration
|
2
|
+
|
2
3
|
def self.up
|
3
4
|
create_table "pose_assignments" do |t|
|
4
5
|
t.integer "pose_word_id", :null => false
|
@@ -6,14 +7,14 @@ class PoseMigrations < ActiveRecord::Migration
|
|
6
7
|
t.string "posable_type", :limit => 40, :null => false
|
7
8
|
end
|
8
9
|
|
9
|
-
add_index "pose_assignments", :
|
10
|
-
add_index "pose_assignments", :
|
10
|
+
add_index "pose_assignments", :pose_word_id
|
11
|
+
add_index "pose_assignments", :posable_id
|
11
12
|
|
12
13
|
create_table "pose_words" do |t|
|
13
14
|
t.string "text", :limit => 80, :null => false
|
14
15
|
end
|
15
16
|
|
16
|
-
add_index "
|
17
|
+
add_index "pose_words", :text
|
17
18
|
end
|
18
19
|
|
19
20
|
def self.down
|
data/lib/pose/railtie.rb
ADDED
data/lib/pose/version.rb
CHANGED
data/lib/pose.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# Note (KG): Need to include the rake DSL here to prevent deprecation warnings in the Rakefile.
|
2
|
+
require 'rake'
|
3
|
+
include Rake::DSL
|
4
|
+
|
5
|
+
|
1
6
|
# Polymorphic search for ActiveRecord objects.
|
2
7
|
module Pose
|
3
8
|
extend ActiveSupport::Concern
|
@@ -7,7 +12,7 @@ module Pose
|
|
7
12
|
CONFIGURATION = { :search_in_tests => false }
|
8
13
|
|
9
14
|
included do
|
10
|
-
has_many :pose_assignments, :as => :posable
|
15
|
+
has_many :pose_assignments, :as => :posable, :dependent => :delete_all
|
11
16
|
has_many :pose_words, :through => :pose_assignments
|
12
17
|
|
13
18
|
after_save :update_pose_index
|
@@ -32,7 +37,7 @@ module Pose
|
|
32
37
|
|
33
38
|
# Removes this objects from the search index.
|
34
39
|
def delete_pose_index
|
35
|
-
self.
|
40
|
+
self.pose_words.clear if perform_search?
|
36
41
|
end
|
37
42
|
|
38
43
|
# Helper method.
|
@@ -100,7 +105,8 @@ module Pose
|
|
100
105
|
def root_word raw_word
|
101
106
|
result = []
|
102
107
|
raw_word_copy = raw_word[0..-1]
|
103
|
-
raw_word_copy.gsub!
|
108
|
+
raw_word_copy.gsub! '%20', ' '
|
109
|
+
raw_word_copy.gsub! /[()*<>'",;\?\-\=&%#]/, ' '
|
104
110
|
raw_word_copy.gsub! /\s+/, ' '
|
105
111
|
raw_word_copy.split(' ').each do |word|
|
106
112
|
if Pose.is_url?(word)
|
@@ -120,11 +126,12 @@ module Pose
|
|
120
126
|
# Returns all objects matching the given query.
|
121
127
|
#
|
122
128
|
# @param [String] query
|
123
|
-
# @param [Array<Class>] classes
|
129
|
+
# @param (Class|[Array<Class>]) classes
|
130
|
+
# @param [Number?] limit Optional limit.
|
124
131
|
#
|
125
132
|
# @return [Hash<Class, ActiveRecord::Relation>]
|
126
|
-
def search query, classes
|
127
|
-
|
133
|
+
def search query, classes, limit = nil
|
134
|
+
|
128
135
|
# Turn 'classes' into an array.
|
129
136
|
classes = [classes].flatten
|
130
137
|
classes_names = classes.map &:name
|
@@ -134,13 +141,14 @@ module Pose
|
|
134
141
|
query.split(' ').each do |query_word|
|
135
142
|
current_word_classes_and_ids = {}
|
136
143
|
classes.each { |clazz| current_word_classes_and_ids[clazz.name] = [] }
|
137
|
-
PoseAssignment.joins(:pose_word) \
|
138
|
-
|
139
|
-
|
140
|
-
|
144
|
+
query = PoseAssignment.joins(:pose_word) \
|
145
|
+
.where(:pose_words => {:text.matches => "#{query_word}%"},
|
146
|
+
:posable_type => classes_names)
|
147
|
+
query = query.limit(limit) if limit
|
148
|
+
query.each do |pose_assignment|
|
141
149
|
current_word_classes_and_ids[pose_assignment.posable_type] << pose_assignment.posable_id
|
142
150
|
end
|
143
|
-
|
151
|
+
|
144
152
|
current_word_classes_and_ids.each do |class_name, ids|
|
145
153
|
if result_classes_and_ids.has_key? class_name
|
146
154
|
result_classes_and_ids[class_name] = result_classes_and_ids[class_name] & ids
|
@@ -162,6 +170,12 @@ module Pose
|
|
162
170
|
end
|
163
171
|
end
|
164
172
|
end
|
165
|
-
end
|
173
|
+
end
|
166
174
|
end
|
167
175
|
end
|
176
|
+
|
177
|
+
|
178
|
+
require 'pose/posifier'
|
179
|
+
require "pose/railtie" if defined? Rails
|
180
|
+
require 'pose_assignment'
|
181
|
+
require 'pose_word'
|
data/lib/pose_assignment.rb
CHANGED
@@ -2,4 +2,28 @@
|
|
2
2
|
class PoseAssignment < ActiveRecord::Base
|
3
3
|
belongs_to :pose_word
|
4
4
|
belongs_to :posable, :polymorphic => true
|
5
|
-
|
5
|
+
|
6
|
+
# Removes all PoseAssignments for the given class.
|
7
|
+
def self.cleanup_class_index clazz
|
8
|
+
PoseAssignment.delete_all(['posable_type=?', clazz.name])
|
9
|
+
end
|
10
|
+
|
11
|
+
# Removes all PoseAssignments that aren't used anymore.
|
12
|
+
def self.cleanup_orphaned_pose_assignments
|
13
|
+
PoseAssignment.find_each(:include => [:posable, :pose_word], :batch_size => 5000) do |assignment|
|
14
|
+
|
15
|
+
# Delete the assignment if the posable object no longer exists.
|
16
|
+
if assignment.posable.nil?
|
17
|
+
puts "deleting assignment '#{assignment.id}' because the posable object no longer exists."
|
18
|
+
assignment.delete
|
19
|
+
next
|
20
|
+
end
|
21
|
+
|
22
|
+
# Delete the assignment if the PoseWord for it no longer exists.
|
23
|
+
if assignment.pose_word.nil?
|
24
|
+
puts "deleting assignment '#{assignment.id}' because its word no longer exists."
|
25
|
+
assignment.delete
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/pose_word.rb
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
# A single word in the search index.
|
2
2
|
class PoseWord < ActiveRecord::Base
|
3
3
|
has_many :pose_assignments
|
4
|
-
|
4
|
+
|
5
|
+
def self.remove_unused_words
|
6
|
+
PoseWord.find_each(:include => [:pose_assignments], :batch_size => 5000) do |pose_word|
|
7
|
+
if pose_word.pose_assignments.size == 0
|
8
|
+
pose_word.delete
|
9
|
+
next
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/tasks/pose_tasks.rake
CHANGED
@@ -1,18 +1,21 @@
|
|
1
|
+
include Rake::DSL
|
1
2
|
namespace :pose do
|
2
3
|
|
3
4
|
desc "Deletes and recreates the search index for all instances of the given class."
|
4
|
-
task :reindex_all, [:class_name] => :environment do
|
5
|
-
clazz = Kernel.const_get class_name
|
5
|
+
task :reindex_all, [:class_name] => [:environment] do |t, args|
|
6
|
+
clazz = Kernel.const_get args.class_name
|
7
|
+
progress_bar = ProgressBar.new " reindexing", clazz.count
|
6
8
|
clazz.find_each do |instance|
|
7
9
|
instance.update_pose_words
|
10
|
+
progress_bar.inc
|
8
11
|
end
|
12
|
+
progress_bar.finish
|
9
13
|
end
|
10
14
|
|
11
|
-
desc "Removes the search index for all instances of the given classes"
|
12
|
-
task :remove_from_index, [:class_name] => :environment do
|
13
|
-
clazz = Kernel.const_get class_name
|
14
|
-
|
15
|
-
|
16
|
-
end
|
15
|
+
desc "Removes the search index for all instances of the given classes."
|
16
|
+
task :remove_from_index, [:class_name] => :environment do |t, args|
|
17
|
+
clazz = Kernel.const_get args.class_name
|
18
|
+
PoseAssignment.cleanup_class_index clazz
|
19
|
+
puts "Search index for class #{clazz.name} deleted.\n\n"
|
17
20
|
end
|
18
|
-
end
|
21
|
+
end
|
data/spec/factories.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
Factory.define :pose_word do |word|
|
2
|
+
word.text { Faker::Lorem.words(1).first }
|
3
|
+
end
|
4
|
+
|
5
|
+
Factory.define :pose_assignment do |assignment|
|
6
|
+
assignment.association :pose_word
|
7
|
+
assignment.association :posable, :factory => :posable_one
|
8
|
+
end
|
9
|
+
|
10
|
+
Factory.define :posable_one do |posable|
|
11
|
+
posable.text { Faker::Lorem.words(3).join ' ' }
|
12
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe PoseAssignment do
|
4
|
+
|
5
|
+
before :each do
|
6
|
+
PoseAssignment.delete_all
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "cleanup_class_index" do
|
10
|
+
|
11
|
+
before :each do
|
12
|
+
Factory :pose_assignment, :posable_id => 1, :posable_type => 'PosableOne'
|
13
|
+
Factory :pose_assignment, :posable_id => 2, :posable_type => 'PosableTwo'
|
14
|
+
PoseAssignment.cleanup_class_index PosableOne
|
15
|
+
end
|
16
|
+
|
17
|
+
it "deletes all PoseAssignments for the given class" do
|
18
|
+
PoseAssignment.where(:posable_type => 'PosableOne').should have(0).items
|
19
|
+
end
|
20
|
+
|
21
|
+
it "doesn't delete PoseAssignments for other classes" do
|
22
|
+
PoseAssignment.where(:posable_type => 'PosableTwo').should have(1).items
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "cleanup_orphaned_pose_assignments" do
|
27
|
+
|
28
|
+
it "deletes the assignment if the posable object doesn't exist" do
|
29
|
+
Factory :pose_assignment, :posable_id => 2, :posable_type => 'PosableOne'
|
30
|
+
PoseAssignment.count.should > 0
|
31
|
+
PoseAssignment.cleanup_orphaned_pose_assignments
|
32
|
+
PoseAssignment.should have(0).items
|
33
|
+
end
|
34
|
+
|
35
|
+
it "deletes the assignment if the pose_word doesn't exist" do
|
36
|
+
assignment = Factory :pose_assignment, :pose_word => nil, :pose_word_id => 27
|
37
|
+
PoseAssignment.cleanup_orphaned_pose_assignments
|
38
|
+
PoseAssignment.find_by_id(assignment.id).should be_nil
|
39
|
+
end
|
40
|
+
|
41
|
+
it "doesn't delete the assignment if it is still used" do
|
42
|
+
assignment = Factory :pose_assignment
|
43
|
+
PoseAssignment.cleanup_orphaned_pose_assignments
|
44
|
+
PoseAssignment.find_by_id(assignment.id).should_not be_nil
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
data/spec/pose_spec.rb
CHANGED
@@ -1,57 +1,11 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require "spec_helper"
|
2
4
|
|
3
5
|
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
|
4
6
|
|
5
|
-
class PosableOne < ActiveRecord::Base
|
6
|
-
posify { [text] }
|
7
|
-
end
|
8
|
-
|
9
|
-
class PosableTwo < ActiveRecord::Base
|
10
|
-
posify { [text] }
|
11
|
-
end
|
12
|
-
|
13
|
-
def setup_db
|
14
|
-
ActiveRecord::Schema.define(:version => 1) do
|
15
|
-
|
16
|
-
create_table 'posable_ones' do |t|
|
17
|
-
t.string 'text'
|
18
|
-
end
|
19
|
-
|
20
|
-
create_table 'posable_twos' do |t|
|
21
|
-
t.string 'text'
|
22
|
-
end
|
23
|
-
|
24
|
-
create_table "pose_assignments" do |t|
|
25
|
-
t.integer "pose_word_id", :null => false
|
26
|
-
t.integer "posable_id", :null => false
|
27
|
-
t.string "posable_type", :limit => 20, :null => false
|
28
|
-
end
|
29
|
-
|
30
|
-
create_table "pose_words" do |t|
|
31
|
-
t.string "text", :limit => 80, :null => false
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def teardown_db
|
37
|
-
ActiveRecord::Base.connection.tables.each do |table|
|
38
|
-
ActiveRecord::Base.connection.drop_table(table)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
|
43
7
|
describe Pose do
|
44
8
|
subject { PosableOne.new }
|
45
|
-
|
46
|
-
before :all do
|
47
|
-
setup_db
|
48
|
-
Pose::CONFIGURATION[:search_in_tests] = true
|
49
|
-
end
|
50
|
-
|
51
|
-
after :all do
|
52
|
-
teardown_db
|
53
|
-
Pose::CONFIGURATION[:search_in_tests] = false
|
54
|
-
end
|
55
9
|
|
56
10
|
before :each do
|
57
11
|
PosableOne.delete_all
|
@@ -181,6 +135,69 @@ describe Pose do
|
|
181
135
|
end
|
182
136
|
end
|
183
137
|
|
138
|
+
|
139
|
+
describe 'root_word' do
|
140
|
+
|
141
|
+
it 'converts words into singular' do
|
142
|
+
Pose.root_word('bars').should eql(['bar'])
|
143
|
+
end
|
144
|
+
|
145
|
+
it 'removes special characters' do
|
146
|
+
Pose.root_word('(bar').should eql(['bar'])
|
147
|
+
Pose.root_word('bar)').should eql(['bar'])
|
148
|
+
Pose.root_word('(bar)').should eql(['bar'])
|
149
|
+
Pose.root_word('>foo').should eql(['foo'])
|
150
|
+
Pose.root_word('<foo').should eql(['foo'])
|
151
|
+
Pose.root_word('"foo"').should eql(['foo'])
|
152
|
+
Pose.root_word('"foo').should eql(['foo'])
|
153
|
+
Pose.root_word("'foo'").should eql(['foo'])
|
154
|
+
Pose.root_word("'foo's").should eql(['foo'])
|
155
|
+
Pose.root_word("foo?").should eql(['foo'])
|
156
|
+
Pose.root_word("foo!").should eql(['foo'])
|
157
|
+
Pose.root_word("foo/bar").should eql(['foo', 'bar'])
|
158
|
+
Pose.root_word("foo-bar").should eql(['foo', 'bar'])
|
159
|
+
Pose.root_word("foo--bar").should eql(['foo', 'bar'])
|
160
|
+
Pose.root_word("foo.bar").should eql(['foo', 'bar'])
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'removes umlauts' do
|
164
|
+
Pose.root_word('fünf').should eql(['funf'])
|
165
|
+
end
|
166
|
+
|
167
|
+
it 'splits up numbers' do
|
168
|
+
Pose.root_word('11.2.2011').should eql(['11', '2', '2011'])
|
169
|
+
Pose.root_word('11-2-2011').should eql(['11', '2', '2011'])
|
170
|
+
Pose.root_word('30:4-5').should eql(['30', '4', '5'])
|
171
|
+
end
|
172
|
+
|
173
|
+
it 'converts into lowercase' do
|
174
|
+
Pose.root_word('London').should eql(['london'])
|
175
|
+
end
|
176
|
+
|
177
|
+
it "stores single-letter words" do
|
178
|
+
Pose.root_word('a b').should eql(['a', 'b'])
|
179
|
+
end
|
180
|
+
|
181
|
+
it "does't encode external URLs" do
|
182
|
+
Pose.root_word('http://web.com').should eql(['http', 'web', 'com'])
|
183
|
+
end
|
184
|
+
|
185
|
+
it "doesn't store empty words" do
|
186
|
+
Pose.root_word(' one two ').should eql(['one', 'two'])
|
187
|
+
end
|
188
|
+
|
189
|
+
it "removes duplicates" do
|
190
|
+
Pose.root_word('one_one').should eql(['one'])
|
191
|
+
Pose.root_word('one one').should eql(['one'])
|
192
|
+
end
|
193
|
+
|
194
|
+
it "splits up complex URLs" do
|
195
|
+
Pose.root_word('books?id=p7uyWPcVGZsC&dq=closure%20definitive%20guide&pg=PP1#v=onepage&q&f=false').should eql([
|
196
|
+
"book", "id", "p7uywpcvgzsc", "dq", "closure", "definitive", "guide", "pg", "pp1", "v", "onepage", "q", "f", "false"])
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
|
184
201
|
describe 'search' do
|
185
202
|
|
186
203
|
it 'works' do
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe PoseWord do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
PoseWord.delete_all
|
7
|
+
end
|
8
|
+
|
9
|
+
describe 'remove_unused_words' do
|
10
|
+
|
11
|
+
it 'removes unused words' do
|
12
|
+
Factory :pose_word
|
13
|
+
PoseWord.remove_unused_words
|
14
|
+
PoseWord.count.should == 0
|
15
|
+
end
|
16
|
+
|
17
|
+
it "doesn't remove used words" do
|
18
|
+
snippet = Factory :posable_one
|
19
|
+
PoseWord.remove_unused_words
|
20
|
+
PoseWord.count.should > 0
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -11,6 +11,9 @@ require 'pose_assignment.rb'
|
|
11
11
|
require "pose/posifier.rb"
|
12
12
|
require 'active_support/core_ext/string'
|
13
13
|
require 'meta_where'
|
14
|
+
require 'faker'
|
15
|
+
require 'factory_girl'
|
16
|
+
FactoryGirl.find_definitions
|
14
17
|
|
15
18
|
# Configure Rails Environment
|
16
19
|
ENV["RAILS_ENV"] = "test"
|
@@ -21,7 +24,6 @@ Rails = Hashie::Mash.new({:env => 'test'})
|
|
21
24
|
|
22
25
|
|
23
26
|
# Load support files
|
24
|
-
#Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
25
27
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
26
28
|
#Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
27
29
|
|
@@ -40,6 +42,15 @@ RSpec.configure do |config|
|
|
40
42
|
# examples within a transaction, remove the following line or assign false
|
41
43
|
# instead of true.
|
42
44
|
# config.use_transactional_fixtures = true
|
45
|
+
|
46
|
+
config.before :suite do
|
47
|
+
setup_db
|
48
|
+
Pose::CONFIGURATION[:search_in_tests] = true
|
49
|
+
end
|
50
|
+
|
51
|
+
config.after :suite do
|
52
|
+
teardown_db
|
53
|
+
end
|
43
54
|
end
|
44
55
|
|
45
56
|
# Verifies that a taggable object has the given tags.
|
@@ -58,3 +69,41 @@ RSpec::Matchers.define :have_pose_words do |expected|
|
|
58
69
|
"expected that subject would have pose words [#{expected.join ', '}], but it has [#{texts.join ', '}]"
|
59
70
|
end
|
60
71
|
end
|
72
|
+
|
73
|
+
|
74
|
+
class PosableOne < ActiveRecord::Base
|
75
|
+
posify { text }
|
76
|
+
end
|
77
|
+
|
78
|
+
class PosableTwo < ActiveRecord::Base
|
79
|
+
posify { text }
|
80
|
+
end
|
81
|
+
|
82
|
+
def setup_db
|
83
|
+
ActiveRecord::Schema.define(:version => 1) do
|
84
|
+
|
85
|
+
create_table 'posable_ones' do |t|
|
86
|
+
t.string 'text'
|
87
|
+
end
|
88
|
+
|
89
|
+
create_table 'posable_twos' do |t|
|
90
|
+
t.string 'text'
|
91
|
+
end
|
92
|
+
|
93
|
+
create_table "pose_assignments" do |t|
|
94
|
+
t.integer "pose_word_id", :null => false
|
95
|
+
t.integer "posable_id", :null => false
|
96
|
+
t.string "posable_type", :limit => 20, :null => false
|
97
|
+
end
|
98
|
+
|
99
|
+
create_table "pose_words" do |t|
|
100
|
+
t.string "text", :limit => 80, :null => false
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def teardown_db
|
106
|
+
ActiveRecord::Base.connection.tables.each do |table|
|
107
|
+
ActiveRecord::Base.connection.drop_table(table)
|
108
|
+
end
|
109
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-16 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70285165402800 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70285165402800
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: meta_where
|
27
|
-
requirement: &
|
27
|
+
requirement: &70285165402380 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70285165402380
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70285165401920 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,43 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70285165401920
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: ruby-progressbar
|
49
|
+
requirement: &70285165401500 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70285165401500
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: factory_girl
|
60
|
+
requirement: &70285165401080 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70285165401080
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: faker
|
71
|
+
requirement: &70285165400660 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70285165400660
|
47
80
|
- !ruby/object:Gem::Dependency
|
48
81
|
name: hashie
|
49
|
-
requirement: &
|
82
|
+
requirement: &70285165400240 !ruby/object:Gem::Requirement
|
50
83
|
none: false
|
51
84
|
requirements:
|
52
85
|
- - ! '>='
|
@@ -54,10 +87,10 @@ dependencies:
|
|
54
87
|
version: '0'
|
55
88
|
type: :development
|
56
89
|
prerelease: false
|
57
|
-
version_requirements: *
|
90
|
+
version_requirements: *70285165400240
|
58
91
|
- !ruby/object:Gem::Dependency
|
59
92
|
name: rspec
|
60
|
-
requirement: &
|
93
|
+
requirement: &70285165399820 !ruby/object:Gem::Requirement
|
61
94
|
none: false
|
62
95
|
requirements:
|
63
96
|
- - ! '>='
|
@@ -65,10 +98,10 @@ dependencies:
|
|
65
98
|
version: '0'
|
66
99
|
type: :development
|
67
100
|
prerelease: false
|
68
|
-
version_requirements: *
|
101
|
+
version_requirements: *70285165399820
|
69
102
|
- !ruby/object:Gem::Dependency
|
70
103
|
name: sqlite3
|
71
|
-
requirement: &
|
104
|
+
requirement: &70285165399400 !ruby/object:Gem::Requirement
|
72
105
|
none: false
|
73
106
|
requirements:
|
74
107
|
- - ! '>='
|
@@ -76,7 +109,7 @@ dependencies:
|
|
76
109
|
version: '0'
|
77
110
|
type: :development
|
78
111
|
prerelease: false
|
79
|
-
version_requirements: *
|
112
|
+
version_requirements: *70285165399400
|
80
113
|
description: Pose ('Polymorphic Search') allows fulltext search for ActiveRecord objects.
|
81
114
|
email:
|
82
115
|
- kevin.goslar@gmail.com
|
@@ -106,6 +139,7 @@ files:
|
|
106
139
|
- lib/generators/pose_generator.rb
|
107
140
|
- lib/generators/templates/migration.rb
|
108
141
|
- lib/pose/posifier.rb
|
142
|
+
- lib/pose/railtie.rb
|
109
143
|
- lib/pose/version.rb
|
110
144
|
- lib/pose.rb
|
111
145
|
- lib/pose_assignment.rb
|
@@ -114,7 +148,10 @@ files:
|
|
114
148
|
- MIT-LICENSE
|
115
149
|
- Rakefile
|
116
150
|
- README.markdown
|
151
|
+
- spec/factories.rb
|
152
|
+
- spec/pose_assignment_spec.rb
|
117
153
|
- spec/pose_spec.rb
|
154
|
+
- spec/pose_word_spec.rb
|
118
155
|
- spec/spec_helper.rb
|
119
156
|
homepage: http://github.com/kevgo/pose
|
120
157
|
licenses: []
|
@@ -141,6 +178,9 @@ signing_key:
|
|
141
178
|
specification_version: 3
|
142
179
|
summary: A polymorphic, storage-system independent search engine for Ruby on Rails.
|
143
180
|
test_files:
|
181
|
+
- spec/factories.rb
|
182
|
+
- spec/pose_assignment_spec.rb
|
144
183
|
- spec/pose_spec.rb
|
184
|
+
- spec/pose_word_spec.rb
|
145
185
|
- spec/spec_helper.rb
|
146
186
|
has_rdoc:
|