reviser 0.0.4.2 → 0.0.4.3
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/README.md +6 -6
- data/ext/valgrind.rb +1 -1
- data/lib/reviser.rb +7 -8
- data/lib/reviser/config.rb +9 -9
- data/lib/reviser/criteria/compilation.rb +1 -0
- data/lib/reviser/criteria/execution.rb +3 -7
- data/lib/reviser/exec.rb +5 -3
- data/lib/reviser/helpers/system.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbf8045de0cc719744a2f7330246359db2cf9118
|
4
|
+
data.tar.gz: 2ea4deecb7572d9484c6c4506c02d19e928062e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8789117a5c84196970ca0d2a26d657bbab41e4e5e1bfc956166edb7ba779a08a532769b275a668c4bff6acf636c7b45c75f8cec1084e259ab35186b44f3621d7
|
7
|
+
data.tar.gz: a86c7dab4e7470ef5fbf92963d6e6cce81320b01dc945205cde90ae46f782dc24d86644cf0e47412ea246b0a0edee62413c674f1f9ff4db94c0be8708d7eafd5
|
data/README.md
CHANGED
@@ -59,11 +59,11 @@ Lives in *config.yml*.
|
|
59
59
|
|
60
60
|
|Key |Description|Values|Required|
|
61
61
|
|------|-----------|-----|:--------:|
|
62
|
-
|*src*|Path to the archive containing projects||*` `^TP_NAME_FIRSTN`|||
|
63
|
+
|*dest*|Path to a directory where projects will be extracted|||
|
64
|
+
|*projects_names*|Naming convention for projects|`^GROUP_NAME_NAME` `^GROUP_NAME(_NAME)*` `^TP_NAME_FIRSTN`||
|
65
|
+
|*type*|The type of the project|`my_project` (*type/my_project.yml* must exist)||
|
66
|
+
|*criteria*|The criteria you want for analysis|`all_files` `src_files` `lines_count` `comments_count` `compile` `execute`||
|
67
67
|
|*extensions*|The list of extensions you want for analysis|See below||
|
68
68
|
|*create_git_repo*|Whether to create a git repository for each project or not (requires *git* gem)|Default `false`||
|
69
69
|
|*out*|The name of the analysis output file|Default *results*||
|
@@ -75,7 +75,7 @@ Lives in *type/my_project.yml*.
|
|
75
75
|
|
76
76
|
|Key |Description|Values|Required|
|
77
77
|
|------|-----------|-----|:--------:|
|
78
|
-
|*language*|The target language|`C` `Java` `HTML` `Ruby`||
|
79
79
|
|*timeout*|In seconds. Compilation and execution will halt if not completed within the defined timeout|Default *4*||
|
80
80
|
|*required_files*|A list of required files|Tip: you can use regular expressions||
|
81
81
|
|*preferred_build_command*|The command to build the program with|`make`||
|
data/ext/valgrind.rb
CHANGED
@@ -37,7 +37,7 @@ module Reviser
|
|
37
37
|
# Yann, execution_count shall be taken in count imo
|
38
38
|
#
|
39
39
|
def memleaks
|
40
|
-
executable =
|
40
|
+
executable = find_first_executable
|
41
41
|
program = "#{Cfg[:program_prefix]}#{executable}"
|
42
42
|
param = Cfg.has_key?(:execution_value) ? Cfg[:execution_value].first : ''
|
43
43
|
cmd = "valgrind --leak-check=full --track-origins=yes --show-reachable=yes #{program} #{param}"
|
data/lib/reviser.rb
CHANGED
@@ -31,16 +31,15 @@ require_relative 'reviser/helpers/system'
|
|
31
31
|
|
32
32
|
class String
|
33
33
|
#
|
34
|
-
# We need
|
34
|
+
# We need the 'underscore' method from Rails API to
|
35
35
|
# convert CamelCaseNames to underscore_names
|
36
36
|
#
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
37
|
+
def underscore
|
38
|
+
self.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
|
39
|
+
gsub(/([a-z\d])([A-Z])/,'\1_\2').
|
40
|
+
tr("-", "_").
|
41
|
+
downcase
|
42
|
+
end
|
44
43
|
end
|
45
44
|
|
46
45
|
#
|
data/lib/reviser/config.rb
CHANGED
@@ -117,17 +117,17 @@ module Reviser
|
|
117
117
|
#
|
118
118
|
# Default values for optional keys
|
119
119
|
#
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
120
|
+
@@mem[:options] ||= { verbose: true, log_dir:'logs', log_mode: 'org' }
|
121
|
+
@@mem[:timeout] ||= 4
|
122
|
+
@@mem[:out] ||= 'results'
|
123
|
+
@@mem[:out_format] ||= ['csv', 'html']
|
124
|
+
@@mem[:required_files] ||= []
|
125
125
|
|
126
|
-
|
127
|
-
|
128
|
-
|
126
|
+
@@mem[:program_prefix] ||= ''
|
127
|
+
@@mem[:execution_command] ||= ''
|
128
|
+
@@mem[:execution_count] ||= 1
|
129
129
|
|
130
|
-
|
130
|
+
@@mem[:create_git_repo] ||= false
|
131
131
|
end
|
132
132
|
|
133
133
|
private
|
@@ -33,6 +33,7 @@ module Reviser
|
|
33
33
|
# languages
|
34
34
|
#
|
35
35
|
module Execution
|
36
|
+
include Helpers::System
|
36
37
|
#
|
37
38
|
# Determines how to execute the program
|
38
39
|
# thanks to Cfg, then returns its exec
|
@@ -46,12 +47,7 @@ module Reviser
|
|
46
47
|
outputs << make_exec(v)
|
47
48
|
end
|
48
49
|
else
|
49
|
-
|
50
|
-
outputs[Cfg[:execution_value]] = []
|
51
|
-
Cfg[:execution_count].times do
|
52
|
-
outputs << make_exec(Cfg[:execution_value])
|
53
|
-
end
|
54
|
-
else
|
50
|
+
Cfg[:execution_count].times do
|
55
51
|
outputs << make_exec(Cfg[:execution_value])
|
56
52
|
end
|
57
53
|
end
|
@@ -83,7 +79,7 @@ module Reviser
|
|
83
79
|
# security
|
84
80
|
#
|
85
81
|
def make_exec param = ''
|
86
|
-
program = (Cfg.has_key? :program_name) && Cfg[:program_name] ||
|
82
|
+
program = (Cfg.has_key? :program_name) && Cfg[:program_name] || find_first_executable
|
87
83
|
|
88
84
|
return 'Program not found' unless program != nil
|
89
85
|
|
data/lib/reviser/exec.rb
CHANGED
@@ -36,7 +36,7 @@ module Reviser
|
|
36
36
|
#
|
37
37
|
class Exec < Thor
|
38
38
|
|
39
|
-
VERSION = '0.0.4.
|
39
|
+
VERSION = '0.0.4.3'
|
40
40
|
|
41
41
|
map '--version' => :version
|
42
42
|
map '-v' => :version
|
@@ -172,8 +172,10 @@ module Reviser
|
|
172
172
|
|
173
173
|
# Then the config file
|
174
174
|
['config.yml', 'labels.yml'].each do |tpl|
|
175
|
-
|
176
|
-
|
175
|
+
unless File.exists? File.join(dir, tpl)
|
176
|
+
FileUtils.cp(File.join(Cfg::ROOT, tpl), dir)
|
177
|
+
message('Create', dir == '.' && tpl || File.join(dir, tpl))
|
178
|
+
end
|
177
179
|
end
|
178
180
|
end
|
179
181
|
|