Sha256: 30f06d1086ac1a34fd090127ca1cc8292b5db763de7376a89528ab9504d33d32

Contents?: true

Size: 1.32 KB

Versions: 13

Compression:

Stored size: 1.32 KB

Contents

module Pod

  class ConfigureMacOSSwift
    attr_reader :configurator

    def self.perform(options)
      new(options).perform
    end

    def initialize(options)
      @configurator = options.fetch(:configurator)
    end

    def perform
      keep_demo = configurator.ask_with_answers("Would you like to include a demo application with your library", ["Yes", "No"]).to_sym

      framework = configurator.ask_with_answers("Which testing frameworks will you use", ["Quick", "None"]).to_sym
      case framework
        when :quick
          configurator.add_pod_to_podfile "Quick', '~> 2.2.0"
          configurator.add_pod_to_podfile "Nimble', '~> 8.0.7"
          configurator.set_test_framework "quick", "swift", "macos-swift"

        when :none
          configurator.set_test_framework "xctest", "swift", "macos-swift"
      end

      Pod::ProjectManipulator.new({
        :configurator => @configurator,
        :xcodeproj_path => "templates/macos-swift/Example/PROJECT.xcodeproj",
        :platform => :osx,
        :remove_demo_project => (keep_demo == :no),
        :prefix => ""
      }).run

      `mv ./templates/macos-swift/* ./`

      # There has to be a single file in the Classes dir
      # or a framework won't be created
      `touch Pod/Classes/ReplaceMe.swift`

      `mv ./NAME-osx.podspec ./NAME.podspec`
    end
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
yk_command-0.6.2 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.6.1 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.6.0 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.5.91 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.5.9 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.5.8 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.5.7 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.5.6 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.5.5 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.5.4 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.5.3 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.5.2 lib/yk_command/project/setup/ConfigureMacOSSwift.rb
yk_command-0.5.1 lib/yk_command/project/setup/ConfigureMacOSSwift.rb