eyes_core 3.18.0 → 3.18.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4e0ec0973b0034ffd84d419082109ac49996a2b
4
- data.tar.gz: fcb10c51848d2ea6e6e8f0f889a9ab233b2e09e4
3
+ metadata.gz: 61b34e0cc3a83b84a7a4a2c9548eb55ad10c8b4a
4
+ data.tar.gz: f017a2093422378561cd8d3236fe696816129a80
5
5
  SHA512:
6
- metadata.gz: 736987f699a9d9a7a5be115d685b87fa6f7f83db5c4194f90dec0d47e4ff4a5cb77d6e627e94bc4cf2819c54867f3239b93230ef8bca14cf643aafea0680b800
7
- data.tar.gz: fb3f0e8edbc0c258e2e6db77c996d0a22b58fc357f4a25d2f3f07bdd5ce3c324860596a75fb280501c16bd954307b977400fa832395ed38f966f5d0478a1601c
6
+ metadata.gz: bd0fced9b70f0a10375e81dbbde7ae75cd8f0ee8f7969a176f0156a9c5323e21bb337a0d2a0eb43bd607c4af82a15ee12d8dd79e70d8965099a821fdb69ac980
7
+ data.tar.gz: 6a6fef3ccba6a3df74c7a0cd35886036442df8a4b1d365c13cb1a9d05eccd1efc3497653e18fdd3e49d54735472bc9e26a3718757c1ab8677fa61f3628c45ad0
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'securerandom'
4
+ require 'applitools/utils/utils'
4
5
  require_relative 'helpers'
5
6
 
6
7
  module Applitools
7
8
  class BatchInfo
8
9
  extend Helpers
9
- attr_accessor :started_at, :id, :notify_on_completion
10
+ attr_accessor :started_at, :id, :notify_on_completion, :properties
10
11
 
11
12
  environment_attribute :name, 'APPLITOOLS_BATCH_NAME'
12
13
  environment_attribute :id, 'APPLITOOLS_BATCH_ID'
@@ -14,10 +15,24 @@ module Applitools
14
15
  environment_attribute :env_notify_on_completion, 'APPLITOOLS_BATCH_NOTIFY'
15
16
 
16
17
 
17
- def initialize(name = nil, started_at = Time.now)
18
+ def initialize(args = nil, started_at = Time.now)
19
+ case args
20
+ when String
21
+ name = args
22
+ when Hash
23
+ sym_args = Applitools::Utils.symbolize_keys args
24
+ id ||= sym_args[:id]
25
+ name ||= sym_args[:name]
26
+ properties ||= sym_args[:properties]
27
+ end
18
28
  self.name = name if name
19
29
  @started_at = started_at
20
- self.id = SecureRandom.uuid unless id
30
+ if id
31
+ self.id = id
32
+ elsif self.id.nil? || self.id.empty?
33
+ self.id = SecureRandom.uuid
34
+ end
35
+ self.properties = properties if properties
21
36
  self.notify_on_completion = 'true'.casecmp(env_notify_on_completion || '') == 0 ? true : false
22
37
  end
23
38
 
@@ -27,7 +42,8 @@ module Applitools
27
42
  'name' => name,
28
43
  'startedAt' => @started_at.iso8601,
29
44
  'batchSequenceName' => sequence_name,
30
- 'notifyOnCompletion' => notify_on_completion
45
+ 'notifyOnCompletion' => notify_on_completion,
46
+ 'properties' => properties
31
47
  }
32
48
  end
33
49
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Applitools
4
- VERSION = '3.18.0'.freeze
4
+ VERSION = '3.18.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eyes_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.18.0
4
+ version: 3.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Applitools Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-20 00:00:00.000000000 Z
11
+ date: 2021-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oily_png