continuous4r 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +10 -3
- data/Manifest.txt +4 -0
- data/lib/changelog_builder.rb +10 -4
- data/lib/continuous4r.rb +165 -127
- data/lib/dcov_builder.rb +22 -1
- data/lib/flay_builder.rb +53 -7
- data/lib/flog_builder.rb +24 -0
- data/lib/rcov_builder.rb +33 -11
- data/lib/reek_builder.rb +50 -6
- data/lib/saikuro_builder.rb +28 -0
- data/lib/site/body-continuous4r-reports.rhtml +57 -1
- data/lib/site/body-dependencies.rhtml +16 -7
- data/lib/site/body-flay.rhtml +1 -1
- data/lib/site/build.xml.erb +48 -0
- data/lib/site/charts/AC_RunActiveContent.js +292 -0
- data/lib/site/charts/charts.swf +0 -0
- data/lib/site/charts/charts_library/pono.swf +0 -0
- data/lib/site/flog.html.erb +8 -4
- data/lib/site/flog_page.html.erb +20 -1
- data/lib/site/header.rhtml +1 -13
- data/lib/site/menu-continuous4r-reports.rhtml +6 -1
- data/lib/site/menu-task.rhtml +6 -1
- data/lib/tests_builder.rb +10 -0
- data/lib/utils.rb +69 -1
- data/lib/zen_test_formatter.rb +1 -1
- data/lib/zentest_builder.rb +10 -0
- data/website/index.txt +37 -28
- metadata +6 -2
data/lib/utils.rb
CHANGED
@@ -31,7 +31,7 @@ module Utils
|
|
31
31
|
# Methode de verification de la presence d'un gem, avec installation au besoin
|
32
32
|
def self.verify_gem_presence(gem, auto_install, proxy_option)
|
33
33
|
gem_version = run_command("gem list #{gem}")
|
34
|
-
if gem_version.
|
34
|
+
if gem_version.nil? or gem_version.strip.empty?
|
35
35
|
if auto_install == "true"
|
36
36
|
puts " Installing #{gem}..."
|
37
37
|
gem_installed = Utils.run_command("#{"sudo " unless Config::CONFIG['host_os'] =~ /mswin/}gem install #{gem}#{proxy_option}")
|
@@ -44,4 +44,72 @@ module Utils
|
|
44
44
|
end
|
45
45
|
|
46
46
|
end
|
47
|
+
|
48
|
+
# Methode qui permet de convertir un pourcentage d'un builder en couleur css/html
|
49
|
+
def self.percent_to_css_style(percent)
|
50
|
+
style = "style='font-weight: bold; color: "
|
51
|
+
if percent >= 90 and percent <= 100
|
52
|
+
style += "#00cc00;'"
|
53
|
+
elsif percent >= 80 and percent < 90
|
54
|
+
style += "yellow;'"
|
55
|
+
elsif percent >= 60 and percent < 80
|
56
|
+
style += "red;'"
|
57
|
+
elsif percent >= 0 and percent < 60
|
58
|
+
style += "red; text-decoration: blink;'"
|
59
|
+
end
|
60
|
+
return style
|
61
|
+
end
|
62
|
+
|
63
|
+
# Méthode qui permet de récupérerle numéro de build courant dans le SCM
|
64
|
+
def self.build_name
|
65
|
+
if File.exist?(".git")
|
66
|
+
return "commit #{Utils.run_command("git log").split(/$/).select{ |l| l =~ /^commit / }.collect { |l| l[8..(l.length-1)] }[0]}"
|
67
|
+
elsif File.exist?(".svn")
|
68
|
+
get_head_log = Utils.run_command("svn log -r HEAD")
|
69
|
+
get_head_log_lines = get_head_log.split(/$/)
|
70
|
+
revision = get_head_log_lines[1].split(/ \| /)[0]
|
71
|
+
revision = revision[2..(revision.length-1)]
|
72
|
+
return "revision #{revision}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# Méthode qui permet de typer une cellule de table HTML en fonction d'un score flog
|
77
|
+
def self.flog_caracteristics(flog_score)
|
78
|
+
if flog_score >= 0 and flog_score < 11
|
79
|
+
"title='Awesome'"
|
80
|
+
elsif flog_score >= 11 and flog_score < 21
|
81
|
+
"title='Good enough'"
|
82
|
+
elsif flog_score >= 21 and flog_score < 41
|
83
|
+
"style='background-color: #FFFF99; color: black;' title='Might need refactoring'"
|
84
|
+
elsif flog_score >= 41 and flog_score < 61
|
85
|
+
"style='background-color: yellow; color: black;' title='Possible to justify'"
|
86
|
+
elsif flog_score >= 61 and flog_score < 100
|
87
|
+
"style='background-color: orange; color: black;' title='Danger'"
|
88
|
+
elsif flog_score >= 100 and flog_score < 200
|
89
|
+
"style='background-color: red; color: black;' title='Whoop, whoop, whoop'"
|
90
|
+
elsif flog_score > 200
|
91
|
+
"style='background-color: black; color: white;' title='Someone please think of the children'"
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Methode qui permet de convertir un score flog en couleur css/html de titre
|
96
|
+
def self.flog_score_to_css_style(flog_score)
|
97
|
+
style = "style='font-weight: bold; "
|
98
|
+
if flog_score >= 0 and flog_score < 11
|
99
|
+
style += "background-color: #00cc00;' title='Awesome'"
|
100
|
+
elsif flog_score >= 11 and flog_score < 21
|
101
|
+
style += "background-color: #00cc00;' title='Good enough'"
|
102
|
+
elsif flog_score >= 21 and flog_score < 41
|
103
|
+
style += "background-color: #ffff99;' title='Might need refactoring'"
|
104
|
+
elsif flog_score >= 41 and flog_score < 61
|
105
|
+
style += "background-color: yellow;' title='Possible to justify'"
|
106
|
+
elsif flog_score >= 61 and flog_score < 100
|
107
|
+
style += "background-color: orange;' title='Danger'"
|
108
|
+
elsif flog_score >= 100 and flog_score < 200
|
109
|
+
style += "background-color: red;' title='Whoop, whoop, whoop'"
|
110
|
+
elsif flog_score > 200
|
111
|
+
style += "background-color: red; color: black; text-decoration: blink;' title='Someone please think of the children'"
|
112
|
+
end
|
113
|
+
return style
|
114
|
+
end
|
47
115
|
end
|
data/lib/zen_test_formatter.rb
CHANGED
data/lib/zentest_builder.rb
CHANGED
@@ -6,6 +6,16 @@
|
|
6
6
|
class ZentestBuilder
|
7
7
|
include Utils
|
8
8
|
|
9
|
+
# Prérequis à la tâche
|
10
|
+
def prerequisite_met?
|
11
|
+
Dir.glob("test/**/*.rb").length > 0
|
12
|
+
end
|
13
|
+
|
14
|
+
# Dans le cas de l'erreur de prérequis
|
15
|
+
def prerequisite_unmet_message
|
16
|
+
" No tests found. The 'ZenTest' task will be empty."
|
17
|
+
end
|
18
|
+
|
9
19
|
# Implementation de la construction de la tache
|
10
20
|
def build(project_name, auto_install, proxy_option)
|
11
21
|
# On verifie la presence de ZenTest
|
data/website/index.txt
CHANGED
@@ -20,8 +20,17 @@ h2. Installing
|
|
20
20
|
|
21
21
|
<pre syntax="ruby">[sudo] gem install continuous4r</pre>
|
22
22
|
|
23
|
+
h2. Release notes for 0.0.3 version
|
23
24
|
|
24
|
-
|
25
|
+
<ul>
|
26
|
+
<li>Major bug fixes on rcov, ZenTest, tests, and changelog builders.</li>
|
27
|
+
<li>Various bug fixes on gems and tasks management.</li>
|
28
|
+
<li>Tests made on other projects than mine !!! (Apologies, everyone).</li>
|
29
|
+
<li>Introduction of reporting quality indicators (will be completed for 0.0.4).</li>
|
30
|
+
<li>The release of 0.0.4 will be here very shortly, this release is here for build capability.</li>
|
31
|
+
</ul>
|
32
|
+
|
33
|
+
h2. Release notes for 0.0.2 version
|
25
34
|
|
26
35
|
<ul>
|
27
36
|
<li>Full Windows support, and no need for the user to define the HOME environment variable.</li>
|
@@ -54,32 +63,32 @@ Just type this command and the file will be created :
|
|
54
63
|
Here is the content of this file, you can customize it to suite your needs :
|
55
64
|
|
56
65
|
<pre syntax="xml"><project name="FIXME project name" auto-install-gems="true"
|
57
|
-
auto-install-tools="true" ignore-tests-failures="true">
|
58
|
-
<description>FIXME project description</description>
|
59
|
-
<url>FIXME project URL</url>
|
60
|
-
<logo>FIXME Logo URL</logo>
|
61
|
-
<company>
|
62
|
-
<denomination>FIXME your company name here</denomination>
|
63
|
-
<url>FIXME your company website URL here</url>
|
64
|
-
<logo>FIXME your company logo URL here</logo>
|
65
|
-
</company>
|
66
|
-
<members>
|
67
|
-
<member id="FIXME user login" name="FIXME user name" email="FIXME user email"
|
66
|
+
auto-install-tools="true" ignore-tests-failures="true">
|
67
|
+
<description>FIXME project description</description>
|
68
|
+
<url>FIXME project URL</url>
|
69
|
+
<logo>FIXME Logo URL</logo>
|
70
|
+
<company>
|
71
|
+
<denomination>FIXME your company name here</denomination>
|
72
|
+
<url>FIXME your company website URL here</url>
|
73
|
+
<logo>FIXME your company logo URL here</logo>
|
74
|
+
</company>
|
75
|
+
<members>
|
76
|
+
<member id="FIXME user login" name="FIXME user name" email="FIXME user email"
|
68
77
|
roles="FIXME user roles, separated by commas"
|
69
|
-
company="FIXME company/organisation name"/>
|
70
|
-
</members>
|
71
|
-
<bugtracker>
|
72
|
-
<tracker_type>[Trac|Bugzilla|Mantis|etc...]</tracker_type>
|
73
|
-
<tracker_url>BUGTRACKER_URL</tracker_url>
|
74
|
-
<tracker_account_create>BUGTRACKER_URL_ACCOUNT_CREATION</tracker_account_create>
|
75
|
-
<search>BUGTRACKER_URL_SEARCH_TICKETS</search>
|
76
|
-
<url>BUGTRACKER_URL_TICKETS_LIST</url>
|
77
|
-
<add>BUGTRACKER_URL_TICKET_ADD</add>
|
78
|
-
</bugtracker>
|
79
|
-
<!-- Gems mandatory for your project -->
|
80
|
-
<gems repository="http://gems.rubyforge.org/gems/">
|
81
|
-
<gem name="GEM_NAME" version="GEM_VERSION"/>
|
82
|
-
</gems>
|
78
|
+
company="FIXME company/organisation name"/>
|
79
|
+
</members>
|
80
|
+
<bugtracker>
|
81
|
+
<tracker_type>[Trac|Bugzilla|Mantis|etc...]</tracker_type>
|
82
|
+
<tracker_url>BUGTRACKER_URL</tracker_url>
|
83
|
+
<tracker_account_create>BUGTRACKER_URL_ACCOUNT_CREATION</tracker_account_create>
|
84
|
+
<search>BUGTRACKER_URL_SEARCH_TICKETS</search>
|
85
|
+
<url>BUGTRACKER_URL_TICKETS_LIST</url>
|
86
|
+
<add>BUGTRACKER_URL_TICKET_ADD</add>
|
87
|
+
</bugtracker>
|
88
|
+
<!-- Gems mandatory for your project -->
|
89
|
+
<gems repository="http://gems.rubyforge.org/gems/">
|
90
|
+
<gem name="GEM_NAME" version="GEM_VERSION"/>
|
91
|
+
</gems>
|
83
92
|
</project>
|
84
93
|
</pre>
|
85
94
|
|
@@ -99,8 +108,8 @@ h3. Proxy configuration
|
|
99
108
|
If you are behind a HTTP proxy within your company, you can configure it with a simple YAML file.
|
100
109
|
Create a file named proxy.yml within your USER_HOME/.continuous4r directory, with the following content :
|
101
110
|
|
102
|
-
<pre syntax="yaml">proxy:
|
103
|
-
server: my.proxy.server
|
111
|
+
<pre syntax="yaml">proxy:
|
112
|
+
server: my.proxy.server
|
104
113
|
port: my_port
|
105
114
|
login: my_login
|
106
115
|
password: my_password
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: continuous4r
|
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
|
- Vincent Dubois
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-03-03 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -57,6 +57,10 @@ files:
|
|
57
57
|
- lib/subversion_extractor.rb
|
58
58
|
- lib/tests_formatter.rb
|
59
59
|
- lib/zen_test_formatter.rb
|
60
|
+
- lib/site/charts/charts.swf
|
61
|
+
- lib/site/build.xml.erb
|
62
|
+
- lib/site/charts/AC_RunActiveContent.js
|
63
|
+
- lib/site/charts/charts_library/pono.swf
|
60
64
|
- lib/site/body-changelog.rhtml
|
61
65
|
- lib/site/body-continuous4r-reports.rhtml
|
62
66
|
- lib/site/body-dcov.rhtml
|