Module: BuildKit::Utilities::Assertions
- Defined in:
- lib/ios_build_kit/utils/assertions.rb
Class Method Summary collapse
- .assert_files_exist(files) ⇒ Object
- .assert_required_config(req_keys, runner) ⇒ Object
- .assert_symbol_hash_keys(hash) ⇒ Object
- .assert_tasks_completed(req_tasks, runner) ⇒ Object
Class Method Details
.assert_files_exist(files) ⇒ Object
7 8 9 10 11 |
# File 'lib/ios_build_kit/utils/assertions.rb', line 7 def self.assert_files_exist files files.each do |file| BuildKit::Utilities::Console.terminate_with_err "Missing File: #{file} does not exist" unless File.exists? file end end |
.assert_required_config(req_keys, runner) ⇒ Object
13 14 15 16 17 |
# File 'lib/ios_build_kit/utils/assertions.rb', line 13 def self.assert_required_config req_keys, runner req_keys.each do |k| BuildKit::Utilities::Console.terminate_with_err "Missing Configuration: #{k} is required to run #{runner.tasks[:running]}" if runner.config[k].nil? end end |
.assert_symbol_hash_keys(hash) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/ios_build_kit/utils/assertions.rb', line 25 def self.assert_symbol_hash_keys hash hash.each do |key, val| if val.is_a? Hash BuildKit::Utilities::Assertions.assert_symbol_hash_keys val else BuildKit::Utilities::Console.terminate_with_err "Invalid config file: config file keys should be in Symbol form (:key:). Failed on: #{key}." unless key.is_a? Symbol end end end |
.assert_tasks_completed(req_tasks, runner) ⇒ Object
19 20 21 22 23 |
# File 'lib/ios_build_kit/utils/assertions.rb', line 19 def self.assert_tasks_completed req_tasks, runner req_tasks.each do |t| BuildKit::Utilities::Console.terminate_with_err "Task Required: #{t.to_s} should be completed to run #{runner.tasks[:running]}" unless runner.has_completed_task? t end end |