24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/linkify_errors.rb', line 24
def self.linkify(str)
file, line, desc = str.split(':')
if file[0..0] == "/"
elsif file =~ /(.*) \((.*)\) (.*)/
gemspecs = Gem.source_index.find_name($1)
version_in_use = gemspecs.find {|gemspec| gemspec.version.to_s == $2 }
base_path = version_in_use.rg_full_gem_path
file = "#{base_path}/#{$3}"
else
file = Rails.root + file
end
url = "#{PROTOCOL}://#{line}@#{file}"
"<a href='#{url}'>#{str}</a>".html_safe
end
|