Class: BranchIOCLI::Configuration::ValidateConfiguration

Inherits:
Configuration
  • Object
show all
Defined in:
lib/branch_io_cli/configuration/validate_configuration.rb

Instance Attribute Summary

Attributes inherited from Configuration

#apps, #cartfile_path, #keys, #options, #pod_repo_update, #podfile, #podfile_path, #quiet, #sdk, #sdk_integration_mode, #target, #workspace, #workspace_path, #xcodeproj, #xcodeproj_path

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Configuration

#absolute_path, absolute_path, #all_xcodeproj_paths, #app_delegate_objc_path, #app_delegate_swift_path, available_options, #branch_imports, #branch_imports_from_file, #bridging_header_path, #bridging_header_required?, #confirm_with_user, defaults, #find_project, #helper, #ios_urischemes_from_api, #key_valid?, #messages_view_controller_path, #method_missing, #modules_enabled?, open_podfile, #open_podfile, open_xcodeproj, #open_xcodeproj, #pod_install_required?, #print_identification, #prompt_for_option, relative_path, #relative_path, #root, root, #swift_version, #target_name, uri_scheme_without_suffix, #uses_frameworks?, #validate_buildfile_at_path, #validate_buildfile_path, #validate_key, #validate_keys, #validate_target, #validate_xcodeproj_path, wrapper

Constructor Details

#initialize(options) ⇒ ValidateConfiguration

Returns a new instance of ValidateConfiguration.



23
24
25
26
# File 'lib/branch_io_cli/configuration/validate_configuration.rb', line 23

def initialize(options)
  super
  @domains = options.domains
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BranchIOCLI::Configuration::Configuration

Class Method Details

.examplesObject



13
14
15
16
17
18
19
20
# File 'lib/branch_io_cli/configuration/validate_configuration.rb', line 13

def examples
  {
    "Ensure project has at least one correctly configured Branch key and domain" => "br validate",
    "Ensure project is correctly configured for certain Branch keys" => "br validate -L key_live_xxxx -T key_test_yyyy",
    "Ensure project is correctly configured to use specific domains" => "br validate -D myapp.app.link,myapp-alternate.app.link",
    "Validate only Universal Link configuration" => "br validate --universal-links-only"
  }
end

.return_valueObject



9
10
11
# File 'lib/branch_io_cli/configuration/validate_configuration.rb', line 9

def return_value
  "If validation passes, this command returns 0. If validation fails, it returns 1."
end

.summaryObject



5
6
7
# File 'lib/branch_io_cli/configuration/validate_configuration.rb', line 5

def summary
  "Validates all Universal Link domains configured in a project"
end

Instance Method Details

#logObject



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/branch_io_cli/configuration/validate_configuration.rb', line 34

def log
  super
  say <<EOF
<%= color('Xcode project:', BOLD) %> #{xcodeproj_path}
<%= color('Target:', BOLD) %> #{target.name}
<%= color('Target type:', BOLD) %> #{target.product_type}
<%= color('Live key:', BOLD) %> #{keys[:live] || '(none)'}
<%= color('Test key:', BOLD) %> #{keys[:test] || '(none)'}
<%= color('Domains:', BOLD) %> #{domains || '(none)'}
<%= color('Configurations:', BOLD) %> #{(configurations || xcodeproj.build_configurations.map(&:name)).join(',')}
EOF
end

#validate_optionsObject



28
29
30
31
32
# File 'lib/branch_io_cli/configuration/validate_configuration.rb', line 28

def validate_options
  validate_xcodeproj_path
  validate_target
  validate_keys optional: true
end