clamby 1.6.10 → 1.6.11

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
  SHA256:
3
- metadata.gz: f3e1a92dd3ace58588a950da63a979a45dd4634006417a4bdfd8b37e5cda339a
4
- data.tar.gz: 1988703846a4fe4b53049a897b036bf8e1a279faa0c6eb3f52d7b931417f213a
3
+ metadata.gz: 9ca9e1bf2cd0a67bd5f3c3cbc6aea39a701367e226e492745321c8d3a8effa16
4
+ data.tar.gz: 8a30ce332afc500e9cdf7df61f6c47ec70c6dc623b979f8eea278f4c705d1200
5
5
  SHA512:
6
- metadata.gz: 2b82f110ca83c57a33f9ba542d77623ab0eb66fa658f2df2f6346d72ed80d456352524b385b4ccabf2c51f5f7f8e2c4a66ddea213b8454148efc240274e375f7
7
- data.tar.gz: c7288c6c4e8f32756a1334d2a94d7543c3172fe1f001715f88bba7fbc86b99e350b1290bbfbd7ea68ba464cb67e9e2ec25cc361c2c1e91a3450310000d73060b
6
+ metadata.gz: 92c449f7160ccdaa1148cfb5b48b823c9066714f314dd2fd56fa8e63f5b814d029fd3b9e5c255dff458d79420f0845284f16aeefce6ec7435af8fce9cd9f8eb1
7
+ data.tar.gz: 7ff6dd7d2dacf22db992af2eec9fc34238d1a2100572787fe5fde63dfb067e7e0523452a2cf36709f7d44b8e4c973b58b03bf889e10c94491b6c3abe68a7fa7f
@@ -7,8 +7,7 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  strategy:
9
9
  matrix:
10
- ruby-version: ['2.6.10', '2.7.8']
11
- # ruby-version: ['2.6.10', '2.7.8', '3.0.6', '3.1.4', '3.2.2']
10
+ ruby-version: ['2.6.10', '2.7.8', '3.0.6', '3.1.4', '3.2.2', '3.3.0']
12
11
  gemfile: ['Gemfile']
13
12
 
14
13
  steps:
@@ -12,6 +12,11 @@ module Clamby
12
12
  return 'clamscan'
13
13
  end
14
14
 
15
+ # $CHILD_STATUS maybe nil if the execution itself (not the client process)
16
+ def self.scan_status
17
+ $CHILD_STATUS && $CHILD_STATUS.exitstatus
18
+ end
19
+
15
20
  # Perform a ClamAV scan on the given path.
16
21
  def self.scan(path)
17
22
  return nil unless file_exists?(path)
@@ -28,9 +33,7 @@ module Clamby
28
33
 
29
34
  new.run scan_executable, *args
30
35
 
31
- # $CHILD_STATUS maybe nil if the execution itself (not the client process)
32
- # fails
33
- case $CHILD_STATUS && $CHILD_STATUS.exitstatus
36
+ case self.scan_status
34
37
  when 0
35
38
  return false
36
39
  when nil, 2
@@ -38,7 +41,7 @@ module Clamby
38
41
  if Clamby.config[:error_clamscan_client_error] && Clamby.config[:daemonize]
39
42
  raise Clamby::ClamscanClientError.new("Clamscan client error")
40
43
  end
41
-
44
+
42
45
  # returns true to maintain legacy behavior
43
46
  return true
44
47
  else
@@ -1,3 +1,3 @@
1
1
  module Clamby
2
- VERSION = "1.6.10"
2
+ VERSION = "1.6.11"
3
3
  end
data/spec/clamby_spec.rb CHANGED
@@ -94,7 +94,10 @@ describe Clamby do
94
94
  }
95
95
 
96
96
  context 'when false' do
97
- before { Clamby.configure(error_clamscan_client_error: false) }
97
+ before do
98
+ Clamby.configure(error_clamscan_client_error: false)
99
+ allow(Clamby::Command).to receive(:scan_status).and_return(2)
100
+ end
98
101
 
99
102
  it 'virus? returns true when the daemonized client exits with status 2' do
100
103
  Clamby.configure(daemonize: true)
@@ -107,7 +110,10 @@ describe Clamby do
107
110
  end
108
111
 
109
112
  context 'when true' do
110
- before { Clamby.configure(error_clamscan_client_error: true) }
113
+ before do
114
+ Clamby.configure(error_clamscan_client_error: true)
115
+ allow(Clamby::Command).to receive(:scan_status).and_return(2)
116
+ end
111
117
 
112
118
  it 'virus? raises when the daemonized client exits with status 2' do
113
119
  Clamby.configure(daemonize: true)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clamby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.10
4
+ version: 1.6.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - kobaltz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-25 00:00:00.000000000 Z
11
+ date: 2024-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
- rubygems_version: 3.4.19
104
+ rubygems_version: 3.5.6
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Scan file uploads with ClamAV