clamby 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54d701d8ec2b45e261d3dbefe597ab895b9bce15
4
- data.tar.gz: 8e8525b5ab0d48afc23481b784ae27b806aca770
3
+ metadata.gz: e9fd8ce4dbb727390a6c41672ce701ef9ede81a4
4
+ data.tar.gz: 69585a26d1f9f8de1f279b15a0980226c687f0b9
5
5
  SHA512:
6
- metadata.gz: adddc3d8c9b27140905c7dedcfc4cf2f372e88afc8baa1da876b72ed65fbff929b66c85afda0fbd6eedf0be0ccf3edd93f2c6fd939c8050c8daf8368238c9213
7
- data.tar.gz: cf9f421d3303f4eef88b3a5538bd732c603cd1f9cba08fc9f8c46e68e8a12357811acac4ec2aaceceaaf1cd4553d4e5963a18525834de6134d636f32f85f2ff5
6
+ metadata.gz: 4492b45533ef3e967f818746a43742e9a525d333a91bf88c413c98d88bc6ac1fced3f0d98b89009369f68d1284df90f786ab7fada2f19d414afa5c91c8d9233a
7
+ data.tar.gz: a5176fddef6a09a0e4c3d801818064984ce368563bf94ccc141b26cdd93e0a69232a6a43a248b49c8858a4fa6def05b0f684b75423279069df9bc27dff744d8c
@@ -1,3 +1,9 @@
1
+ #v1.0.5
2
+ - Made default virus detection not throw a warning
3
+ - If scanning a file that doesn't exist, `scan(path)` will return nil.
4
+ - If scanning a file where `clamscan` doesn't exist, `scan(path)` will return nil.
5
+ - Added test for nil result on scanning a file that doesn't exist
6
+
1
7
  #v1.0.4
2
8
  - Added tests. This WILL download a file with a virus signature. It is a safe file, but is used for the purposes of testing the detection of a virus. Regardless, use caution when running rspec as this could be potentially harmful (doubtful, but be warned).
3
9
 
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # Clamby
1
+ ![Clamby Logo](https://raw.github.com/kobaltz/clamby/master/clamby_logo.png)
2
+
2
3
  [![GemVersion](https://badge.fury.io/rb/clamby.png)](https://badge.fury.io/rb/clamby.png)
3
4
 
4
5
  This gem depends on the `clamscan` and `freshclam` daemons to be installed already.
@@ -7,6 +8,8 @@ If you have a file upload on your site and you do not scan the files for viruses
7
8
 
8
9
  #Usage
9
10
 
11
+ Be sure to check the CHANGELOG as recent changes may affect functionality.
12
+
10
13
  In your model with the uploader, you can add the scanner to a before method to scan the file. When a file is scanned, a successful scan will return `true`. An unsuccessful scan will return `false`. A scan may be unsuccessful for a number of reasons; `clamscan` could not be found, `clamscan` returned a virus, or the file which you were trying to scan could not be found.
11
14
 
12
15
  ```ruby
Binary file
@@ -6,7 +6,7 @@ module Clamby
6
6
  :check => true,
7
7
  :error_clamscan_missing => true,
8
8
  :error_file_missing => true,
9
- :error_file_virus => true
9
+ :error_file_virus => false
10
10
  }
11
11
 
12
12
  @valid_config_keys = @config.keys
@@ -29,10 +29,16 @@ module Clamby
29
29
  return false
30
30
  end
31
31
  end
32
+ else
33
+ return nil
32
34
  end
35
+ else
36
+ return nil
33
37
  end
34
38
  end
35
39
 
40
+
41
+
36
42
  def self.scanner_exists?
37
43
  if @config[:check]
38
44
  scanner = system('clamscan -V')
@@ -1,3 +1,3 @@
1
1
  module Clamby
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
@@ -0,0 +1,2 @@
1
+ rvm:
2
+ - 1.9.3
@@ -23,6 +23,10 @@ describe Clamby do
23
23
  expect(Clamby.scan(good_path)).to be true
24
24
  end
25
25
 
26
+ it "should scan file and return nil" do
27
+ expect(Clamby.scan(bad_path)).to be nil
28
+ end
29
+
26
30
  it "should scan file as dangerous" do
27
31
  `wget http://www.eicar.org/download/eicar.com`
28
32
  Clamby.configure({:error_file_virus => true})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clamby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - kobaltz
@@ -69,9 +69,11 @@ files:
69
69
  - README.md
70
70
  - Rakefile
71
71
  - clamby.gemspec
72
+ - clamby_logo.png
72
73
  - lib/clamby.rb
73
74
  - lib/clamby/exception.rb
74
75
  - lib/clamby/version.rb
76
+ - spec/.travis.yml
75
77
  - spec/clamby_spec.rb
76
78
  - spec/spec_helper.rb
77
79
  homepage: ''
@@ -99,5 +101,6 @@ signing_key:
99
101
  specification_version: 4
100
102
  summary: Scan file uploads with ClamAV
101
103
  test_files:
104
+ - spec/.travis.yml
102
105
  - spec/clamby_spec.rb
103
106
  - spec/spec_helper.rb