Sha256: ca2b0156f1b4705a2a3c419ae2271ac42ca1878542ed7d6bff10054edf41d93a

Contents?: true

Size: 661 Bytes

Versions: 33

Compression:

Stored size: 661 Bytes

Contents

# frozen_string_literal: true

require 'active_support'
require 'lhc/version'

module LHC
  class Request
    module UserAgentConcern
      extend ActiveSupport::Concern

      included do
        Typhoeus::Config.user_agent = begin
          version = LHC::VERSION
          application = nil
          if defined?(Rails)
            app_class = Rails.application.class
            application = (ActiveSupport.gem_version >= Gem::Version.new('6.0.0')) ? app_class.module_parent_name : app_class.parent_name
          end

          "LHC (#{[version, application].compact.join('; ')}) [https://github.com/local-ch/lhc]"
        end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
lhc-15.2.1 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-15.2.0 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-15.1.3 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-15.1.2 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-15.1.1 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-15.1.0 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-16.0.0.pre.pro2162.2 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-16.0.0.pre.pro2162 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-15.0.1 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-15.0.0 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-14.0.0 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-13.4.0.pre.pro1766.1 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-13.2.0 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-13.1.0 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-13.0.0 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-12.3.0 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-12.2.1 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-12.2.0 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-12.1.3 lib/lhc/concerns/lhc/request/user_agent_concern.rb
lhc-12.1.2 lib/lhc/concerns/lhc/request/user_agent_concern.rb