You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

info.rb 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # frozen_string_literal: true
  2. module Redmine
  3. module Info
  4. class << self
  5. def app_name; 'Redmine' end
  6. def url; 'https://www.redmine.org/' end
  7. def help_url; 'https://www.redmine.org/guide' end
  8. def versioned_name; "#{app_name} #{Redmine::VERSION}" end
  9. def environment
  10. s = +"Environment:\n"
  11. s << [
  12. ["Redmine version", Redmine::VERSION],
  13. ["Ruby version", "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"],
  14. ["Rails version", Rails::VERSION::STRING],
  15. ["Environment", Rails.env],
  16. ["Database adapter", ActiveRecord::Base.connection.adapter_name],
  17. ["Mailer queue", ActionMailer::MailDeliveryJob.queue_adapter.class.name],
  18. ["Mailer delivery", ActionMailer::Base.delivery_method]
  19. ].map {|info| " %-30s %s" % info}.join("\n") + "\n"
  20. theme_string = ''
  21. theme_string += (Setting.ui_theme.blank? ? 'Default' : Setting.ui_theme.capitalize)
  22. unless Setting.ui_theme.blank? ||
  23. Redmine::Themes.theme(Setting.ui_theme).nil? ||
  24. !Redmine::Themes.theme(Setting.ui_theme).javascripts.include?('theme')
  25. theme_string += ' (includes JavaScript)'
  26. end
  27. s << "Redmine settings:\n"
  28. s << [
  29. ["Redmine theme", theme_string]
  30. ].map {|settings| " %-30s %s" % settings}.join("\n") + "\n"
  31. s << "SCM:\n"
  32. Redmine::Scm::Base.all.each do |scm|
  33. scm_class = "Repository::#{scm}".constantize
  34. if scm_class.scm_available
  35. s << " %-30s %s\n" % [scm, scm_class.scm_version_string]
  36. end
  37. end
  38. s << "Redmine plugins:\n"
  39. plugins = Redmine::Plugin.all
  40. if plugins.any?
  41. s << plugins.map {|plugin| " %-30s %s" % [plugin.id.to_s, plugin.version.to_s]}.join("\n")
  42. else
  43. s << " no plugin installed"
  44. end
  45. end
  46. end
  47. end
  48. end