bleach 0.0.2 → 0.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80516ec059d3fa347cd4bd87df44e5d01d804d597feb2bc6213eac6cf9d62c95
|
4
|
+
data.tar.gz: 8f451bb5ffcf4a6372640aa391a949cbe8351e350a63bfffa17fc17f7c2c938b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce0fefc24748d59bc87b0eba82e059d1672f61706c4ecc660876b83974ea638339cb8993d49e26ac5c4d789aeaf467b1c74599bc96850ee0ff0efc59f0d53c1
|
7
|
+
data.tar.gz: b38ef4512757c151380094883a482c823bbc88f64ce2723c9a2e1798cba956bf3b8a4ac86d793d74e1ec0c18d95e8593161c76dad0005d0717f3f29a0383b5ad
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bleach
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis Flores
|
@@ -66,9 +66,6 @@ files:
|
|
66
66
|
- "./languages/javascript/eslint/Dockerfile"
|
67
67
|
- "./languages/javascript/eslint/check-file"
|
68
68
|
- "./languages/javascript/eslint/config.json"
|
69
|
-
- "./languages/javascript/jshint/Dockerfile"
|
70
|
-
- "./languages/javascript/jshint/check-file"
|
71
|
-
- "./languages/javascript/jshint/config.json"
|
72
69
|
- "./languages/ruby/brakeman/Dockerfile"
|
73
70
|
- "./languages/ruby/brakeman/check-file"
|
74
71
|
- "./languages/ruby/brakeman/config.json"
|
@@ -77,7 +74,6 @@ files:
|
|
77
74
|
- "./languages/ruby/rubocop/config.json"
|
78
75
|
- "./lib/command/check_file.rb"
|
79
76
|
- "./lib/command/code_check/javascript/eslint.rb"
|
80
|
-
- "./lib/command/code_check/javascript/jshint.rb"
|
81
77
|
- "./lib/command/code_check/ruby/brakeman.rb"
|
82
78
|
- "./lib/command/code_check/ruby/rubocop.rb"
|
83
79
|
- "./lib/command/docker_build.rb"
|
@@ -1,46 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
# Discover lib files to be included
|
5
|
-
Dir.glob("#{__dir__}/../../../lib/**/*.rb").each do |lib_file|
|
6
|
-
require File.expand_path(lib_file, __dir__)
|
7
|
-
end
|
8
|
-
|
9
|
-
require 'optparse'
|
10
|
-
require 'json'
|
11
|
-
|
12
|
-
options = {}
|
13
|
-
OptionParser.new do |opts|
|
14
|
-
opts.banner = "Usage: #{File.basename(__FILE__)} [OPTIONS]"
|
15
|
-
|
16
|
-
opts.on('-f', '--file [STRING]', 'File.') do |value|
|
17
|
-
options[:file] = value
|
18
|
-
end
|
19
|
-
end.parse!
|
20
|
-
|
21
|
-
required_options = [:file]
|
22
|
-
required_options.each do |option|
|
23
|
-
unless options[option]
|
24
|
-
warn "Can not run #{option} was not given."
|
25
|
-
exit 1
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
file = File.basename(options[:file])
|
30
|
-
dir = File.dirname(options[:file])
|
31
|
-
|
32
|
-
config_file = "#{dir}/config.json"
|
33
|
-
config = JSON.parse(File.read(config_file))
|
34
|
-
|
35
|
-
image_name = config['imageName']
|
36
|
-
tool_config = config['requiredFiles'].find do |record|
|
37
|
-
record['type'] == 'JSHint Config'
|
38
|
-
end['file']
|
39
|
-
|
40
|
-
check_command = CodeCheck::JSHint.new(
|
41
|
-
pwd: dir,
|
42
|
-
image_name: image_name,
|
43
|
-
config_file: tool_config,
|
44
|
-
source_files: "/code/#{file}"
|
45
|
-
)
|
46
|
-
exit 1 unless check_command.system
|
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
module CodeCheck
|
5
|
-
# Template for JSHint check
|
6
|
-
class JSHint < AbstractCommand
|
7
|
-
def template
|
8
|
-
'docker run ' \
|
9
|
-
'--rm ' \
|
10
|
-
'--volume %<pwd>s:/code ' \
|
11
|
-
'%<image_name>s ' \
|
12
|
-
'jshint ' \
|
13
|
-
'--config /code/%<config_file>s ' \
|
14
|
-
'%<source_files>s'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|