Sha256: 24e6f9c65e9a7f7ebb660486d47558cdb0bff5007add6f46e33f11dea1ce09cb

Contents?: true

Size: 1.66 KB

Versions: 15

Compression:

Stored size: 1.66 KB

Contents

require 'ios/module/setup/ProjectManipulator'

module IOS
  class ConfigureSwift
    attr_reader :configurator, :root_path

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

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

    def perform
      moduleType = configurator.ask_with_answers("Qual o tipo do módulo", ["Core", "Feature"]).to_sym


      if moduleType == :feature
        hasInterface = "yes".to_sym
        hasSwiftgen = "yes".to_sym
        hasTest = "yes".to_sym
      else
        hasInterface = configurator.ask_with_answers("Criar módulo de interfaces", ["Yes", "No"]).to_sym
        hasTest = configurator.ask_with_answers("Criar pasta de teste", ["Yes", "No"]).to_sym
        hasSwiftgen = configurator.ask_with_answers("Criar Swiftgen", ["Yes", "No"]).to_sym
        mockNetwork = "no".to_sym
      end

      keepDemo = configurator.ask_with_answers("Criar projeto exemplo", ["Yes", "No"]).to_sym
      if keepDemo == :yes && moduleType == :feature
        mockNetwork = configurator.ask_with_answers("Criar mocks de network para o projeto exemplo", ["Yes", "No"]).to_sym
      end

      ProjectManipulator.new({
                                    :configurator => @configurator,
                                    :keep_demo => keepDemo,
                                    :module_type => moduleType,
                                    :has_swiftgen => hasSwiftgen,
                                    :has_interface => hasInterface,
                                    :has_test => hasTest,
                                    :mock_network => mockNetwork
                                  }).run
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
shellboxCLI-0.3.2 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.3.1 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.3.0 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.2.0 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.16 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.15 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.14 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.12 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.11 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.10 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.9 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.8 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.7 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.6 lib/ios/module/setup/ConfigureSwift.rb
shellboxCLI-0.1.4 lib/ios/module/setup/ConfigureSwift.rb