Module: FailFast::CheckIsOnPath
- Defined in:
- lib/fail_fast/extensions/check_is_on_path.rb
Instance Method Summary collapse
-
#is_on_path(app, options = {}) ⇒ Object
Ensure the application is on the path.
-
#is_on_path_for(key, options = {}) ⇒ Object
Ensure the key value can be found on the path.
Instance Method Details
#is_on_path(app, options = {}) ⇒ Object
Ensure the application is on the path
Usage
is_on_path 'jruby'
is_on_path 'jruby', :message => 'custom message'
10 11 12 13 14 |
# File 'lib/fail_fast/extensions/check_is_on_path.rb', line 10 def is_on_path(app, = {}) unless found_on_the_path(app) add_error ErrorDetails.new(nil, :not_on_path, app, [:message]) end end |
#is_on_path_for(key, options = {}) ⇒ Object
Ensure the key value can be found on the path
Usage
is_on_path_for 'file_compressor'
is_on_path_for 'file_compressor', :message => 'custom message'
22 23 24 25 26 27 28 29 |
# File 'lib/fail_fast/extensions/check_is_on_path.rb', line 22 def is_on_path_for(key, = {}) return unless has_value_for key, :message => [:message] app = value_for_deep_key(key) unless found_on_the_path(app) add_error ErrorDetails.new(key, :not_on_path, app, [:message]) end end |