Sha256: 503f9e7be4a5c761f20c7f629e4bd57cded16bf6b7205d098a950fe65788ef3f

Contents?: true

Size: 704 Bytes

Versions: 19

Compression:

Stored size: 704 Bytes

Contents

# frozen_string_literal: true

require 'uploadcare'

module Uploadcare
  module Param
    # This header is added to track libraries using Uploadcare API
    class UserAgent
      # Generate header from Gem's config
      #
      # @example Uploadcare::Param::UserAgent.call
      #   UploadcareRuby/3.0.0-dev/Pubkey_(Ruby/2.6.3;UploadcareRuby)
      def self.call
        framework_data = Uploadcare.config.framework_data || ''
        framework_data_string = "; #{Uploadcare.config.framework_data}" unless framework_data.empty?
        public_key = Uploadcare.config.public_key
        "UploadcareRuby/#{VERSION}/#{public_key} (Ruby/#{RUBY_VERSION}#{framework_data_string})"
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
uploadcare-ruby-4.4.3 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.4.2 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.4.1 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.4.0 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.3.6 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.3.5 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.3.4 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.3.3 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.3.2 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.3.1 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.3.0 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-4.2.0 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-3.3.2 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-3.3.1 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-3.3.0 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-3.2.0 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-3.1.1 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-3.1.0 lib/uploadcare/param/user_agent.rb
uploadcare-ruby-3.1.0.pre.rc1 lib/uploadcare/param/user_agent.rb