picky 1.0.0 → 1.1.0

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.
@@ -1,20 +0,0 @@
1
- # Standard logging.
2
- #
3
- require 'logger'
4
- PickyLog = Loggers::Search.new ::Logger.new(File.expand_path('log/search.log', PICKY_ROOT))
5
-
6
- # Example with using the syslog logger.
7
- # Falling back to the standard log if it isn't available.
8
- # (For example, because it is used locally and syslog is
9
- # only available on the servers)
10
- #
11
- # begin
12
- # log_program_name = 'search/query'
13
- # logger = SyslogLogger.new log_program_name
14
- # PickyLog = Loggers::Search.new logger
15
- # puts "Logging on syslog #{log_program_name}."
16
- # rescue StandardError
17
- # puts "Could not connect to the syslog, using the normal log."
18
- # require 'logger'
19
- # PickyLog = Loggers::Search.new ::Logger.new(File.join(PICKY_ROOT, 'log/search.log'))
20
- # end
@@ -1,35 +0,0 @@
1
- # Require the gem. This loads the search framework.
2
- #
3
- require 'picky'
4
-
5
- # Load your application. This requires the following files in
6
- #
7
- # * lib/initializers/*.rb
8
- # * lib/tokenizers/*.rb
9
- # * lib/indexers/*.rb
10
- # * lib/query/*.rb
11
- #
12
- # * app/logging.rb
13
- # * app/application.rb
14
- #
15
- # (in that order).
16
- #
17
- Loader.load_application
18
-
19
- # Load the indexes into the memory.
20
- #
21
- Indexes.load_from_cache
22
-
23
- # Use Harakiri middleware to kill worker child after X requests.
24
- #
25
- # Works only with web servers that fork worker children and which
26
- # fork new children, like for example Unicorn.
27
- #
28
- Rack::Harakiri.after = 50
29
- use Rack::Harakiri
30
-
31
- # Start accepting requests.
32
- #
33
- # Note: Needs to be the same constant name as in app/application.rb.
34
- #
35
- run PickySearch
@@ -1 +0,0 @@
1
- Logs go here by default.
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # encoding: utf-8
3
- #
4
- irb = 'irb'
5
-
6
- require 'optparse'
7
- options = { :sandbox => false, :irb => irb }
8
- OptionParser.new do |opt|
9
- opt.banner = "Usage: console [environment] [options]"
10
- opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |v| options[:irb] = v }
11
- opt.parse!(ARGV)
12
- end
13
-
14
- libs = " -r irb/completion"
15
- libs << %( -r "picky" )
16
-
17
- mapping = {
18
- 'p' => 'production',
19
- 'd' => 'development',
20
- 't' => 'test'
21
- }
22
- given_env = ARGV.first
23
- ENV['PICKY_ENV'] = mapping[given_env] || given_env || ENV['PICKY_ENV'] || 'development'
24
-
25
- puts "Use \x1b[1;30mLoader.load_application\x1b[m to load app."
26
- puts "Use \x1b[1;30mIndexes.load_from_cache\x1b[m after that to load indexes."
27
- puts "Copy the following line to do just that:"
28
- puts "\x1b[1;30mLoader.load_application; Indexes.load_from_cache; nil\x1b[m"
29
- puts ""
30
- puts "Now you can for example create a query instance."
31
- puts "\x1b[1;30mfull_books = Query::Full.new(Indexes[:books]); nil\x1b[m"
32
- puts "and search on it"
33
- puts "\x1b[1;30mfull_books.search_with_text 'bla'\x1b[m"
34
- exec "#{options[:irb]} #{libs} --simple-prompt"
File without changes
File without changes
@@ -1,15 +0,0 @@
1
- listen '0.0.0.0:8080'
2
- pid 'tmp/pids/unicorn.pid'
3
- preload_app true
4
- stderr_path 'log/unicorn.stderr.log'
5
- stdout_path 'log/unicorn.stdout.log'
6
- timeout 10
7
- worker_processes 2
8
-
9
- # After forking, the GC is disabled, because we
10
- # kill off the workers after x requests and fork
11
- # new ones – so the GC doesn't run.
12
- #
13
- after_fork do |_, _|
14
- GC.disable
15
- end