Class: TDiary::Filter::Filter
Constant Summary
collapse
- DEBUG_NONE =
0
- DEBUG_SPAM =
1
- DEBUG_FULL =
2
Instance Method Summary
collapse
Methods included from ViewHelper
#base_url, #bot?
Constructor Details
#initialize(cgi, conf) ⇒ Filter
Returns a new instance of Filter.
14
15
16
17
18
19
20
21
22
|
# File 'lib/tdiary/filter.rb', line 14
def initialize( cgi, conf )
@cgi, @conf = cgi, conf
if @conf.options.include?('filter.debug_mode')
@debug_mode = @conf.options['filter.debug_mode']
else
@debug_mode = DEBUG_NONE
end
end
|
Instance Method Details
24
25
26
|
# File 'lib/tdiary/filter.rb', line 24
def ( diary, )
true
end
|
#debug(msg, level = DEBUG_SPAM) ⇒ Object
32
33
34
35
36
37
|
# File 'lib/tdiary/filter.rb', line 32
def debug( msg, level = DEBUG_SPAM )
return if @debug_mode == DEBUG_NONE
return if @debug_mode == DEBUG_SPAM and level == DEBUG_FULL
TDiary.logger.info("#{@cgi.remote_addr}->#{(@cgi.params['date'][0] || 'no date').dump}: #{msg}")
end
|
#referer_filter(referer) ⇒ Object
28
29
30
|
# File 'lib/tdiary/filter.rb', line 28
def referer_filter( referer )
true
end
|