From d5b4eaf0e8b69e9cc3dcf91d5be0a0919084d55c Mon Sep 17 00:00:00 2001 From: r7kamura Date: Thu, 9 Oct 2025 11:21:43 +0900 Subject: [PATCH] Add `# frozen_string_literal: true` --- Gemfile | 1 + Rakefile | 1 + lib/rack/tracker.rb | 1 + lib/rack/tracker/bing/bing.rb | 1 + lib/rack/tracker/controller.rb | 1 + lib/rack/tracker/criteo/criteo.rb | 1 + lib/rack/tracker/drift/drift.rb | 1 + lib/rack/tracker/extensions.rb | 1 + lib/rack/tracker/facebook/facebook.rb | 1 + lib/rack/tracker/facebook_pixel/facebook_pixel.rb | 1 + lib/rack/tracker/go_squared/go_squared.rb | 1 + .../google_adwords_conversion/google_adwords_conversion.rb | 1 + lib/rack/tracker/google_analytics/google_analytics.rb | 1 + lib/rack/tracker/google_global/google_global.rb | 1 + lib/rack/tracker/google_tag_manager/google_tag_manager.rb | 1 + lib/rack/tracker/handler.rb | 1 + lib/rack/tracker/handler_delegator.rb | 1 + lib/rack/tracker/heap/heap.rb | 1 + lib/rack/tracker/hotjar/hotjar.rb | 1 + lib/rack/tracker/hubspot/hubspot.rb | 1 + lib/rack/tracker/javascript_helper.rb | 5 +++-- lib/rack/tracker/railtie.rb | 1 + lib/rack/tracker/version.rb | 1 + lib/rack/tracker/vwo/vwo.rb | 1 + lib/rack/tracker/zanox/zanox.rb | 1 + rack-tracker.gemspec | 1 + spec/benchmark/tracker_injection_benchmark.rb | 1 + spec/handler/bing_spec.rb | 1 + spec/handler/criteo_spec.rb | 1 + spec/handler/drift_spec.rb | 1 + spec/handler/facebook_pixel_spec.rb | 1 + spec/handler/facebook_spec.rb | 1 + spec/handler/go_squared_spec.rb | 1 + spec/handler/google_adwords_conversion_spec.rb | 1 + spec/handler/google_analytics_spec.rb | 1 + spec/handler/google_global_spec.rb | 1 + spec/handler/google_tag_manager_spec.rb | 3 ++- spec/handler/handler_spec.rb | 1 + spec/handler/heap_spec.rb | 1 + spec/handler/hotjar_spec.rb | 1 + spec/handler/hubspot_spec.rb | 1 + spec/handler/vwo_spec.rb | 1 + spec/handler/zanox_spec.rb | 1 + spec/integration/bing_integration_spec.rb | 1 + spec/integration/criteo_integration_spec.rb | 1 + spec/integration/drift_integration_spec.rb | 1 + spec/integration/facebook_integration_spec.rb | 1 + spec/integration/facebook_pixel_integration_spec.rb | 1 + spec/integration/go_squared_integration_spec.rb | 1 + .../google_adwords_conversion_integration_spec.rb | 1 + spec/integration/google_analytics_integration_spec.rb | 1 + spec/integration/google_global_integration_spec.rb | 1 + spec/integration/google_tag_manager_integration_spec.rb | 1 + spec/integration/heap_integration_spec.rb | 1 + spec/integration/hotjar_integration_spec.rb | 1 + spec/integration/hubspot_integration_spec.rb | 1 + spec/integration/rails_integration_spec.rb | 1 + spec/integration/vwo_integration_spec.rb | 1 + spec/integration/zanox_integration_spec.rb | 1 + spec/spec_helper.rb | 1 + spec/support/capybara_app_helper.rb | 1 + spec/support/fake_handler.rb | 1 + spec/support/metal_controller.rb | 1 + spec/tracker/controller_spec.rb | 1 + spec/tracker/handler_delegator_spec.rb | 1 + spec/tracker/handler_set_spec.rb | 1 + spec/tracker/javascript_helper_spec.rb | 5 +++-- 67 files changed, 72 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 927117b..b11c27e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true source 'https://rubygems.org' # Specify your gem's dependencies in rack-tracker.gemspec diff --git a/Rakefile b/Rakefile index c382fee..d9b4b4c 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/gem_tasks" require 'rspec/core/rake_task' diff --git a/lib/rack/tracker.rb b/lib/rack/tracker.rb index 4e10d87..92075ed 100644 --- a/lib/rack/tracker.rb +++ b/lib/rack/tracker.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rack" require "tilt" require "active_support/core_ext/class/attribute" diff --git a/lib/rack/tracker/bing/bing.rb b/lib/rack/tracker/bing/bing.rb index f7e71c7..eae9f55 100644 --- a/lib/rack/tracker/bing/bing.rb +++ b/lib/rack/tracker/bing/bing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::Bing < Rack::Tracker::Handler class Conversion < OpenStruct diff --git a/lib/rack/tracker/controller.rb b/lib/rack/tracker/controller.rb index 801a52a..bbb780f 100644 --- a/lib/rack/tracker/controller.rb +++ b/lib/rack/tracker/controller.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Rack class Tracker module Controller diff --git a/lib/rack/tracker/criteo/criteo.rb b/lib/rack/tracker/criteo/criteo.rb index 5a71c7b..ca1bd54 100644 --- a/lib/rack/tracker/criteo/criteo.rb +++ b/lib/rack/tracker/criteo/criteo.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::Criteo < Rack::Tracker::Handler TRACKER_EVENTS = { diff --git a/lib/rack/tracker/drift/drift.rb b/lib/rack/tracker/drift/drift.rb index fb7fe34..0009dfc 100644 --- a/lib/rack/tracker/drift/drift.rb +++ b/lib/rack/tracker/drift/drift.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true class Rack::Tracker::Drift < Rack::Tracker::Handler end diff --git a/lib/rack/tracker/extensions.rb b/lib/rack/tracker/extensions.rb index bfbe832..696de71 100644 --- a/lib/rack/tracker/extensions.rb +++ b/lib/rack/tracker/extensions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'ostruct' # Backport of 2.0.0 stdlib ostruct#to_h diff --git a/lib/rack/tracker/facebook/facebook.rb b/lib/rack/tracker/facebook/facebook.rb index 67a9311..6c2a13f 100644 --- a/lib/rack/tracker/facebook/facebook.rb +++ b/lib/rack/tracker/facebook/facebook.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::Facebook < Rack::Tracker::Handler class Event < OpenStruct def write diff --git a/lib/rack/tracker/facebook_pixel/facebook_pixel.rb b/lib/rack/tracker/facebook_pixel/facebook_pixel.rb index f6015dd..1d12c36 100644 --- a/lib/rack/tracker/facebook_pixel/facebook_pixel.rb +++ b/lib/rack/tracker/facebook_pixel/facebook_pixel.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::FacebookPixel < Rack::Tracker::Handler self.position = :body self.allowed_tracker_options = [:id] diff --git a/lib/rack/tracker/go_squared/go_squared.rb b/lib/rack/tracker/go_squared/go_squared.rb index 7885d0a..d2adf88 100644 --- a/lib/rack/tracker/go_squared/go_squared.rb +++ b/lib/rack/tracker/go_squared/go_squared.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::GoSquared < Rack::Tracker::Handler class VisitorName < OpenStruct def write diff --git a/lib/rack/tracker/google_adwords_conversion/google_adwords_conversion.rb b/lib/rack/tracker/google_adwords_conversion/google_adwords_conversion.rb index ecdf652..90a1b10 100644 --- a/lib/rack/tracker/google_adwords_conversion/google_adwords_conversion.rb +++ b/lib/rack/tracker/google_adwords_conversion/google_adwords_conversion.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::GoogleAdwordsConversion < Rack::Tracker::Handler class Conversion < OpenStruct end diff --git a/lib/rack/tracker/google_analytics/google_analytics.rb b/lib/rack/tracker/google_analytics/google_analytics.rb index f33663b..a16b5df 100644 --- a/lib/rack/tracker/google_analytics/google_analytics.rb +++ b/lib/rack/tracker/google_analytics/google_analytics.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::GoogleAnalytics < Rack::Tracker::Handler self.allowed_tracker_options = [:cookie_domain, :user_id] diff --git a/lib/rack/tracker/google_global/google_global.rb b/lib/rack/tracker/google_global/google_global.rb index 5ccb817..f1c8ee0 100644 --- a/lib/rack/tracker/google_global/google_global.rb +++ b/lib/rack/tracker/google_global/google_global.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::GoogleGlobal < Rack::Tracker::Handler self.allowed_tracker_options = [:cookie_domain, :user_id, :link_attribution, :allow_display_features, :anonymize_ip, diff --git a/lib/rack/tracker/google_tag_manager/google_tag_manager.rb b/lib/rack/tracker/google_tag_manager/google_tag_manager.rb index 1a05489..9367a32 100644 --- a/lib/rack/tracker/google_tag_manager/google_tag_manager.rb +++ b/lib/rack/tracker/google_tag_manager/google_tag_manager.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::GoogleTagManager < Rack::Tracker::Handler class Push < OpenStruct diff --git a/lib/rack/tracker/handler.rb b/lib/rack/tracker/handler.rb index 2e31195..50451ed 100644 --- a/lib/rack/tracker/handler.rb +++ b/lib/rack/tracker/handler.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::Handler class << self def process_track(env, method_name, *args, &block) diff --git a/lib/rack/tracker/handler_delegator.rb b/lib/rack/tracker/handler_delegator.rb index f968fa9..96cc6e4 100644 --- a/lib/rack/tracker/handler_delegator.rb +++ b/lib/rack/tracker/handler_delegator.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::HandlerDelegator class << self def handler(method_name) diff --git a/lib/rack/tracker/heap/heap.rb b/lib/rack/tracker/heap/heap.rb index dac9efb..927eb48 100644 --- a/lib/rack/tracker/heap/heap.rb +++ b/lib/rack/tracker/heap/heap.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true class Rack::Tracker::Heap < Rack::Tracker::Handler end diff --git a/lib/rack/tracker/hotjar/hotjar.rb b/lib/rack/tracker/hotjar/hotjar.rb index 482e5d3..598bc72 100644 --- a/lib/rack/tracker/hotjar/hotjar.rb +++ b/lib/rack/tracker/hotjar/hotjar.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true class Rack::Tracker::Hotjar < Rack::Tracker::Handler end diff --git a/lib/rack/tracker/hubspot/hubspot.rb b/lib/rack/tracker/hubspot/hubspot.rb index 162b07c..d29a696 100644 --- a/lib/rack/tracker/hubspot/hubspot.rb +++ b/lib/rack/tracker/hubspot/hubspot.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true class Rack::Tracker::Hubspot < Rack::Tracker::Handler end diff --git a/lib/rack/tracker/javascript_helper.rb b/lib/rack/tracker/javascript_helper.rb index 02ccdfb..b1c28ad 100644 --- a/lib/rack/tracker/javascript_helper.rb +++ b/lib/rack/tracker/javascript_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This module is extracted from Rails to provide reliable javascript escaping. # # @see https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/javascript_helper.rb @@ -13,8 +14,8 @@ module Rack::Tracker::JavaScriptHelper "'" => "\\'" } - JS_ESCAPE_MAP["\342\200\250".force_encoding(Encoding::UTF_8).encode!] = '
' - JS_ESCAPE_MAP["\342\200\251".force_encoding(Encoding::UTF_8).encode!] = '
' + JS_ESCAPE_MAP[(+"\342\200\250").force_encoding(Encoding::UTF_8).encode!] = '
' + JS_ESCAPE_MAP[(+"\342\200\251").force_encoding(Encoding::UTF_8).encode!] = '
' # Escapes carriage returns and single and double quotes for JavaScript segments. # diff --git a/lib/rack/tracker/railtie.rb b/lib/rack/tracker/railtie.rb index 965cb73..5ddf90a 100644 --- a/lib/rack/tracker/railtie.rb +++ b/lib/rack/tracker/railtie.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Rack class Tracker class Railtie < ::Rails::Railtie diff --git a/lib/rack/tracker/version.rb b/lib/rack/tracker/version.rb index 3cf2d99..7f8da3c 100644 --- a/lib/rack/tracker/version.rb +++ b/lib/rack/tracker/version.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Rack class Tracker VERSION = '1.13.0' diff --git a/lib/rack/tracker/vwo/vwo.rb b/lib/rack/tracker/vwo/vwo.rb index c7fdfa3..304371f 100644 --- a/lib/rack/tracker/vwo/vwo.rb +++ b/lib/rack/tracker/vwo/vwo.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true class Rack::Tracker::Vwo < Rack::Tracker::Handler end diff --git a/lib/rack/tracker/zanox/zanox.rb b/lib/rack/tracker/zanox/zanox.rb index a674b6f..03d2391 100644 --- a/lib/rack/tracker/zanox/zanox.rb +++ b/lib/rack/tracker/zanox/zanox.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Rack::Tracker::Zanox < Rack::Tracker::Handler # name of the handler diff --git a/rack-tracker.gemspec b/rack-tracker.gemspec index d5fa3d2..bdaacb0 100644 --- a/rack-tracker.gemspec +++ b/rack-tracker.gemspec @@ -1,4 +1,5 @@ # coding: utf-8 +# frozen_string_literal: true lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'rack/tracker/version' diff --git a/spec/benchmark/tracker_injection_benchmark.rb b/spec/benchmark/tracker_injection_benchmark.rb index 2874eb1..15a64e1 100644 --- a/spec/benchmark/tracker_injection_benchmark.rb +++ b/spec/benchmark/tracker_injection_benchmark.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' require 'benchmark' diff --git a/spec/handler/bing_spec.rb b/spec/handler/bing_spec.rb index 843752a..3c4d89f 100644 --- a/spec/handler/bing_spec.rb +++ b/spec/handler/bing_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::Bing do it 'will be placed in the body' do diff --git a/spec/handler/criteo_spec.rb b/spec/handler/criteo_spec.rb index 8feded3..d06d8c2 100644 --- a/spec/handler/criteo_spec.rb +++ b/spec/handler/criteo_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::Criteo do describe Rack::Tracker::Criteo::Event do diff --git a/spec/handler/drift_spec.rb b/spec/handler/drift_spec.rb index 5f96374..5945671 100644 --- a/spec/handler/drift_spec.rb +++ b/spec/handler/drift_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::Drift do def env { foo: 'bar' } diff --git a/spec/handler/facebook_pixel_spec.rb b/spec/handler/facebook_pixel_spec.rb index 9716529..1688703 100644 --- a/spec/handler/facebook_pixel_spec.rb +++ b/spec/handler/facebook_pixel_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::FacebookPixel do def env { 'PIXEL_ID' => 'DYNAMIC_PIXEL_ID' } diff --git a/spec/handler/facebook_spec.rb b/spec/handler/facebook_spec.rb index 6a24738..aee1876 100644 --- a/spec/handler/facebook_spec.rb +++ b/spec/handler/facebook_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::Facebook do describe Rack::Tracker::Facebook::Event do diff --git a/spec/handler/go_squared_spec.rb b/spec/handler/go_squared_spec.rb index 4d15bab..f2a3f3c 100644 --- a/spec/handler/go_squared_spec.rb +++ b/spec/handler/go_squared_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::GoSquared do def env diff --git a/spec/handler/google_adwords_conversion_spec.rb b/spec/handler/google_adwords_conversion_spec.rb index 52536cf..0d2d97b 100644 --- a/spec/handler/google_adwords_conversion_spec.rb +++ b/spec/handler/google_adwords_conversion_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::GoogleAdwordsConversion do def env diff --git a/spec/handler/google_analytics_spec.rb b/spec/handler/google_analytics_spec.rb index 6951a02..37f6ff7 100644 --- a/spec/handler/google_analytics_spec.rb +++ b/spec/handler/google_analytics_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::GoogleAnalytics do def env { diff --git a/spec/handler/google_global_spec.rb b/spec/handler/google_global_spec.rb index 0858020..2092d2f 100644 --- a/spec/handler/google_global_spec.rb +++ b/spec/handler/google_global_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::GoogleGlobal do def env { diff --git a/spec/handler/google_tag_manager_spec.rb b/spec/handler/google_tag_manager_spec.rb index d86568e..622585c 100644 --- a/spec/handler/google_tag_manager_spec.rb +++ b/spec/handler/google_tag_manager_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::GoogleTagManager do def env @@ -42,7 +43,7 @@ def env end context 'with one line html response' do - let(:example_response) { "" } + let(:example_response) { +"" } it 'will have render_head content in head tag' do expect(subject).to match(%r{.*.*}) diff --git a/spec/handler/handler_spec.rb b/spec/handler/handler_spec.rb index 2fabeff..b3a7e41 100644 --- a/spec/handler/handler_spec.rb +++ b/spec/handler/handler_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::Handler do def env { misc: 'foobar' } diff --git a/spec/handler/heap_spec.rb b/spec/handler/heap_spec.rb index 7e48df4..4a49849 100644 --- a/spec/handler/heap_spec.rb +++ b/spec/handler/heap_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::Heap do def env { foo: 'bar' } diff --git a/spec/handler/hotjar_spec.rb b/spec/handler/hotjar_spec.rb index c4a5855..892bc2d 100644 --- a/spec/handler/hotjar_spec.rb +++ b/spec/handler/hotjar_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::Hotjar do def env { foo: 'bar' } diff --git a/spec/handler/hubspot_spec.rb b/spec/handler/hubspot_spec.rb index ea36178..1bdcd7c 100644 --- a/spec/handler/hubspot_spec.rb +++ b/spec/handler/hubspot_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::Hubspot do def env diff --git a/spec/handler/vwo_spec.rb b/spec/handler/vwo_spec.rb index 5b4fab6..dcb2784 100644 --- a/spec/handler/vwo_spec.rb +++ b/spec/handler/vwo_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::Vwo do def env diff --git a/spec/handler/zanox_spec.rb b/spec/handler/zanox_spec.rb index dbf374d..b68791f 100644 --- a/spec/handler/zanox_spec.rb +++ b/spec/handler/zanox_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker::Zanox do describe Rack::Tracker::Zanox::Sale do diff --git a/spec/integration/bing_integration_spec.rb b/spec/integration/bing_integration_spec.rb index e68b8fd..3b8f823 100644 --- a/spec/integration/bing_integration_spec.rb +++ b/spec/integration/bing_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Bing Integration" do diff --git a/spec/integration/criteo_integration_spec.rb b/spec/integration/criteo_integration_spec.rb index aa3df67..1f42bcc 100644 --- a/spec/integration/criteo_integration_spec.rb +++ b/spec/integration/criteo_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Criteo Integration" do diff --git a/spec/integration/drift_integration_spec.rb b/spec/integration/drift_integration_spec.rb index 498538f..d216046 100644 --- a/spec/integration/drift_integration_spec.rb +++ b/spec/integration/drift_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe 'Drift Integration' do diff --git a/spec/integration/facebook_integration_spec.rb b/spec/integration/facebook_integration_spec.rb index 456359a..4eac5a1 100644 --- a/spec/integration/facebook_integration_spec.rb +++ b/spec/integration/facebook_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Facebook Integration" do diff --git a/spec/integration/facebook_pixel_integration_spec.rb b/spec/integration/facebook_pixel_integration_spec.rb index 07af9f0..d132880 100644 --- a/spec/integration/facebook_pixel_integration_spec.rb +++ b/spec/integration/facebook_pixel_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Facebook Pixel Integration" do diff --git a/spec/integration/go_squared_integration_spec.rb b/spec/integration/go_squared_integration_spec.rb index d530c6d..9e0c71a 100644 --- a/spec/integration/go_squared_integration_spec.rb +++ b/spec/integration/go_squared_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "GoSquared Integration" do diff --git a/spec/integration/google_adwords_conversion_integration_spec.rb b/spec/integration/google_adwords_conversion_integration_spec.rb index 2e64ce9..6f3c5c8 100644 --- a/spec/integration/google_adwords_conversion_integration_spec.rb +++ b/spec/integration/google_adwords_conversion_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Google Adwords Conversion Integration" do diff --git a/spec/integration/google_analytics_integration_spec.rb b/spec/integration/google_analytics_integration_spec.rb index ba59ea2..2add5fc 100644 --- a/spec/integration/google_analytics_integration_spec.rb +++ b/spec/integration/google_analytics_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Google Analytics Integration" do diff --git a/spec/integration/google_global_integration_spec.rb b/spec/integration/google_global_integration_spec.rb index 14df465..675ecc2 100644 --- a/spec/integration/google_global_integration_spec.rb +++ b/spec/integration/google_global_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Google Global Integration Integration" do diff --git a/spec/integration/google_tag_manager_integration_spec.rb b/spec/integration/google_tag_manager_integration_spec.rb index 9d2b5aa..6dad717 100644 --- a/spec/integration/google_tag_manager_integration_spec.rb +++ b/spec/integration/google_tag_manager_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Google Tag Manager Integration" do diff --git a/spec/integration/heap_integration_spec.rb b/spec/integration/heap_integration_spec.rb index ff866a1..3d39427 100644 --- a/spec/integration/heap_integration_spec.rb +++ b/spec/integration/heap_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Heap Integration" do diff --git a/spec/integration/hotjar_integration_spec.rb b/spec/integration/hotjar_integration_spec.rb index 301a801..b29fb2d 100644 --- a/spec/integration/hotjar_integration_spec.rb +++ b/spec/integration/hotjar_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Hotjar Integration" do diff --git a/spec/integration/hubspot_integration_spec.rb b/spec/integration/hubspot_integration_spec.rb index 4414aa4..1543b85 100644 --- a/spec/integration/hubspot_integration_spec.rb +++ b/spec/integration/hubspot_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Hubspot Integration" do diff --git a/spec/integration/rails_integration_spec.rb b/spec/integration/rails_integration_spec.rb index ec932f0..71e3ef7 100644 --- a/spec/integration/rails_integration_spec.rb +++ b/spec/integration/rails_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Rails Integration" do diff --git a/spec/integration/vwo_integration_spec.rb b/spec/integration/vwo_integration_spec.rb index 80807ce..06401a3 100644 --- a/spec/integration/vwo_integration_spec.rb +++ b/spec/integration/vwo_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "VWO Integration" do diff --git a/spec/integration/zanox_integration_spec.rb b/spec/integration/zanox_integration_spec.rb index b1f5f4b..8928364 100644 --- a/spec/integration/zanox_integration_spec.rb +++ b/spec/integration/zanox_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/capybara_app_helper' RSpec.describe "Zanox Integration" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 39b3f24..acb8106 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) diff --git a/spec/support/capybara_app_helper.rb b/spec/support/capybara_app_helper.rb index 3125e9c..2875fdb 100644 --- a/spec/support/capybara_app_helper.rb +++ b/spec/support/capybara_app_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'support/metal_controller' # helper to configure the middleware stack with custom handlers diff --git a/spec/support/fake_handler.rb b/spec/support/fake_handler.rb index c40c1e5..a29f407 100644 --- a/spec/support/fake_handler.rb +++ b/spec/support/fake_handler.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class TrackAllTheThings < Rack::Tracker::Handler def render Tilt.new( File.join( File.dirname(__FILE__), '../fixtures/track_all_the_things.erb') ).render(self) diff --git a/spec/support/metal_controller.rb b/spec/support/metal_controller.rb index f22447e..e8f0345 100644 --- a/spec/support/metal_controller.rb +++ b/spec/support/metal_controller.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'action_controller' class MetalController < ActionController::Metal diff --git a/spec/tracker/controller_spec.rb b/spec/tracker/controller_spec.rb index 52d30b2..b9a3edc 100644 --- a/spec/tracker/controller_spec.rb +++ b/spec/tracker/controller_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true TestController = Struct.new(:env) do include Rack::Tracker::Controller diff --git a/spec/tracker/handler_delegator_spec.rb b/spec/tracker/handler_delegator_spec.rb index 2fa2bb8..cb4292b 100644 --- a/spec/tracker/handler_delegator_spec.rb +++ b/spec/tracker/handler_delegator_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true Foo = Class.new Bar = Class.new diff --git a/spec/tracker/handler_set_spec.rb b/spec/tracker/handler_set_spec.rb index e3f411c..568921c 100644 --- a/spec/tracker/handler_set_spec.rb +++ b/spec/tracker/handler_set_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Dummy < Rack::Tracker::Handler end diff --git a/spec/tracker/javascript_helper_spec.rb b/spec/tracker/javascript_helper_spec.rb index fc36815..e1afceb 100644 --- a/spec/tracker/javascript_helper_spec.rb +++ b/spec/tracker/javascript_helper_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true RSpec.describe Rack::Tracker do let(:escaper) do @@ -39,8 +40,8 @@ it { should escape(%(This "thing" is really\n netos')).to %(This \\"thing\\" is really\\n netos\\') } it { should escape(%(backslash\\test)).to %(backslash\\\\test) } it { should escape(%(dont tags)).to %(dont <\\/close> tags) } - it { should escape(%(unicode \342\200\250 newline).force_encoding(Encoding::UTF_8).encode!).to %(unicode 
 newline) } - it { should escape(%(unicode \342\200\251 newline).force_encoding(Encoding::UTF_8).encode!).to %(unicode 
 newline) } + it { should escape((+%(unicode \342\200\250 newline)).force_encoding(Encoding::UTF_8).encode!).to %(unicode 
 newline) } + it { should escape((+%(unicode \342\200\251 newline)).force_encoding(Encoding::UTF_8).encode!).to %(unicode 
 newline) } it 'works with symbols' do expect(subject).to escape(:dimension1).to 'dimension1'