codeclimate 0.0.7 → 0.0.9
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/lib/cc/analyzer/engine.rb +5 -0
- data/lib/cc/analyzer/filesystem.rb +26 -9
- data/lib/cc/cli/engines/engine_command.rb +2 -4
- data/lib/cc/cli/init.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65981b2dfc7ede257b220d224cfc49f6352da814
|
4
|
+
data.tar.gz: 6b6cc3ce039b2dd94895bdd8b255d9c1ef5cdd52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5da27414b23c279d27935d8f8e0ba6f02200ec0ab7672751cfcad094c15835965bd24a16d5cd7eb9aac7b967f2a8ddb5a41b8d9f4cf7fb15e2fcf75971735801
|
7
|
+
data.tar.gz: 11832434ababa225981ec922058898adaa3240a538cb675651e3a867aa6cbcaf059d01958a4b93676a3318b0a6bf22bc901b2cb68cd4cc06c34aaa1db8b14fad
|
data/lib/cc/analyzer/engine.rb
CHANGED
@@ -19,6 +19,7 @@ module CC
|
|
19
19
|
def run(stdout_io, stderr_io = StringIO.new)
|
20
20
|
pid, _, out, err = POSIX::Spawn.popen4(*docker_run_command)
|
21
21
|
engine_running = true
|
22
|
+
Analyzer.statsd.increment("cli.engines.started")
|
22
23
|
|
23
24
|
t_out = Thread.new do
|
24
25
|
out.each_line("\0") do |chunk|
|
@@ -41,6 +42,10 @@ module CC
|
|
41
42
|
Thread.current.abort_on_exception = true
|
42
43
|
run_command("docker kill #{container_name}")
|
43
44
|
|
45
|
+
Analyzer.statsd.increment("cli.engines.result.error")
|
46
|
+
Analyzer.statsd.increment("cli.engines.result.error.timeout")
|
47
|
+
Analyzer.statsd.increment("cli.engines.names.#{name}.result.error")
|
48
|
+
Analyzer.statsd.increment("cli.engines.names.#{name}.result.error.timeout")
|
44
49
|
raise EngineTimeout, "engine #{name} ran past #{TIMEOUT} seconds and was killed"
|
45
50
|
end
|
46
51
|
end
|
@@ -18,18 +18,13 @@ module CC
|
|
18
18
|
File.read(path_for(path))
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
22
|
-
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def all
|
28
|
-
@files ||= Dir.chdir(@root) { Dir.glob("**/*") }
|
21
|
+
def write_path(path, content)
|
22
|
+
File.write(path_for(path), content)
|
23
|
+
File.chown(root_uid, root_gid, path_for(path))
|
29
24
|
end
|
30
25
|
|
31
26
|
def any?(&block)
|
32
|
-
|
27
|
+
file_paths.any?(&block)
|
33
28
|
end
|
34
29
|
|
35
30
|
def files_matching(globs)
|
@@ -40,9 +35,31 @@ module CC
|
|
40
35
|
end
|
41
36
|
end
|
42
37
|
|
38
|
+
private
|
39
|
+
|
40
|
+
def file_paths
|
41
|
+
@file_paths ||= Dir.chdir(@root) do
|
42
|
+
`find . -type f -print0`.strip.split("\0").map do |path|
|
43
|
+
path.sub(/^\.\//, "")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
43
48
|
def path_for(path)
|
44
49
|
File.join(@root, path)
|
45
50
|
end
|
51
|
+
|
52
|
+
def root_uid
|
53
|
+
root_stat.uid
|
54
|
+
end
|
55
|
+
|
56
|
+
def root_gid
|
57
|
+
root_stat.gid
|
58
|
+
end
|
59
|
+
|
60
|
+
def root_stat
|
61
|
+
@root_stat ||= File.stat(@root)
|
62
|
+
end
|
46
63
|
end
|
47
64
|
end
|
48
65
|
end
|
@@ -17,13 +17,11 @@ module CC
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def yaml_content
|
20
|
-
|
20
|
+
filesystem.read_path(CODECLIMATE_YAML).freeze
|
21
21
|
end
|
22
22
|
|
23
23
|
def update_yaml
|
24
|
-
|
25
|
-
f.write(parsed_yaml.to_yaml)
|
26
|
-
end
|
24
|
+
filesystem.write_path(CODECLIMATE_YAML, parsed_yaml.to_yaml)
|
27
25
|
end
|
28
26
|
|
29
27
|
def engine_present_in_yaml?
|
data/lib/cc/cli/init.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|