clamav 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/ChangeLog +5 -0
  2. data/TODO +4 -0
  3. data/VERSION +1 -1
  4. data/clamav.gemspec +5 -3
  5. data/ext/clamav/clamav.c +10 -4
  6. metadata +5 -3
data/ChangeLog CHANGED
@@ -1,5 +1,10 @@
1
1
  ChangeLog
2
2
 
3
+ Tue May 18 15:30:00 MSK 2010
4
+ ----------------------------
5
+ V 0.4.1
6
+ * Raise error when scanfile() before loaddb()
7
+
3
8
  Fri Apr 23 19:31:00 MSK 2010
4
9
  ----------------------------
5
10
  V 0.4.0
data/TODO ADDED
@@ -0,0 +1,4 @@
1
+ TODO
2
+
3
+ * Switch to FFI
4
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -5,22 +5,24 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{clamav}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexander Oryol"]
12
- s.date = %q{2010-04-23}
12
+ s.date = %q{2010-05-18}
13
13
  s.description = %q{ClamAV Ruby bindings}
14
14
  s.email = %q{eagle.alex@gmail.com}
15
15
  s.extensions = ["ext/clamav/extconf.rb"]
16
16
  s.extra_rdoc_files = [
17
17
  "ChangeLog",
18
- "README.rdoc"
18
+ "README.rdoc",
19
+ "TODO"
19
20
  ]
20
21
  s.files = [
21
22
  ".gitignore",
22
23
  "ChangeLog",
23
24
  "README.rdoc",
25
+ "TODO",
24
26
  "VERSION",
25
27
  "clamav.gemspec",
26
28
  "ext/clamav/clamav.c",
@@ -13,9 +13,11 @@ struct ClamAV_R {
13
13
 
14
14
  static void clamavr_free(struct ClamAV_R *ptr) {
15
15
  int ret;
16
- ret = cl_engine_free(ptr->root);
17
- if(ret != CL_SUCCESS) {
18
- rb_raise(rb_eRuntimeError, "cl_engine_free() error: %s\n", cl_strerror(ret));
16
+ if(ptr->root != NULL) {
17
+ ret = cl_engine_free(ptr->root);
18
+ if(ret != CL_SUCCESS) {
19
+ rb_raise(rb_eRuntimeError, "cl_engine_free() error: %s\n", cl_strerror(ret));
20
+ }
19
21
  }
20
22
  xfree(ptr);
21
23
  }
@@ -81,7 +83,7 @@ static VALUE clamavr_loaddb(int argc, VALUE *argv, VALUE self) {
81
83
  rb_scan_args(argc, argv, "01", &v_db_options);
82
84
 
83
85
  if(NIL_P(v_db_options)){
84
- v_db_options = INT2FIX(CL_DB_STDOPT); /* default value */
86
+ v_db_options = INT2FIX(CL_DB_STDOPT); /* default value */
85
87
  }
86
88
 
87
89
  if(ptr->root != NULL) {
@@ -208,6 +210,10 @@ static VALUE clamavr_scanfile(int argc, VALUE *argv, VALUE klass) {
208
210
  VALUE v_options;
209
211
  rb_scan_args(argc, argv, "11", &v_fname, &v_options);
210
212
 
213
+ if(ptr->root == NULL) {
214
+ rb_raise(rb_eRuntimeError, "ClamAV error: you should call loaddb() before scanning\n");
215
+ }
216
+
211
217
  if(NIL_P(v_options)){
212
218
  v_options = ptr->options; /* stored value */
213
219
  }
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 0
9
- version: 0.4.0
8
+ - 1
9
+ version: 0.4.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alexander Oryol
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-23 00:00:00 +04:00
17
+ date: 2010-05-18 00:00:00 +04:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -27,10 +27,12 @@ extensions:
27
27
  extra_rdoc_files:
28
28
  - ChangeLog
29
29
  - README.rdoc
30
+ - TODO
30
31
  files:
31
32
  - .gitignore
32
33
  - ChangeLog
33
34
  - README.rdoc
35
+ - TODO
34
36
  - VERSION
35
37
  - clamav.gemspec
36
38
  - ext/clamav/clamav.c