vs_rails 0.0.3 → 0.0.6

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: 058fb4654f86ffa29f4b2413ccfc62f5ce8ac4ab
4
- data.tar.gz: e61d5c78d918a3b090dc2171446568cceff43b0c
3
+ metadata.gz: e3502750275c27a11a95adad1581c97550532dc9
4
+ data.tar.gz: abe3df4e2406173bc5b83a4394f52664845e3c18
5
5
  SHA512:
6
- metadata.gz: f78ef35dca24c71810921492ad0545a018382fe4d29f43545d1023b47aaa47a7fb1c5dd920f9971fd9660a2a496cdf007fdc7b198313e2266d6954b76c26624b
7
- data.tar.gz: a8b2346b936bbd8935b21fe8c1354e10877b7ad2182747e76e60b2e4a8d33763f65222cf15bb9f15dddce4a5a3ea7fa459356eaeb5874a07056f857971b5e9e3
6
+ metadata.gz: 5093ce489438986af9eacc1b46b275b206ca598f58aa533b95f88747509c4f80574b667eb1eee5755598bfe66f7eeff097304615c8be52c6d564c359bde40ff5
7
+ data.tar.gz: e32ce25f0abeb1987bee2e46b4090c0c2805828dc34ae2506a969e001eac96bce0870210c110df9754ea10c125335ea2da118015425a008608071b727ea40ee4
@@ -7,13 +7,10 @@ class VsRails::ScansController < ApplicationController
7
7
 
8
8
  if params[:status] == "clean"
9
9
  scan.update_attribute(:status, "clean")
10
- flash[:notice] = "File is OK"
11
10
  elsif params[:status] == "infected"
12
11
  scan.update_attribute(:status, "infected")
13
- flash[:error] = "File is infected"
14
12
  else
15
13
  scan.update_attribute(:status, "unknown")
16
- flash[:alert] = "File status unknown"
17
14
  end
18
15
 
19
16
  render nothing: true
data/app/models/scan.rb CHANGED
@@ -1,3 +1,11 @@
1
1
  class Scan < ActiveRecord::Base
2
- validates_presence_of :uuid, :filename
2
+ validates :uuid, :filename, presence: true
3
+ validates :uuid, uniqueness: true
4
+
5
+ #TODO Move to enum
6
+ # enum status: %w(scanning clean infected error unknown)
7
+
8
+ def clean?
9
+ self.status == "clean"
10
+ end
3
11
  end
@@ -1,3 +1,3 @@
1
1
  module VsRails
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vs_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bit Zesty Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-09 00:00:00.000000000 Z
11
+ date: 2015-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 4.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: virus-scanner
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.4
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.0.4
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: sqlite3
29
43
  requirement: !ruby/object:Gem::Requirement