clamby 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +4 -1
- data/clamby_logo.png +0 -0
- data/lib/clamby.rb +7 -1
- data/lib/clamby/version.rb +1 -1
- data/spec/.travis.yml +2 -0
- data/spec/clamby_spec.rb +4 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9fd8ce4dbb727390a6c41672ce701ef9ede81a4
|
4
|
+
data.tar.gz: 69585a26d1f9f8de1f279b15a0980226c687f0b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4492b45533ef3e967f818746a43742e9a525d333a91bf88c413c98d88bc6ac1fced3f0d98b89009369f68d1284df90f786ab7fada2f19d414afa5c91c8d9233a
|
7
|
+
data.tar.gz: a5176fddef6a09a0e4c3d801818064984ce368563bf94ccc141b26cdd93e0a69232a6a43a248b49c8858a4fa6def05b0f684b75423279069df9bc27dff744d8c
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
1
|
+

|
2
|
+
|
2
3
|
[](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
|
data/clamby_logo.png
ADDED
Binary file
|
data/lib/clamby.rb
CHANGED
@@ -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 =>
|
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')
|
data/lib/clamby/version.rb
CHANGED
data/spec/.travis.yml
ADDED
data/spec/clamby_spec.rb
CHANGED
@@ -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
|
+
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
|