Sha256: d27c1b1308485210072020ba7908968dc2a69172889820ae9b564900ad5bbcff

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

require 'yaml'
require 'ios_toolchain/config'

module IosToolchain
  class ConfigBootstrapper
    def initialize(project_analyzer)
      @analyzer = project_analyzer
    end

    def bootstrap!
      File.open(config_file_path, 'w') do |file|
        file.write config.to_yaml
      end
    end

    private

    def config_file_name
      Config.new.file_name
    end

    def config_file_path
      File.join(analyzer.project_root, config_file_name)
    end

    def config
      {
        'project-file-path' => analyzer.project_path,
        'default-scheme' => analyzer.default_scheme,
        'default-sdk' => 'iphoneos10.2',
        'default-32bit-test-device' => "'iOS Simulator,OS=10.2,name=iPhone 5'",
        'default-64bit-test-device' => "'iOS Simulator,OS=10.2,name=iPhone 7'",
        'app-targets' => analyzer.app_targets,
        'test-targets' => analyzer.test_targets,
        'ui-test-targets' => analyzer.ui_test_targets,
        'provisioning-path' => "#{File.join(analyzer.project_root, 'provisioning')}",
        'crashlytics-framework-path' => analyzer.crashlytics_framework_path
      }
    end

    attr_reader :analyzer
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ios_toolchain-0.2.2 lib/ios_toolchain/config_bootstrapper.rb
ios_toolchain-0.2.1 lib/ios_toolchain/config_bootstrapper.rb
ios_toolchain-0.2.0 lib/ios_toolchain/config_bootstrapper.rb