smart_search 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 869d08c2cff4be98569eb734dfdce5d675807fc2
4
- data.tar.gz: bc6139fd0e37f7c0fc5c9d74d056d91a5132d6e6
3
+ metadata.gz: c08e3ef5c746dc3f5b7c2f0a7d701f300959c3e2
4
+ data.tar.gz: 568bda297c771f7463564c08a45e9d0100394dd9
5
5
  SHA512:
6
- metadata.gz: 4d195f3d1ab9c0a5a7317ffc5412b4708ad440aa10e05079e5729ee3865866f79f0ddd820634ed189920811e859f6f72b648aa655a4d83ff261885a72872772f
7
- data.tar.gz: 31f672e5448d8b491016c132f34b7288b8e057b8b98e039466c83a89d564b99c0c7781ece2812005c4e50dbff6871aa19facf20c0a378bda0ea26023f04a5cb1
6
+ metadata.gz: 14bf84d39e24dfe58175ff354bf2ddf5600e26ba60be773fcdaf7a88f796f11e3e5beb431b6cb65f943d62d2ced70438eadf3b981f62c6e3771a9e774a2593a5
7
+ data.tar.gz: 95941557d79b6979a41c5df85d675da72a09bb54036708a321a97b4e4c2b1b8558ae038db04b7455ced7456fdff86094b4d11bed5af9514a21e22361ba78a535
@@ -1,10 +1,12 @@
1
- # :nodoc:
2
1
  module SmartSearch
3
- require "rails"
4
- # :nodoc:
5
- class SmartSearchEngine < Rails::Engine
2
+ class Engine < Rails::Engine
3
+
4
+ engine_name 'smart_search'
5
+
6
6
  isolate_namespace SmartSearch
7
7
  require "friendly_extensions"
8
8
  require "amatch"
9
- end
10
- end
9
+
10
+ end
11
+ end
12
+
data/lib/smart_search.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  require "rails"
3
3
 
4
4
  require "smart_search"
5
- require "smart_search/smart_search_engine"
5
+ require "smart_search/engine"
6
6
 
7
7
  require "smart_similarity"
8
8
  require "smart_search_history"
@@ -5,18 +5,6 @@ namespace :smart_search do
5
5
  SmartSimilarity.load_from_query_history
6
6
  end
7
7
 
8
- desc "Load similarity data from file - Use FILE=path/to/file to specify file"
9
- task :similarity_from_file => :environment do
10
- require File.expand_path("../../smart_similarity", __FILE__)
11
- if ENV['FILE_PATH'].nil?
12
- raise ArgumentError, "No file specified. "
13
- elsif !File.exist?(ENV['FILE_PATH'])
14
- raise ArgumentError, "File not found "
15
- else
16
- SmartSimilarity.load_file(ENV['FILE_PATH'])
17
- end
18
- end
19
-
20
8
  desc "Load similarity data from url - Use URL=http://.../ to specify url - Requires 'curl'"
21
9
  task :similarity_from_url => :environment do
22
10
  require File.expand_path("../../smart_similarity", __FILE__)
@@ -27,32 +15,6 @@ namespace :smart_search do
27
15
  end
28
16
  end
29
17
 
30
-
31
-
32
- desc "load ignore words list"
33
- task :load_ignore_words => :environment do
34
- require File.expand_path("../../smart_search_ignore_word", __FILE__)
35
-
36
- dic_path = File.expand_path("../../../dictionaries/*", __FILE__)
37
-
38
- raise dic_path.inspect
39
-
40
- dic_folders = Dir.glob(dic_path).select {|d| File.directory?(d)}
41
-
42
- dic_folders.each do |folder|
43
- locale = folder.split("/").last
44
- word_file = File.join(folder, "#{locale}.ignore_words.dic")
45
- if File.exists?(word_file)
46
- File.open(word_file, "r").each_line do |word|
47
- SmartSearchIgnoreWord.create(:word => word.strip.downcase, :locale => locale)
48
- end
49
- end
50
- end
51
- end
52
-
53
-
54
-
55
-
56
18
  end
57
19
 
58
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Eck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-12 00:00:00.000000000 Z
11
+ date: 2017-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -77,9 +77,8 @@ files:
77
77
  - config/database.yml
78
78
  - config/routes.rb
79
79
  - lib/smart_search.rb
80
- - lib/smart_search/smart_search_engine.rb
80
+ - lib/smart_search/engine.rb
81
81
  - lib/smart_search_history.rb
82
- - lib/smart_search_ignore_word.rb
83
82
  - lib/smart_search_tag.rb
84
83
  - lib/smart_similarity.rb
85
84
  - lib/tasks/smart_search.rake
@@ -1,30 +0,0 @@
1
- # The keep words out of the index, they can be added into this table
2
- # TODO: Its not working yet
3
- class SmartSearchIgnoreWord < ActiveRecord::Base
4
-
5
- #= Configuration
6
- self.table_name = "smart_search_ignore_words"
7
- #== Associations
8
- # => Stuff in Here
9
-
10
- #== Plugins and modules
11
- #=== PlugIns
12
- # => Stuff in Here
13
-
14
- #=== include Modules
15
- # => Stuff in Here
16
-
17
- #== Konstanten
18
- # => Stuff in Here
19
-
20
- #== Validation and Callbacks
21
- #=== Validation
22
- validates_uniqueness_of :word
23
-
24
- #=== Callbacks
25
- # => Stuff in Here
26
-
27
-
28
- # => END
29
-
30
- end