dansguardian 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +10 -2
- data/lib/dansguardian.rb +1 -1
- data/lib/dansguardian/config.rb +3 -0
- data/lib/dansguardian/config/main.rb +10 -28
- data/lib/dansguardian/updater.rb +8 -3
- metadata +3 -3
data/Changelog
CHANGED
@@ -1,6 +1,14 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1 (2011-02-24)
|
2
2
|
|
3
|
-
*
|
3
|
+
* add sqlauthdbuser
|
4
|
+
* multiple-values params fixes
|
5
|
+
* do not overengineer: leave KiB as KiB
|
6
|
+
* main: fix weightedphrasemode map
|
7
|
+
* default values for Array params
|
8
|
+
|
9
|
+
0.5.0 (2011-02-21)
|
10
|
+
|
11
|
+
* SQLAuth plugin support plus various fixes
|
4
12
|
|
5
13
|
0.4.1 (2011-02-20)
|
6
14
|
|
data/lib/dansguardian.rb
CHANGED
data/lib/dansguardian/config.rb
CHANGED
@@ -3,6 +3,9 @@ require 'dansguardian/config/filtergroup'
|
|
3
3
|
|
4
4
|
module DansGuardian
|
5
5
|
class Config
|
6
|
+
|
7
|
+
autoload :Auth, 'dansguardian/config/auth'
|
8
|
+
|
6
9
|
# +arg+ May be +String+-like (the main config file name) or +Hash+-like :
|
7
10
|
#
|
8
11
|
# DansGuardian::Config.new('path/to/dansguardian.conf')
|
@@ -96,7 +96,7 @@ module DansGuardian
|
|
96
96
|
parameter :showweightedfound, BOOL
|
97
97
|
|
98
98
|
parameter :weightedphrasemode,
|
99
|
-
'0' =>
|
99
|
+
'0' => :disabled,
|
100
100
|
'1' => :normal,
|
101
101
|
'2' => :singular
|
102
102
|
|
@@ -137,36 +137,13 @@ module DansGuardian
|
|
137
137
|
|
138
138
|
parameter :createlistcachefiles, BOOL
|
139
139
|
|
140
|
-
parameter :maxuploadsize
|
141
|
-
case str
|
142
|
-
when '-1'
|
143
|
-
-1 # should be easily interpreted as 'unlimited'
|
144
|
-
else
|
145
|
-
str.to_i * 1024
|
146
|
-
end
|
147
|
-
end
|
140
|
+
parameter :maxuploadsize, :to_i # KiB
|
148
141
|
|
149
|
-
parameter :maxcontentfiltersize
|
150
|
-
case str
|
151
|
-
when '0'
|
152
|
-
lambda {|confdata| confdata[:maxcontentramcachescansize]}
|
153
|
-
else
|
154
|
-
str.to_i * 1024
|
155
|
-
end
|
156
|
-
end
|
142
|
+
parameter :maxcontentfiltersize, :to_i # KiB
|
157
143
|
|
158
|
-
parameter :maxcontentramcachescansize
|
159
|
-
case str
|
160
|
-
when '0'
|
161
|
-
lambda {|confdata| confdata[:maxcontentfilecachescansize]}
|
162
|
-
else
|
163
|
-
str.to_i * 1024
|
164
|
-
end
|
165
|
-
end
|
144
|
+
parameter :maxcontentramcachescansize, :to_i # KiB
|
166
145
|
|
167
|
-
parameter :maxcontentfilecachescansize
|
168
|
-
str.to_i * 1024
|
169
|
-
end
|
146
|
+
parameter :maxcontentfilecachescansize, :to_i # KiB
|
170
147
|
|
171
148
|
parameter :filecachedir
|
172
149
|
|
@@ -180,8 +157,13 @@ module DansGuardian
|
|
180
157
|
# You don't really need to lazy-evaluate (short) Arrays
|
181
158
|
#
|
182
159
|
parameter :downloadmanager # Array
|
160
|
+
default :downloadmanager, []
|
161
|
+
|
183
162
|
parameter :contentscanner # Array
|
163
|
+
default :contentscanner, []
|
164
|
+
|
184
165
|
parameter :authplugin # Array
|
166
|
+
default :authplugin, []
|
185
167
|
|
186
168
|
parameter :contentscannertimeout, :to_i
|
187
169
|
default :contentscannertimeout, 60
|
data/lib/dansguardian/updater.rb
CHANGED
@@ -76,10 +76,15 @@ module DansGuardian
|
|
76
76
|
(data[k.to_s] || data[k.to_sym]) == :remove!
|
77
77
|
end
|
78
78
|
if to_be_written.length > 0
|
79
|
-
yield ""
|
80
|
-
yield "# Added by ::#{self} :"
|
81
79
|
to_be_written.each do |k|
|
82
|
-
|
80
|
+
v = data[k] || data[k.to_s]
|
81
|
+
if v.respond_to? :each
|
82
|
+
v.each do |val|
|
83
|
+
yield "#{k} = #{val}"
|
84
|
+
end
|
85
|
+
else
|
86
|
+
yield "#{k} = #{v}"
|
87
|
+
end
|
83
88
|
end
|
84
89
|
end
|
85
90
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 1
|
9
|
+
version: 0.5.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Guido De Rosa
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-02-
|
17
|
+
date: 2011-02-24 00:00:00 +00:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|