Link github project on ?pp=help menu (#510)

Link github project on ?pp=help menu (#510)

  • Link github project on ?pp=help menu

Closes Show gem name somewhere. · Issue #503 · MiniProfiler/rack-mini-profiler · GitHub

  • Apply suggestions from code review

Co-authored-by: Sam sam.saffron@gmail.com

diff --git a/lib/mini_profiler/profiler.rb b/lib/mini_profiler/profiler.rb
index f127fb3..fa6bb7d 100644
--- a/lib/mini_profiler/profiler.rb
+++ b/lib/mini_profiler/profiler.rb
@@ -652,7 +652,7 @@ module Rack
       headers = { 'Content-Type' => 'text/html' }
       body = "<html><body>
 <pre style='line-height: 30px; font-size: 16px;'>
-Append the following to your query string:
+This is the help menu of the <a href='#{Rack::MiniProfiler::SOURCE_CODE_URI}'>rack-mini-profiler</a> gem, append the following to your query string for more options:
 
   #{make_link "help", env} : display this screen
   #{make_link "env", env} : display the rack environment
diff --git a/lib/mini_profiler/version.rb b/lib/mini_profiler/version.rb
index 9b6b72c..f70c358 100644
--- a/lib/mini_profiler/version.rb
+++ b/lib/mini_profiler/version.rb
@@ -3,5 +3,6 @@
 module Rack
   class MiniProfiler
     VERSION = '2.3.2'
+    SOURCE_CODE_URI = 'https://github.com/MiniProfiler/rack-mini-profiler'
   end
 end
diff --git a/rack-mini-profiler.gemspec b/rack-mini-profiler.gemspec
index 79278b8..4354552 100644
--- a/rack-mini-profiler.gemspec
+++ b/rack-mini-profiler.gemspec
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
   s.required_ruby_version = '>= 2.4.0'
 
   s.metadata = {
-    'source_code_uri' => 'https://github.com/MiniProfiler/rack-mini-profiler',
+    'source_code_uri' => Rack::MiniProfiler::SOURCE_CODE_URI,
     'changelog_uri' => 'https://github.com/MiniProfiler/rack-mini-profiler/blob/master/CHANGELOG.md'
   }
 

GitHub sha: bfcbe595749f3b5611df8fcd2306d1d50087f01d

This commit appears in #510 which was merged by SamSaffron.