lib/unleash/configuration.rb in unleash-5.0.2 vs lib/unleash/configuration.rb in unleash-5.0.3

- old
+ new

@@ -1,19 +1,15 @@ require 'securerandom' require 'tmpdir' require 'unleash/bootstrap/configuration' module Unleash - gemspec = Gem::Specification.load('unleash-client.gemspec') - CLIENT_SPECIFICATION_VERSION = gemspec.metadata['client-specification-version'].freeze - class Configuration attr_accessor \ :url, :app_name, :environment, - :instance_id, :project_name, :custom_http_headers, :disable_client, :disable_metrics, :timeout, @@ -24,14 +20,19 @@ :logger, :log_level, :bootstrap_config, :strategies + attr_reader \ + :instance_id + def initialize(opts = {}) validate_custom_http_headers!(opts[:custom_http_headers]) if opts.has_key?(:custom_http_headers) set_defaults + @instance_id = SecureRandom.uuid + initialize_default_logger if opts[:logger].nil? merge(opts) refresh_backup_file! end @@ -87,10 +88,9 @@ def set_defaults self.app_name = nil self.environment = 'default' self.url = nil - self.instance_id = SecureRandom.uuid self.project_name = nil self.disable_client = false self.disable_metrics = false self.refresh_interval = 10 self.metrics_interval = 60