codeclimate 0.10.0 → 0.10.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d60c51cbc56c8fea593971fb4c55ecd4dc2336e
|
4
|
+
data.tar.gz: 1735452e5abfebd7f64ff4e2022829f275bc71c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c10e1fbe60a9d4704985a6710134cbd3954710d4de8a962e63c0a00b18e0347a004415a51f17a7960468e783e3f0606875ada6ff727dc8726fe482bed987070a
|
7
|
+
data.tar.gz: c9b367eb7384d62a29e0dedb36bd360365b967443866fcd125830355d7f6693eec6b1a7ef6b715aafb17db23f139e5f91837c7abf7fbe1893df2669cb36a3bb5
|
data/lib/cc/analyzer.rb
CHANGED
@@ -5,9 +5,9 @@ module CC
|
|
5
5
|
autoload :Container, "cc/analyzer/container"
|
6
6
|
autoload :ContainerListener, "cc/analyzer/container_listener"
|
7
7
|
autoload :Engine, "cc/analyzer/engine"
|
8
|
-
autoload :Engines, "cc/analyzer/engines"
|
9
8
|
autoload :EngineOutputFilter, "cc/analyzer/engine_output_filter"
|
10
9
|
autoload :EngineRegistry, "cc/analyzer/engine_registry"
|
10
|
+
autoload :EnginesBuilder, "cc/analyzer/engines_builder"
|
11
11
|
autoload :EnginesRunner, "cc/analyzer/engines_runner"
|
12
12
|
autoload :Filesystem, "cc/analyzer/filesystem"
|
13
13
|
autoload :Formatters, "cc/analyzer/formatters"
|
@@ -11,6 +11,7 @@ module CC
|
|
11
11
|
:stderr, # stderr, for a finished event
|
12
12
|
)
|
13
13
|
ImageRequired = Class.new(StandardError)
|
14
|
+
Result = Struct.new(:exit_status, :timed_out?, :duration, :stderr)
|
14
15
|
|
15
16
|
DEFAULT_TIMEOUT = 15 * 60 # 15m
|
16
17
|
|
@@ -51,9 +52,11 @@ module CC
|
|
51
52
|
_, status = Process.waitpid2(pid)
|
52
53
|
if @timed_out
|
53
54
|
@listener.timed_out(container_data(duration: @timeout))
|
55
|
+
Result.new(status.exitstatus, true, @timeout, @stderr_io.string)
|
54
56
|
else
|
55
57
|
duration = ((Time.now - started) * 1000).round
|
56
58
|
@listener.finished(container_data(duration: duration, status: status))
|
59
|
+
Result.new(status.exitstatus, false, duration, @stderr_io.string)
|
57
60
|
end
|
58
61
|
ensure
|
59
62
|
t_timeout.kill if t_timeout
|
@@ -2,25 +2,27 @@ require "securerandom"
|
|
2
2
|
|
3
3
|
module CC
|
4
4
|
module Analyzer
|
5
|
-
class
|
5
|
+
class EnginesBuilder
|
6
6
|
def initialize(registry:, config:, container_label:, source_dir:, requested_paths:)
|
7
|
-
super()
|
8
7
|
@registry = registry
|
9
8
|
@config = config
|
10
9
|
@container_label = container_label
|
11
10
|
@requested_paths = requested_paths
|
12
11
|
@source_dir = source_dir
|
13
|
-
|
14
|
-
|
12
|
+
end
|
13
|
+
|
14
|
+
def run(engine_class = Analyzer::Engine)
|
15
|
+
names_and_raw_engine_configs.map do |name, raw_engine_config|
|
16
|
+
build_engine(engine_class, name, raw_engine_config)
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
20
|
private
|
19
21
|
|
20
|
-
def build_engine(name, raw_engine_config)
|
22
|
+
def build_engine(engine_class, name, raw_engine_config)
|
21
23
|
label = @container_label || SecureRandom.uuid
|
22
24
|
engine_config = engine_config(raw_engine_config)
|
23
|
-
|
25
|
+
engine_class.new(
|
24
26
|
name, @registry[name], @source_dir, engine_config, label
|
25
27
|
)
|
26
28
|
end
|
@@ -32,13 +32,13 @@ module CC
|
|
32
32
|
attr_reader :requested_paths
|
33
33
|
|
34
34
|
def engines
|
35
|
-
@engines ||=
|
35
|
+
@engines ||= EnginesBuilder.new(
|
36
36
|
registry: @registry,
|
37
37
|
config: @config,
|
38
38
|
container_label: @container_label,
|
39
39
|
source_dir: @source_dir,
|
40
40
|
requested_paths: @requested_paths,
|
41
|
-
)
|
41
|
+
).run
|
42
42
|
end
|
43
43
|
|
44
44
|
def run_engine(engine, container_listener)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
@@ -205,7 +205,7 @@ files:
|
|
205
205
|
- lib/cc/analyzer/engine.rb
|
206
206
|
- lib/cc/analyzer/engine_output_filter.rb
|
207
207
|
- lib/cc/analyzer/engine_registry.rb
|
208
|
-
- lib/cc/analyzer/
|
208
|
+
- lib/cc/analyzer/engines_builder.rb
|
209
209
|
- lib/cc/analyzer/engines_runner.rb
|
210
210
|
- lib/cc/analyzer/filesystem.rb
|
211
211
|
- lib/cc/analyzer/formatters.rb
|
@@ -261,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
261
261
|
version: '0'
|
262
262
|
requirements: []
|
263
263
|
rubyforge_project:
|
264
|
-
rubygems_version: 2.4.
|
264
|
+
rubygems_version: 2.4.8
|
265
265
|
signing_key:
|
266
266
|
specification_version: 4
|
267
267
|
summary: Code Climate CLI
|