Module: Testcloud
- Defined in:
- lib/testcloud/support.rb,
lib/testcloud/support/logger.rb,
lib/testcloud/support/version.rb,
lib/testcloud/support/gem_version.rb,
lib/testcloud/support/global_methods.rb,
lib/testcloud/support/logging/default_logger.rb
Defined Under Namespace
Modules: Support
Constant Summary collapse
- FALLBACK_ENV =
'development'.freeze
Class Method Summary collapse
- .env ⇒ Object
- .env=(environment) ⇒ Object
- .uuid ⇒ Object
-
.uuid=(uuid_value) ⇒ Object
We want to be able to uniquely identify separate threads but we should probably make this UUIDv5 for more assurance of uniqueness.
Class Method Details
.env ⇒ Object
16 17 18 19 20 21 |
# File 'lib/testcloud/support/global_methods.rb', line 16 def env @_env ||= begin default_env = ENV['TESTCLOUD_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || FALLBACK_ENV ActiveSupport::StringInquirer.new(default_env) end end |
.env=(environment) ⇒ Object
23 24 25 |
# File 'lib/testcloud/support/global_methods.rb', line 23 def env=(environment) @_env = ActiveSupport::StringInquirer.new(environment) end |
.uuid ⇒ Object
33 34 35 |
# File 'lib/testcloud/support/global_methods.rb', line 33 def uuid Thread.current[:uuid] ||= SecureRandom.uuid end |
.uuid=(uuid_value) ⇒ Object
We want to be able to uniquely identify separate threads but we should probably make this UUIDv5 for more assurance of uniqueness
29 30 31 |
# File 'lib/testcloud/support/global_methods.rb', line 29 def uuid=(uuid_value) Thread.current[:uuid] = uuid_value end |