Class: RunLoop::Environment
- Inherits:
-
Object
- Object
- RunLoop::Environment
- Defined in:
- lib/run_loop/environment.rb
Class Method Summary collapse
-
.bundle_id ⇒ Object
Returns the value of BUNDLE_ID.
-
.debug? ⇒ Boolean
Returns true if debugging is enabled.
-
.debug_read? ⇒ Boolean
Returns true if read debugging is enabled.
-
.developer_dir ⇒ Object
Returns the value of DEVELOPER_DIR.
-
.path_to_app_bundle ⇒ Object
Returns to the path to the app bundle (simulator builds).
-
.trace_template ⇒ Object
Returns the value of TRACE_TEMPLATE; the Instruments template to use during testing.
-
.uia_timeout ⇒ Object
Returns the value of UIA_TIMEOUT.
-
.uid ⇒ Integer
Returns the user’s Unix uid.
-
.xtc? ⇒ Boolean
Returns true if we are running on the XTC.
Class Method Details
.bundle_id ⇒ Object
Returns the value of BUNDLE_ID
41 42 43 44 45 46 47 48 |
# File 'lib/run_loop/environment.rb', line 41 def self.bundle_id value = ENV['BUNDLE_ID'] if !value || value == '' nil else value end end |
.debug? ⇒ Boolean
Returns true if debugging is enabled.
11 12 13 |
# File 'lib/run_loop/environment.rb', line 11 def self.debug? ENV['DEBUG'] == '1' end |
.debug_read? ⇒ Boolean
Returns true if read debugging is enabled.
16 17 18 |
# File 'lib/run_loop/environment.rb', line 16 def self.debug_read? ENV['DEBUG_READ'] == '1' end |
.developer_dir ⇒ Object
Never call this directly. Always create an XCTool instance and allow it to derive the path to the Xcode toolchain.
Returns the value of DEVELOPER_DIR
68 69 70 71 72 73 74 75 |
# File 'lib/run_loop/environment.rb', line 68 def self.developer_dir value = ENV['DEVELOPER_DIR'] if !value || value == '' nil else value end end |
.path_to_app_bundle ⇒ Object
Returns to the path to the app bundle (simulator builds).
Both APP_BUNDLE_PATH and APP are checked and in that order.
Use of APP_BUNDLE_PATH is deprecated and will be removed.
55 56 57 58 59 60 61 62 |
# File 'lib/run_loop/environment.rb', line 55 def self.path_to_app_bundle value = ENV['APP_BUNDLE_PATH'] || ENV['APP'] if !value || value == '' nil else value end end |
.trace_template ⇒ Object
Returns the value of TRACE_TEMPLATE; the Instruments template to use during testing.
27 28 29 |
# File 'lib/run_loop/environment.rb', line 27 def self.trace_template ENV['TRACE_TEMPLATE'] end |
.uia_timeout ⇒ Object
Returns the value of UIA_TIMEOUT. Use this control how long to wait for instruments to launch and attach to your application.
Non-empty values are converted to a float.
35 36 37 38 |
# File 'lib/run_loop/environment.rb', line 35 def self.uia_timeout timeout = ENV['UIA_TIMEOUT'] timeout ? timeout.to_f : nil end |
.uid ⇒ Integer
Returns the user’s Unix uid.
6 7 8 |
# File 'lib/run_loop/environment.rb', line 6 def self.uid `id -u`.strip.to_i end |
.xtc? ⇒ Boolean
Returns true if we are running on the XTC
21 22 23 |
# File 'lib/run_loop/environment.rb', line 21 def self.xtc? ENV['XAMARIN_TEST_CLOUD'] == '1' end |