forked from rob-mcgrail/ab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.rb
51 lines (44 loc) · 1.51 KB
/
settings.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
configure do
set :base_score, 1
set :super_score, 2
set :solr_log_file, 'public/logs/searches.csv'
set :solr, 'search.tki.org.nz:8983'
set :summary_length, 178
set :results_length, 5
set :unique_attempts, 7
set :default_handler, 'tki'
# A record hash containing name and xpaths for record items
# you want to display in your results.
#
# Also update views/results/item.haml
set :record_hash, {
:id => '//str[@name="id"]',
:title => '//arr[@name="title_t"]/str[1]',
:url => '//arr[@name="url"]/*',
:description => '//str[@name="description"]',
:body => '//arr[@name="attr_body_t"]/str[1]',
:ezf => '//arr[@name="ezf_df_text"]/str[1]'
}
set :method_override, false
set :sessions, true
set :logging, false # stops annoying double log messages.
set :static, false # see config.ru for dev mode satatic file serving
end
configure :development do
set :db, 'sqlite3://' + settings.root + '/db/development.sqlite3'
set :raise_errors, true
set :show_exceptions, true
set :haml, {:format => :html5, :ugly => false }
end
configure :production do
set :db, 'sqlite3://' + settings.root + '/db/production.sqlite3'
set :raise_errors, false
set :show_exceptions, false
set :haml, {:format => :html5, :ugly => true }
end
# Database;
# http://datamapper.rubyforge.org/dm-core/DataMapper.html
DataMapper.setup(:default, settings.db)
DataMapper::Property::String.length(255)
DataMapper::Property.required(true)
DataMapper::Logger.new($stdout, :info) if settings.development?