carrierwave-vs 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/LICENSE.md +7 -0
- data/README.md +43 -0
- data/carrierwave-vs.gemspec +21 -0
- data/lib/carrierwave-vs/version.rb +5 -0
- data/lib/carrierwave-vs/virus_scanner.rb +19 -0
- data/lib/carrierwave-vs.rb +2 -0
- metadata +79 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 87ea0653d3a19997679a898e585b6d76b4e6b12e
|
4
|
+
data.tar.gz: daf180175589eaa159b3b9e8d4b428295fdc8572
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b54f051b7d53e12fd62c39872af23c2e289c4f64118216b38546e4efd4d4cc843b0aea4b3414d93401a01791bcb794e5f5ec4769e70f3877a4c44d80ac484137
|
7
|
+
data.tar.gz: f8bb5e7e34274e96f00acbe81b36fa1c1920a7a8e70888896d38d36fcb71d8b06e47f5cff4349bc8118965dfd56acbec42fa7156380159413e8d69378e95b737
|
data/.gitignore
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2015 BitZesty Ltd.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# CarrierWave VirusScanner support
|
2
|
+
|
3
|
+
This gem adds support for BitZesty's Virus Scanner to [CarrierWave](https://github.com/jnicklas/carrierwave/)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Install the latest release:
|
8
|
+
|
9
|
+
gem install carrierwave-vs
|
10
|
+
|
11
|
+
Or add it in the Gemfile:
|
12
|
+
|
13
|
+
gem 'carrierwave-vs'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
Include it in in your code:
|
23
|
+
|
24
|
+
class MyUploader < CarrierWave::Uploader::Base
|
25
|
+
include CarrierWave::VirusScanner
|
26
|
+
...
|
27
|
+
end
|
28
|
+
|
29
|
+
Then apply to all versions by:
|
30
|
+
|
31
|
+
class MyUploader < CarrierWave::Uploader::Bse
|
32
|
+
...
|
33
|
+
process :virus_scan
|
34
|
+
end
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
|
38
|
+
1. Fork it
|
39
|
+
2. Create your featuer branch
|
40
|
+
3. Commit your changes
|
41
|
+
4. Push to the branch
|
42
|
+
5. Create new Pull Request
|
43
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "carrierwave-vs/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "carrierwave-vs"
|
8
|
+
s.version = CarrierWave::VirusScanner::VERSION
|
9
|
+
s.authors = ["BitZesty Ltd."]
|
10
|
+
s.email = ["info@bitzesty.com"]
|
11
|
+
s.description = %q{BitZesty VirusScanner support for carrierwave}
|
12
|
+
s.summary = %q{BitZesty VirusScanner support for carrierwave}
|
13
|
+
s.homepage = "https://github.com/bitzesty/carrierwave-vs"
|
14
|
+
|
15
|
+
s.files = `git ls-files`.split($/)
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.license = "MIT"
|
18
|
+
|
19
|
+
s.add_dependency "carrierwave"
|
20
|
+
s.add_dependency "virus-scanner"
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "active_support/concern"
|
2
|
+
|
3
|
+
module Carrierwave
|
4
|
+
module VirusScanner
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
module ClassMethods
|
7
|
+
def virus_scan
|
8
|
+
process :virus_scan
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def virus_scan
|
13
|
+
response = ::VirusScanner::File.scan_url(url)
|
14
|
+
|
15
|
+
return true unless response.fetch("status") == "OK"
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: carrierwave-vs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- BitZesty Ltd.
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: carrierwave
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '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'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: BitZesty VirusScanner support for carrierwave
|
42
|
+
email:
|
43
|
+
- info@bitzesty.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- LICENSE.md
|
50
|
+
- README.md
|
51
|
+
- carrierwave-vs.gemspec
|
52
|
+
- lib/carrierwave-vs.rb
|
53
|
+
- lib/carrierwave-vs/version.rb
|
54
|
+
- lib/carrierwave-vs/virus_scanner.rb
|
55
|
+
homepage: https://github.com/bitzesty/carrierwave-vs
|
56
|
+
licenses:
|
57
|
+
- MIT
|
58
|
+
metadata: {}
|
59
|
+
post_install_message:
|
60
|
+
rdoc_options: []
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
requirements: []
|
74
|
+
rubyforge_project:
|
75
|
+
rubygems_version: 2.4.5
|
76
|
+
signing_key:
|
77
|
+
specification_version: 4
|
78
|
+
summary: BitZesty VirusScanner support for carrierwave
|
79
|
+
test_files: []
|