ChiliProject is not maintained anymore. Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.
cp1353-add_env_info_on_admin_info_view-stable_93de0ba66.patch
b/app/views/admin/info.rhtml | ||
---|---|---|
1 | 1 |
<h2><%=l(:label_information_plural)%></h2> |
2 | 2 | |
3 |
<p><strong><%= Redmine::Info.versioned_name %></strong> (<%= @db_adapter_name %>)</p>
|
|
3 |
<p><strong><%= Redmine::Info.versioned_name %></strong></p> |
|
4 | 4 | |
5 | 5 |
<table class="list"> |
6 | 6 |
<% @checklist.each do |label, result| %> |
... | ... | |
10 | 10 |
</tr> |
11 | 11 |
<% end %> |
12 | 12 |
</table> |
13 |
<br /> |
|
14 |
<div class="box"> |
|
15 |
<pre><%= ChiliProject::Info.environment %></pre> |
|
16 |
</div> |
|
13 | 17 | |
14 | 18 |
<% html_title(l(:label_information_plural)) -%> |
b/lib/chili_project/info.rb | ||
---|---|---|
26 | 26 |
def issue(issue_id) |
27 | 27 |
url + 'issues/' + issue_id.to_s |
28 | 28 |
end |
29 | ||
30 |
def environment |
|
31 |
s = "Environment:\n" |
|
32 |
s << [ |
|
33 |
["ChiliProject version", ChiliProject::VERSION], |
|
34 |
["Ruby version", "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"], |
|
35 |
["Rails version", Rails::VERSION::STRING], |
|
36 |
["Environment", Rails.env], |
|
37 |
["Database adapter", ChiliProject::Database.adapter_name] |
|
38 |
].map {|info| " %-30s %s" % info}.join("\n") + "\n" |
|
39 | ||
40 |
s << "SCM:\n" |
|
41 |
Redmine::Scm::Base.all.each do |scm| |
|
42 |
scm_class = "Repository::#{scm}".constantize |
|
43 |
if scm_class.scm_available |
|
44 |
s << " %-30s %s\n" % [scm, scm_class.scm_version_string] |
|
45 |
end |
|
46 |
end |
|
47 | ||
48 |
s << "ChiliProject plugins:\n" |
|
49 |
plugins = Redmine::Plugin.all |
|
50 |
if plugins.any? |
|
51 |
s << plugins.map {|plugin| " %-30s %s" % [plugin.id.to_s, plugin.version.to_s]}.join("\n") |
|
52 |
else |
|
53 |
s << " no plugin installed" |
|
54 |
end |
|
55 |
end |
|
56 | ||
29 | 57 |
end |
30 | 58 |
end |
31 | 59 |
end |
b/test/unit/lib/chili_project/info_test.rb | ||
---|---|---|
1 |
#-- encoding: UTF-8 |
|
2 |
#-- copyright |
|
3 |
# ChiliProject is a project management system. |
|
4 |
# |
|
5 |
# Copyright (C) 2010-2013 the ChiliProject Team |
|
6 |
# |
|
7 |
# This program is free software; you can redistribute it and/or |
|
8 |
# modify it under the terms of the GNU General Public License |
|
9 |
# as published by the Free Software Foundation; either version 2 |
|
10 |
# of the License, or (at your option) any later version. |
|
11 |
# |
|
12 |
# See doc/COPYRIGHT.rdoc for more details. |
|
13 |
#++ |
|
14 |
require File.expand_path('../../../../test_helper', __FILE__) |
|
15 | ||
16 |
class ChiliProject::InfoTest < ActiveSupport::TestCase |
|
17 |
def test_environment |
|
18 |
env = ChiliProject::Info.environment |
|
19 | ||
20 |
assert_kind_of String, env |
|
21 |
assert_match 'Environment:', env |
|
22 |
assert_match 'ChiliProject version', env |
|
23 |
assert_match 'SCM:', env |
|
24 |
assert_match 'ChiliProject plugins:', env |
|
25 | ||
26 |
end |
|
27 |
end |