vwo-sdk 1.24.0 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vwo/constants.rb +1 -1
- data/lib/vwo/enums.rb +0 -1
- data/lib/vwo.rb +8 -45
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 68dad84f9b03958ca980c9f9ef2dc91faabdf57bfc33a55baaf5316123eb010b
         | 
| 4 | 
            +
              data.tar.gz: de01033026fe5f493d7a6a1419c65a60f41a43ac85526a4f16f90448ff31a3bb
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 81bfc307f0aa0482c3426edd657ac960fde1d95843401e1f583dc96b6785ef3c6e59f10b1d577424da40d956cd792618275a4451c1f4dc4dff3458454d15f238
         | 
| 7 | 
            +
              data.tar.gz: 1f8dadef134e4064962bf606b43de36f9b4e4d4ed00c932948b56ab45960e430e42b20edb9e2eae65709091067dce162959165028698d0010ff767657887f1fd
         | 
    
        data/lib/vwo/constants.rb
    CHANGED
    
    | @@ -27,7 +27,7 @@ class VWO | |
| 27 27 | 
             
                HTTP_PROTOCOL = 'http://'
         | 
| 28 28 | 
             
                HTTPS_PROTOCOL = 'https://'
         | 
| 29 29 | 
             
                URL_NAMESPACE = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'
         | 
| 30 | 
            -
                SDK_VERSION = '1.24. | 
| 30 | 
            +
                SDK_VERSION = '1.24.1'
         | 
| 31 31 | 
             
                SDK_NAME = 'ruby'
         | 
| 32 32 | 
             
                VWO_DELIMITER = '_vwo_'
         | 
| 33 33 | 
             
                MAX_EVENTS_PER_REQUEST = 5000
         | 
    
        data/lib/vwo/enums.rb
    CHANGED
    
    | @@ -201,7 +201,6 @@ class VWO | |
| 201 201 | 
             
                    TAG_KEY_LENGTH_EXCEEDED = '(%<file>s): In API: %<api_name>s, the length of tag_key:%<tag_key>s and userID: %<user_id>s can not be greater than 255'
         | 
| 202 202 | 
             
                    TRACK_API_MISSING_PARAMS = '(%<file>s): "track" API got bad parameters. It expects campaignKey(null/String/array) as first, userId(String/Number) as second and goalIdentifier (string) as third argument. options is revenueValue(Float/Number/String) and is required for revenue goal only.'
         | 
| 203 203 | 
             
                    NO_CAMPAIGN_FOUND = '(%<file>s): No campaign found for goal_identifier:%<goal_identifier>s. Please verify from VWO app.'
         | 
| 204 | 
            -
                    INVALID_TRACK_RETURNING_USER_VALUE  = '(%<file>s): should_track_returning_user should be boolean'
         | 
| 205 204 | 
             
                    INVALID_GOAL_TYPE = '(%<file>s): goal_type_to_track should be certain strings'
         | 
| 206 205 | 
             
                    EVENT_BATCHING_NOT_OBJECT = '(%<file>s): Batch events settings are not of type object.'
         | 
| 207 206 | 
             
                    EVENTS_PER_REQUEST_INVALID = '(%<file>s): events_per_request should be an integer'
         | 
    
        data/lib/vwo.rb
    CHANGED
    
    | @@ -89,25 +89,6 @@ class VWO | |
| 89 89 | 
             
                  return
         | 
| 90 90 | 
             
                end
         | 
| 91 91 |  | 
| 92 | 
            -
                if options.key?(:should_track_returning_user)
         | 
| 93 | 
            -
                  if [true, false].include? options[:should_track_returning_user]
         | 
| 94 | 
            -
                    @should_track_returning_user = options[:should_track_returning_user]
         | 
| 95 | 
            -
                    usage_stats[:tr] = 1 if @should_track_returning_user
         | 
| 96 | 
            -
                  else
         | 
| 97 | 
            -
                    @logger.log(
         | 
| 98 | 
            -
                      LogLevelEnum::ERROR,
         | 
| 99 | 
            -
                      format(
         | 
| 100 | 
            -
                        LogMessageEnum::ErrorMessages::INVALID_TRACK_RETURNING_USER_VALUE,
         | 
| 101 | 
            -
                        file: FILE
         | 
| 102 | 
            -
                      )
         | 
| 103 | 
            -
                    )
         | 
| 104 | 
            -
                    @is_instance_valid = false
         | 
| 105 | 
            -
                    return
         | 
| 106 | 
            -
                  end
         | 
| 107 | 
            -
                else
         | 
| 108 | 
            -
                  @should_track_returning_user = false
         | 
| 109 | 
            -
                end
         | 
| 110 | 
            -
             | 
| 111 92 | 
             
                if options.key?(:goal_type_to_track)
         | 
| 112 93 | 
             
                  if GOAL_TYPES.key? options[:goal_type_to_track]
         | 
| 113 94 | 
             
                    @goal_type_to_track = options[:goal_type_to_track]
         | 
| @@ -303,10 +284,9 @@ class VWO | |
| 303 284 | 
             
                custom_variables = options[:custom_variables]
         | 
| 304 285 | 
             
                variation_targeting_variables = options[:variation_targeting_variables]
         | 
| 305 286 |  | 
| 306 | 
            -
                should_track_returning_user = get_should_track_returning_user(options)
         | 
| 307 287 | 
             
                # Validate input parameters
         | 
| 308 288 | 
             
                unless valid_string?(campaign_key) && valid_string?(user_id) && (custom_variables.nil? || valid_hash?(custom_variables)) &&
         | 
| 309 | 
            -
                  (variation_targeting_variables.nil? || valid_hash?(variation_targeting_variables)) | 
| 289 | 
            +
                  (variation_targeting_variables.nil? || valid_hash?(variation_targeting_variables))
         | 
| 310 290 | 
             
                  @logger.log(
         | 
| 311 291 | 
             
                    LogLevelEnum::ERROR,
         | 
| 312 292 | 
             
                    format(
         | 
| @@ -381,7 +361,7 @@ class VWO | |
| 381 361 | 
             
                  return
         | 
| 382 362 | 
             
                end
         | 
| 383 363 |  | 
| 384 | 
            -
                if is_eligible_to_send_impression( | 
| 364 | 
            +
                if is_eligible_to_send_impression()
         | 
| 385 365 | 
             
                  if defined?(@batch_events)
         | 
| 386 366 | 
             
                    impression = create_bulk_event_impression(
         | 
| 387 367 | 
             
                      @settings_file,
         | 
| @@ -587,12 +567,11 @@ class VWO | |
| 587 567 | 
             
                revenue_value = options[:revenue_value]
         | 
| 588 568 | 
             
                custom_variables = options[:custom_variables]
         | 
| 589 569 | 
             
                variation_targeting_variables = options[:variation_targeting_variables]
         | 
| 590 | 
            -
                should_track_returning_user = get_should_track_returning_user(options)
         | 
| 591 570 | 
             
                goal_type_to_track = get_goal_type_to_track(options)
         | 
| 592 571 |  | 
| 593 572 | 
             
                # Check for valid args
         | 
| 594 573 | 
             
                unless (valid_string?(campaign_key) || campaign_key.is_a?(Array) || campaign_key.nil?) && valid_string?(user_id) && valid_string?(goal_identifier) && (custom_variables.nil? || valid_hash?(custom_variables)) &&
         | 
| 595 | 
            -
                  (variation_targeting_variables.nil? || valid_hash?(variation_targeting_variables)) &&  | 
| 574 | 
            +
                  (variation_targeting_variables.nil? || valid_hash?(variation_targeting_variables)) && (GOAL_TYPES.key? (goal_type_to_track))
         | 
| 596 575 | 
             
                  # log invalid params
         | 
| 597 576 | 
             
                  @logger.log(
         | 
| 598 577 | 
             
                    LogLevelEnum::ERROR,
         | 
| @@ -682,7 +661,7 @@ class VWO | |
| 682 661 | 
             
                        updated_goal_identifier += VWO_DELIMITER + goal_identifier
         | 
| 683 662 | 
             
                        @variation_decider.save_user_storage(user_id, campaign['key'], campaign['name'], variation['name'], updated_goal_identifier) if variation['name']
         | 
| 684 663 | 
             
                        # set variation at user storage
         | 
| 685 | 
            -
                       | 
| 664 | 
            +
                      else
         | 
| 686 665 | 
             
                        @logger.log(
         | 
| 687 666 | 
             
                          LogLevelEnum::INFO,
         | 
| 688 667 | 
             
                          format(
         | 
| @@ -806,7 +785,6 @@ class VWO | |
| 806 785 | 
             
                # Retrieve custom variables
         | 
| 807 786 | 
             
                custom_variables = options[:custom_variables]
         | 
| 808 787 | 
             
                variation_targeting_variables = options[:variation_targeting_variables]
         | 
| 809 | 
            -
                should_track_returning_user = get_should_track_returning_user(options)
         | 
| 810 788 | 
             
                @logger.log(
         | 
| 811 789 | 
             
                  LogLevelEnum::INFO,
         | 
| 812 790 | 
             
                  format(
         | 
| @@ -818,7 +796,7 @@ class VWO | |
| 818 796 | 
             
                )
         | 
| 819 797 | 
             
                # Validate input parameters
         | 
| 820 798 | 
             
                unless valid_string?(campaign_key) && valid_string?(user_id) && (custom_variables.nil? || valid_hash?(custom_variables)) &&
         | 
| 821 | 
            -
                  (variation_targeting_variables.nil? || valid_hash?(variation_targeting_variables)) | 
| 799 | 
            +
                  (variation_targeting_variables.nil? || valid_hash?(variation_targeting_variables))
         | 
| 822 800 | 
             
                  @logger.log(
         | 
| 823 801 | 
             
                    LogLevelEnum::ERROR,
         | 
| 824 802 | 
             
                    format(
         | 
| @@ -874,7 +852,7 @@ class VWO | |
| 874 852 |  | 
| 875 853 | 
             
                # if campaign type is feature_test Send track call to server
         | 
| 876 854 |  | 
| 877 | 
            -
                if is_eligible_to_send_impression( | 
| 855 | 
            +
                if is_eligible_to_send_impression()
         | 
| 878 856 | 
             
                  if defined?(@batch_events)
         | 
| 879 857 | 
             
                    impression = create_bulk_event_impression(
         | 
| 880 858 | 
             
                      @settings_file,
         | 
| @@ -1222,23 +1200,8 @@ class VWO | |
| 1222 1200 | 
             
                false
         | 
| 1223 1201 | 
             
              end
         | 
| 1224 1202 |  | 
| 1225 | 
            -
              def  | 
| 1226 | 
            -
                 | 
| 1227 | 
            -
                  options[:should_track_returning_user] = @should_track_returning_user
         | 
| 1228 | 
            -
                elsif ![true, false].include?(options[:should_track_returning_user])
         | 
| 1229 | 
            -
                  @logger.log(
         | 
| 1230 | 
            -
                    LogLevelEnum::ERROR,
         | 
| 1231 | 
            -
                    format(
         | 
| 1232 | 
            -
                      LogMessageEnum::ErrorMessages::INVALID_TRACK_RETURNING_USER_VALUE,
         | 
| 1233 | 
            -
                      file: FILE
         | 
| 1234 | 
            -
                    )
         | 
| 1235 | 
            -
                  )
         | 
| 1236 | 
            -
                end
         | 
| 1237 | 
            -
                options[:should_track_returning_user]
         | 
| 1238 | 
            -
              end
         | 
| 1239 | 
            -
             | 
| 1240 | 
            -
              def is_eligible_to_send_impression(should_track_returning_user = false)
         | 
| 1241 | 
            -
                !@user_storage || !@variation_decider.has_stored_variation || should_track_returning_user
         | 
| 1203 | 
            +
              def is_eligible_to_send_impression()
         | 
| 1204 | 
            +
                !@user_storage || !@variation_decider.has_stored_variation
         | 
| 1242 1205 | 
             
              end
         | 
| 1243 1206 |  | 
| 1244 1207 | 
             
              def flush_events
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: vwo-sdk
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.24. | 
| 4 | 
            +
              version: 1.24.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - VWO
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2021-12- | 
| 11 | 
            +
            date: 2021-12-08 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: codecov
         |