diff --git a/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb b/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb new file mode 100644 index 0000000..ce403f6 --- /dev/null +++ b/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb @@ -0,0 +1,5 @@ +class MezuroPlugin::Helpers::ContentViewerHelper + def self.format_grade(grade) + grade.slice(/[0-9]+\.[0-9]{1,2}/) + end +end diff --git a/plugins/mezuro/views/content_viewer/_module_result.rhtml b/plugins/mezuro/views/content_viewer/_module_result.rhtml index 6b3fe40..3bb1dd8 100644 --- a/plugins/mezuro/views/content_viewer/_module_result.rhtml +++ b/plugins/mezuro/views/content_viewer/_module_result.rhtml @@ -1,3 +1,5 @@ +<% require "#{RAILS_ROOT}/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb" %> + <% the_module = module_result.module %> <% module_label = "#{the_module.name} (#{the_module.granularity})" %> @@ -19,7 +21,7 @@ <% range = metric_result.range %>