reviser 0.0.2.rc1 → 0.0.2

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +143 -10
  4. data/bin/reviser +1 -1
  5. data/config.yml +1 -6
  6. data/ext/valgrind.rb +7 -3
  7. data/ext/web_validators.rb +44 -80
  8. data/lang/HTML.yml +5 -0
  9. data/lib/exec.rb +36 -24
  10. data/lib/{component.rb → reviser/component.rb} +17 -3
  11. data/lib/{components → reviser/components}/archiver.rb +4 -8
  12. data/lib/{components → reviser/components}/checker.rb +6 -3
  13. data/lib/{components → reviser/components}/extractors.rb +1 -1
  14. data/lib/{components → reviser/components}/generator.rb +16 -8
  15. data/lib/{components → reviser/components}/generators.rb +14 -37
  16. data/lib/{components → reviser/components}/organiser.rb +0 -0
  17. data/lib/reviser/config.rb +104 -0
  18. data/lib/{criteria → reviser/criteria}/code_analysis.rb +0 -0
  19. data/lib/{criteria → reviser/criteria}/compilation.rb +14 -7
  20. data/lib/{criteria → reviser/criteria}/execution.rb +13 -13
  21. data/lib/{helpers → reviser/helpers}/criteria.rb +6 -3
  22. data/lib/{helpers → reviser/helpers}/git.rb +0 -0
  23. data/lib/{helpers → reviser/helpers}/project.rb +17 -12
  24. data/lib/{helpers → reviser/helpers}/system.rb +0 -0
  25. data/lib/{loggers → reviser/loggers}/logger.rb +1 -2
  26. data/lib/{loggers → reviser/loggers}/modes.rb +1 -1
  27. data/lib/reviser/result.rb +30 -0
  28. data/lib/reviser.rb +15 -15
  29. data/res/css/component.css +3 -1
  30. data/res/example/data.json +4 -0
  31. data/type/{CProject.yml → example/CProject.yml} +0 -0
  32. data/type/{HelloWorldRuby.yml → example/HelloWorldRuby.yml} +0 -0
  33. data/type/{HtmlASRALL.yml → example/HtmlASRALL.yml} +0 -0
  34. data/type/{JavaProject.yml → example/JavaProject.yml} +0 -0
  35. data/type/{Labyrinthe.yml → example/Labyrinthe.yml} +0 -0
  36. data/type/{Pendu.yml → example/Pendu.yml} +0 -0
  37. data/type/{Web.yml → example/Web.yml} +0 -0
  38. metadata +37 -43
  39. data/lib/config.rb +0 -66
  40. data/res/js/jquery.stickyheader.js +0 -149
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reviser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.rc1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renan Strauss
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-03-25 00:00:00.000000000 Z
14
+ date: 2015-03-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: colorize
@@ -114,25 +114,19 @@ dependencies:
114
114
  - !ruby/object:Gem::Version
115
115
  version: 1.2.9.1
116
116
  - !ruby/object:Gem::Dependency
117
- name: rest-client
117
+ name: w3c_validators
118
118
  requirement: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - "~>"
121
- - !ruby/object:Gem::Version
122
- version: '1.7'
123
- - - ">="
120
+ - - '='
124
121
  - !ruby/object:Gem::Version
125
- version: 1.7.3
122
+ version: '1.2'
126
123
  type: :runtime
127
124
  prerelease: false
128
125
  version_requirements: !ruby/object:Gem::Requirement
129
126
  requirements:
130
- - - "~>"
127
+ - - '='
131
128
  - !ruby/object:Gem::Version
132
- version: '1.7'
133
- - - ">="
134
- - !ruby/object:Gem::Version
135
- version: 1.7.3
129
+ version: '1.2'
136
130
  description: A semi-automatic tool for student's projects evaluation
137
131
  email: renan.strauss@gmail.com
138
132
  executables:
@@ -151,25 +145,26 @@ files:
151
145
  - lang/HTML.yml
152
146
  - lang/Java.yml
153
147
  - lang/Ruby.yml
154
- - lib/component.rb
155
- - lib/components/archiver.rb
156
- - lib/components/checker.rb
157
- - lib/components/extractors.rb
158
- - lib/components/generator.rb
159
- - lib/components/generators.rb
160
- - lib/components/organiser.rb
161
- - lib/config.rb
162
- - lib/criteria/code_analysis.rb
163
- - lib/criteria/compilation.rb
164
- - lib/criteria/execution.rb
165
148
  - lib/exec.rb
166
- - lib/helpers/criteria.rb
167
- - lib/helpers/git.rb
168
- - lib/helpers/project.rb
169
- - lib/helpers/system.rb
170
- - lib/loggers/logger.rb
171
- - lib/loggers/modes.rb
172
149
  - lib/reviser.rb
150
+ - lib/reviser/component.rb
151
+ - lib/reviser/components/archiver.rb
152
+ - lib/reviser/components/checker.rb
153
+ - lib/reviser/components/extractors.rb
154
+ - lib/reviser/components/generator.rb
155
+ - lib/reviser/components/generators.rb
156
+ - lib/reviser/components/organiser.rb
157
+ - lib/reviser/config.rb
158
+ - lib/reviser/criteria/code_analysis.rb
159
+ - lib/reviser/criteria/compilation.rb
160
+ - lib/reviser/criteria/execution.rb
161
+ - lib/reviser/helpers/criteria.rb
162
+ - lib/reviser/helpers/git.rb
163
+ - lib/reviser/helpers/project.rb
164
+ - lib/reviser/helpers/system.rb
165
+ - lib/reviser/loggers/logger.rb
166
+ - lib/reviser/loggers/modes.rb
167
+ - lib/reviser/result.rb
173
168
  - res/css/component.css
174
169
  - res/css/normalize.css
175
170
  - res/css/style_logs.css
@@ -177,19 +172,19 @@ files:
177
172
  - res/css/web_validators/css-results.css
178
173
  - res/css/web_validators/html-base.css
179
174
  - res/css/web_validators/html-results.css
180
- - res/js/jquery.stickyheader.js
175
+ - res/example/data.json
181
176
  - res/labys/labfich11.txt
182
177
  - res/labys/test.txt
183
178
  - res/labys/yoda.txt
184
179
  - res/scss/style_logs.scss
185
- - type/CProject.yml
186
- - type/HelloWorldRuby.yml
187
- - type/HtmlASRALL.yml
188
- - type/JavaProject.yml
189
- - type/Labyrinthe.yml
190
- - type/Pendu.yml
191
- - type/Web.yml
192
- homepage: http://rubygemspec.org/gems/reviser
180
+ - type/example/CProject.yml
181
+ - type/example/HelloWorldRuby.yml
182
+ - type/example/HtmlASRALL.yml
183
+ - type/example/JavaProject.yml
184
+ - type/example/Labyrinthe.yml
185
+ - type/example/Pendu.yml
186
+ - type/example/Web.yml
187
+ homepage: https://bitbucket.org/renan-/reviser
193
188
  licenses:
194
189
  - GPL-3
195
190
  metadata: {}
@@ -197,17 +192,16 @@ post_install_message:
197
192
  rdoc_options: []
198
193
  require_paths:
199
194
  - lib
200
- - lib/helpers
201
195
  required_ruby_version: !ruby/object:Gem::Requirement
202
196
  requirements:
203
197
  - - ">="
204
198
  - !ruby/object:Gem::Version
205
- version: '0'
199
+ version: 1.9.3
206
200
  required_rubygems_version: !ruby/object:Gem::Requirement
207
201
  requirements:
208
- - - ">"
202
+ - - ">="
209
203
  - !ruby/object:Gem::Version
210
- version: 1.3.1
204
+ version: '0'
211
205
  requirements: []
212
206
  rubyforge_project:
213
207
  rubygems_version: 2.4.5
data/lib/config.rb DELETED
@@ -1,66 +0,0 @@
1
- #
2
- # @author Renan Strauss
3
- # Externalises the configuration
4
- #
5
- require 'yaml'
6
-
7
- module Reviser
8
- class Cfg
9
- # Path for specialized config files for projects
10
- ROOT = File.join(File.dirname(File.dirname(__FILE__)))
11
-
12
- # Is the config is loaded ?
13
- @@loaded = false
14
-
15
- def self.[](key)
16
- @@mem[key] if @@loaded
17
- end
18
-
19
- def self.[]=(key, value)
20
- @@mem[key] = value if @@loaded
21
- end
22
-
23
- # @return true if there is the key in the config
24
- def self.has_key?(key)
25
- @@mem.has_key? key
26
- end
27
-
28
- #
29
- # @returns The specified resource path
30
- # TODO : put resources in dedicated folders
31
- # for each component or extension, so that
32
- # the user can omit <lang>/<ext_name>/ when
33
- # calling this method
34
- #
35
- def self.resource path
36
- abs = File.join(ROOT, Cfg[:res_dir], path)
37
- File.new abs if File.exists? abs
38
- end
39
-
40
- # Method class alias
41
- # might remove this at some point ( sorry Yannou I know u worked hard :( )
42
- self.singleton_class.send(:alias_method, :=~, :has_key?)
43
-
44
- def self.load(cfg_file)
45
- @@loaded = true
46
- @@mem = {}
47
-
48
- populate YAML.load(File.read(cfg_file))
49
- type_file = File.join(ROOT,'type',"#{@@mem[:type]}.yml")
50
- type_cfg = YAML.load(File.read(type_file))
51
- populate YAML.load(File.read(File.join(ROOT,'lang',"#{type_cfg['language']}.yml")))
52
- # So that project's type Cfg overrides
53
- # lang Cfg
54
- populate type_cfg
55
- end
56
-
57
- private
58
- #
59
- # Handy method to convert string keys
60
- # read from Cfg file to symbols
61
- #
62
- def self.populate(hash)
63
- hash.each { |k, v| @@mem[k.to_sym] = v}
64
- end
65
- end
66
- end
@@ -1,149 +0,0 @@
1
- $(function(){
2
- $('table').each(function() {
3
- if($(this).find('thead').length > 0 && $(this).find('th').length > 0) {
4
- // Clone <thead>
5
- var $w = $(window),
6
- $t = $(this),
7
- $thead = $t.find('thead').clone(),
8
- $col = $t.find('thead, tbody').clone();
9
-
10
- // Add class, remove margins, reset width and wrap table
11
- $t
12
- .addClass('sticky-enabled')
13
- .css({
14
- margin: 0,
15
- width: '100%'
16
- }).wrap('<div class="sticky-wrap" />');
17
-
18
- if($t.hasClass('overflow-y')) $t.removeClass('overflow-y').parent().addClass('overflow-y');
19
-
20
- // Create new sticky table head (basic)
21
- $t.after('<table class="sticky-thead" />');
22
-
23
- // If <tbody> contains <th>, then we create sticky column and intersect (advanced)
24
- if($t.find('tbody th').length > 0) {
25
- $t.after('<table class="sticky-col" /><table class="sticky-intersect" />');
26
- }
27
-
28
- // Create shorthand for things
29
- var $stickyHead = $(this).siblings('.sticky-thead'),
30
- $stickyCol = $(this).siblings('.sticky-col'),
31
- $stickyInsct = $(this).siblings('.sticky-intersect'),
32
- $stickyWrap = $(this).parent('.sticky-wrap');
33
-
34
- $stickyHead.append($thead);
35
-
36
- $stickyCol
37
- .append($col)
38
- .find('thead th:gt(0)').remove()
39
- .end()
40
- .find('tbody td').remove();
41
-
42
- $stickyInsct.html('<thead><tr><th>'+$t.find('thead th:first-child').html()+'</th></tr></thead>');
43
-
44
- // Set widths
45
- var setWidths = function () {
46
- $t
47
- .find('thead th').each(function (i) {
48
- $stickyHead.find('th').eq(i).width($(this).width());
49
- })
50
- .end()
51
- .find('tr').each(function (i) {
52
- $stickyCol.find('tr').eq(i).height($(this).height());
53
- });
54
-
55
- // Set width of sticky table head
56
- $stickyHead.width($t.width());
57
-
58
- // Set width of sticky table col
59
- $stickyCol.find('th').add($stickyInsct.find('th')).width($t.find('thead th').width())
60
- },
61
- repositionStickyHead = function () {
62
- // Return value of calculated allowance
63
- var allowance = calcAllowance();
64
-
65
- // Check if wrapper parent is overflowing along the y-axis
66
- if($t.height() > $stickyWrap.height()) {
67
- // If it is overflowing (advanced layout)
68
- // Position sticky header based on wrapper scrollTop()
69
- if($stickyWrap.scrollTop() > 0) {
70
- // When top of wrapping parent is out of view
71
- $stickyHead.add($stickyInsct).css({
72
- opacity: 1,
73
- top: $stickyWrap.scrollTop()
74
- });
75
- } else {
76
- // When top of wrapping parent is in view
77
- $stickyHead.add($stickyInsct).css({
78
- opacity: 0,
79
- top: 0
80
- });
81
- }
82
- } else {
83
- // If it is not overflowing (basic layout)
84
- // Position sticky header based on viewport scrollTop
85
- if($w.scrollTop() > $t.offset().top && $w.scrollTop() < $t.offset().top + $t.outerHeight() - allowance) {
86
- // When top of viewport is in the table itself
87
- $stickyHead.add($stickyInsct).css({
88
- opacity: 1,
89
- top: $w.scrollTop() - $t.offset().top
90
- });
91
- } else {
92
- // When top of viewport is above or below table
93
- $stickyHead.add($stickyInsct).css({
94
- opacity: 0,
95
- top: 0
96
- });
97
- }
98
- }
99
- },
100
- repositionStickyCol = function () {
101
- if($stickyWrap.scrollLeft() > 0) {
102
- // When left of wrapping parent is out of view
103
- $stickyCol.add($stickyInsct).css({
104
- opacity: 1,
105
- left: $stickyWrap.scrollLeft()
106
- });
107
- } else {
108
- // When left of wrapping parent is in view
109
- $stickyCol
110
- .css({ opacity: 0 })
111
- .add($stickyInsct).css({ left: 0 });
112
- }
113
- },
114
- calcAllowance = function () {
115
- var a = 0;
116
- // Calculate allowance
117
- $t.find('tbody tr:lt(3)').each(function () {
118
- a += $(this).height();
119
- });
120
-
121
- // Set fail safe limit (last three row might be too tall)
122
- // Set arbitrary limit at 0.25 of viewport height, or you can use an arbitrary pixel value
123
- if(a > $w.height()*0.25) {
124
- a = $w.height()*0.25;
125
- }
126
-
127
- // Add the height of sticky header
128
- a += $stickyHead.height();
129
- return a;
130
- };
131
-
132
- setWidths();
133
-
134
- $t.parent('.sticky-wrap').scroll($.throttle(250, function() {
135
- repositionStickyHead();
136
- repositionStickyCol();
137
- }));
138
-
139
- $w
140
- .load(setWidths)
141
- .resize($.debounce(250, function () {
142
- setWidths();
143
- repositionStickyHead();
144
- repositionStickyCol();
145
- }))
146
- .scroll($.throttle(250, repositionStickyHead));
147
- }
148
- });
149
- });