amplitude-experiment 1.2.3 → 1.2.5
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/experiment/local/client.rb +7 -3
- data/lib/experiment/user.rb +8 -1
- data/lib/experiment/version.rb +1 -1
- 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: 39fff5d1285490313a587d9df46b1cf68bb84c5672d9927871ba83b195bbf613
         | 
| 4 | 
            +
              data.tar.gz: 8f26de2e9de3585d5696646cd384841a732e9c0944520b479dc42ab423f5f168
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 96bb141478ceb429381894466cd63fd937ddd8e27d4d5ac4ee4b02ed6bacfef34750f151fbfffbc088fb5562e3ee2aef23e4da9ed8907f591a37a9195fc5e8b9
         | 
| 7 | 
            +
              data.tar.gz: 631d94a409a81132540504f135b56b2b6ccdfb407e9e11f250486ee9cf6d74e481e5a2dc3e23e652ed07b42abde9ffb9d2cbd9f17e1128c4248b1e55e53e2d61
         | 
| @@ -88,9 +88,13 @@ module AmplitudeExperiment | |
| 88 88 |  | 
| 89 89 | 
             
                def run
         | 
| 90 90 | 
             
                  @is_running = true
         | 
| 91 | 
            -
                   | 
| 92 | 
            -
             | 
| 93 | 
            -
                    @ | 
| 91 | 
            +
                  begin
         | 
| 92 | 
            +
                    flags = @fetcher.fetch_v1
         | 
| 93 | 
            +
                    @flags_mutex.synchronize do
         | 
| 94 | 
            +
                      @flags = flags
         | 
| 95 | 
            +
                    end
         | 
| 96 | 
            +
                  rescue StandardError => e
         | 
| 97 | 
            +
                    @logger.error("[Experiment] Flag poller - error: #{e.message}")
         | 
| 94 98 | 
             
                  end
         | 
| 95 99 | 
             
                  @poller_thread = Thread.new do
         | 
| 96 100 | 
             
                    sleep(@config.flag_config_polling_interval_millis / 1000.to_f)
         | 
    
        data/lib/experiment/user.rb
    CHANGED
    
    | @@ -28,6 +28,10 @@ module AmplitudeExperiment | |
| 28 28 | 
             
                # @return [String, nil] the value of dma
         | 
| 29 29 | 
             
                attr_accessor :dma
         | 
| 30 30 |  | 
| 31 | 
            +
                # Predefined field, must be manually provided
         | 
| 32 | 
            +
                # @return [String, nil] the value of ip address
         | 
| 33 | 
            +
                attr_accessor :ip_address
         | 
| 34 | 
            +
             | 
| 31 35 | 
             
                # Predefined field, must be manually provided
         | 
| 32 36 | 
             
                # @return [String, nil] the value of language
         | 
| 33 37 | 
             
                attr_accessor :language
         | 
| @@ -74,6 +78,7 @@ module AmplitudeExperiment | |
| 74 78 | 
             
                # @param [String, nil] city Predefined field, must be manually provided
         | 
| 75 79 | 
             
                # @param [String, nil] region Predefined field, must be manually provided
         | 
| 76 80 | 
             
                # @param [String, nil] dma Predefined field, must be manually provided
         | 
| 81 | 
            +
                # @param [String, nil] ip_address Predefined field, must be manually provided
         | 
| 77 82 | 
             
                # @param [String, nil] language Predefined field, must be manually provided
         | 
| 78 83 | 
             
                # @param [String, nil] platform Predefined field, must be manually provided
         | 
| 79 84 | 
             
                # @param [String, nil] version Predefined field, must be manually provided
         | 
| @@ -84,7 +89,7 @@ module AmplitudeExperiment | |
| 84 89 | 
             
                # @param [String, nil] carrier Predefined field, must be manually provided
         | 
| 85 90 | 
             
                # @param [String, nil] library Predefined field, auto populated, can be manually overridden
         | 
| 86 91 | 
             
                # @param [Hash, nil] user_properties Custom user properties
         | 
| 87 | 
            -
                def initialize(device_id: nil, user_id: nil, country: nil, city: nil, region: nil, dma: nil, language: nil,
         | 
| 92 | 
            +
                def initialize(device_id: nil, user_id: nil, country: nil, city: nil, region: nil, dma: nil, ip_address: nil, language: nil,
         | 
| 88 93 | 
             
                               platform: nil, version: nil, os: nil, device_manufacturer: nil, device_brand: nil,
         | 
| 89 94 | 
             
                               device_model: nil, carrier: nil, library: nil, user_properties: nil)
         | 
| 90 95 | 
             
                  @device_id = device_id
         | 
| @@ -93,6 +98,7 @@ module AmplitudeExperiment | |
| 93 98 | 
             
                  @city = city
         | 
| 94 99 | 
             
                  @region = region
         | 
| 95 100 | 
             
                  @dma = dma
         | 
| 101 | 
            +
                  @ip_address = ip_address
         | 
| 96 102 | 
             
                  @language = language
         | 
| 97 103 | 
             
                  @platform = platform
         | 
| 98 104 | 
             
                  @version = version
         | 
| @@ -115,6 +121,7 @@ module AmplitudeExperiment | |
| 115 121 | 
             
                    city: @city,
         | 
| 116 122 | 
             
                    region: @region,
         | 
| 117 123 | 
             
                    dma: @dma,
         | 
| 124 | 
            +
                    ip_address: @ip_address,
         | 
| 118 125 | 
             
                    language: @language,
         | 
| 119 126 | 
             
                    platform: @platform,
         | 
| 120 127 | 
             
                    version: @version,
         | 
    
        data/lib/experiment/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: amplitude-experiment
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.2. | 
| 4 | 
            +
              version: 1.2.5
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Amplitude
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2023- | 
| 11 | 
            +
            date: 2023-11-30 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: concurrent-ruby
         |