Enforce frozen_string_literal

Enforce frozen_string_literal

This also properly drops support for Ruby 2.2

diff --git a/Gemfile b/Gemfile
index b6be25b..256d54a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,14 +1,12 @@
+# frozen_string_literal: true
+
 source 'http://rubygems.org'
-ruby '>= 2.2.0'
+ruby '>= 2.3.0'
 
 gemspec
 
 gem 'codecov', require: false, group: :test
 
-if RUBY_VERSION < '2.2.2'
-  gem 'rack', '1.6.4'
-end
-
 group :development do
   gem 'guard', platforms: [:mri_22, :mri_23]
   gem 'guard-rspec', platforms: [:mri_22, :mri_23]
diff --git a/Guardfile b/Guardfile
index 3817c94..fc72266 100644
--- a/Guardfile
+++ b/Guardfile
@@ -1,4 +1,5 @@
-# A sample Guardfile
+# frozen_string_literal: true
+
 # More info at https://github.com/guard/guard#readme
 
 directories %w(lib spec) \
diff --git a/Rakefile b/Rakefile
index 8ecffce..42ef68c 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,4 +1,4 @@
-# Rakefile
+# frozen_string_literal: true
 require 'rubygems'
 require 'bundler'
 require 'bundler/gem_tasks'
@@ -36,9 +36,10 @@ task update_asset_version: :compile_sass do
   end
   File.open('lib/mini_profiler/asset_version.rb', 'w') do |f|
     f.write \
-"module Rack
+"# frozen_string_literal: true
+module Rack
   class MiniProfiler
-    ASSET_VERSION = '#{Digest::MD5.hexdigest(h.sort.join(''))}'.freeze
+    ASSET_VERSION = '#{Digest::MD5.hexdigest(h.sort.join(''))}'
   end
 end\n"
   end
diff --git a/lib/mini_profiler/asset_version.rb b/lib/mini_profiler/asset_version.rb
index b7c1fc2..032288e 100644
--- a/lib/mini_profiler/asset_version.rb
+++ b/lib/mini_profiler/asset_version.rb
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
 module Rack
   class MiniProfiler
-    ASSET_VERSION = 'e7cc2f0165a64084b6ec661c38cde91f'.freeze
+    ASSET_VERSION = 'e7cc2f0165a64084b6ec661c38cde91f'
   end
 end
diff --git a/lib/mini_profiler/profiler.rb b/lib/mini_profiler/profiler.rb
index fb481a9..b064ada 100644
--- a/lib/mini_profiler/profiler.rb
+++ b/lib/mini_profiler/profiler.rb
@@ -71,7 +71,7 @@ module Rack
       MiniProfiler.config.merge!(config)
       @config = MiniProfiler.config
       @app    = app
-      @config.base_url_path << "/" unless @config.base_url_path.end_with? "/"
+      @config.base_url_path += "/" unless @config.base_url_path.end_with? "/"
       unless @config.storage_instance
         @config.storage_instance = @config.storage.new(@config.storage_options)
       end
diff --git a/rack-mini-profiler.gemspec b/rack-mini-profiler.gemspec
index fb81f99..5bfc05a 100644
--- a/rack-mini-profiler.gemspec
+++ b/rack-mini-profiler.gemspec
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 lib = File.expand_path('../lib', __FILE__)
 $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
 require 'mini_profiler/version'
diff --git a/spec/integration/middleware_spec.rb b/spec/integration/middleware_spec.rb
index 7301003..3a87abc 100644
--- a/spec/integration/middleware_spec.rb
+++ b/spec/integration/middleware_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 require 'rack/test'
 require 'zlib'
 
@@ -26,7 +28,7 @@ describe Rack::MiniProfiler do
     def app
       Rack::Builder.new do
         use Rack::MiniProfiler
-        run lambda { |_env| [200, { 'Content-Type' => 'text/html' }, ['<html><body><h1>Hi</h1></body></html>']] }
+        run lambda { |_env| [200, { 'Content-Type' => 'text/html' }, [+'<html><body><h1>Hi</h1></body></html>']] }
       end
     end
 
@@ -41,7 +43,7 @@ describe Rack::MiniProfiler do
       Rack::Builder.new do
         use Rack::MiniProfiler
         use Rack::Deflater
-        run lambda { |_env| [200, { 'Content-Type' => 'text/html' }, ['<html><body><h1>Hi</h1></body></html>']] }
+        run lambda { |_env| [200, { 'Content-Type' => 'text/html' }, [+'<html><body><h1>Hi</h1></body></html>']] }
       end
     end
 
@@ -77,7 +79,7 @@ describe Rack::MiniProfiler do
       Rack::Builder.new do
         use Rack::Deflater
         use Rack::MiniProfiler
-        run lambda { |_env| [200, { 'Content-Type' => 'text/html' }, ['<html><body><h1>Hi</h1></body></html>']] }
+        run lambda { |_env| [200, { 'Content-Type' => 'text/html' }, [+'<html><body><h1>Hi</h1></body></html>']] }
       end
     end
 
diff --git a/spec/integration/mini_profiler_spec.rb b/spec/integration/mini_profiler_spec.rb
index 3c19f33..b24909c 100644
--- a/spec/integration/mini_profiler_spec.rb
+++ b/spec/integration/mini_profiler_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 require 'rack/test'
 
 describe Rack::MiniProfiler do
@@ -7,10 +9,10 @@ describe Rack::MiniProfiler do
     @app ||= Rack::Builder.new {
       use Rack::MiniProfiler
       map '/path2/a' do
-        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, '<h1>path1</h1>'] }
+        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, +'<h1>path1</h1>'] }
       end
       map '/path1/a' do
-        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, '<h1>path2</h1>'] }
+        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, +'<h1>path2</h1>'] }
       end
       map '/cached-resource' do
         run lambda { |env|
@@ -23,50 +25,50 @@ describe Rack::MiniProfiler do
         }
       end
       map '/post' do
-        run lambda { |env| [302, { 'Content-Type' => 'text/html' }, '<h1>POST</h1>'] }
+        run lambda { |env| [302, { 'Content-Type' => 'text/html' }, +'<h1>POST</h1>'] }
       end
       map '/html' do
-        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, "<html><BODY><h1>Hi</h1></BODY>\n \t</html>"] }
+        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, +"<html><BODY><h1>Hi</h1></BODY>\n \t</html>"] }
       end
       map '/whitelisted-html' do
         run lambda { |env|
           Rack::MiniProfiler.authorize_request
-          [200, { 'Content-Type' => 'text/html' }, "<html><BODY><h1>Hi</h1></BODY>\n \t</html>"]
+          [200, { 'Content-Type' => 'text/html' }, +"<html><BODY><h1>Hi</h1></BODY>\n \t</html>"]
         }
       end
       map '/implicitbody' do
-        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, "<html><h1>Hi</h1></html>"] }
+        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, +"<html><h1>Hi</h1></html>"] }
       end
       map '/implicitbodyhtml' do
-        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, "<h1>Hi</h1>"] }
+        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, +"<h1>Hi</h1>"] }
       end
       map '/db' do
         run lambda { |env|
           ::Rack::MiniProfiler.record_sql("I want to be, in a db", 10)
-          [200, { 'Content-Type' => 'text/html' }, '<h1>Hi+db</h1>']
+          [200, { 'Content-Type' => 'text/html' }, +'<h1>Hi+db</h1>']
         }
       end
       map '/3ms' do
         run lambda { |env|
           sleep(0.003)
-          [200, { 'Content-Type' => 'text/html' }, '<h1>Hi</h1>']
+          [200, { 'Content-Type' => 'text/html' }, +'<h1>Hi</h1>']
         }
       end
       map '/whitelisted' do
         run lambda { |env|
           Rack::MiniProfiler.authorize_request
-          [200, { 'Content-Type' => 'text/html' }, '<h1>path1</h1>']
+          [200, { 'Content-Type' => 'text/html' }, +'<h1>path1</h1>']
         }
       end
       map '/rails_engine' do
         run lambda { |env|
           env['SCRIPT_NAME'] = '/rails_engine'  # Rails engines do that
-          [200, { 'Content-Type' => 'text/html' }, '<html><h1>Hi</h1></html>']
+          [200, { 'Content-Type' => 'text/html' }, +'<html><h1>Hi</h1></html>']
         }
       end
       map '/under_passenger' do
         run lambda { |env|
-          [200, { 'Content-Type' => 'text/html' }, '<html><h1>and I ride and I ride</h1></html>']
+          [200, { 'Content-Type' => 'text/html' }, +'<html><h1>and I ride and I ride</h1></html>']
         }
       end
     }.to_app
diff --git a/spec/integration/trace_exceptions_spec.rb b/spec/integration/trace_exceptions_spec.rb
index 9cbae37..ff77acb 100644
--- a/spec/integration/trace_exceptions_spec.rb
+++ b/spec/integration/trace_exceptions_spec.rb
@@ -1,9 +1,11 @@
+# frozen_string_literal: true
+

[... diff too long, it was truncated ...]

GitHub sha: ea182527