lib/ios/module/setup/ConfigureSwift.rb in shellboxCLI-0.1.3 vs lib/ios/module/setup/ConfigureSwift.rb in shellboxCLI-0.1.4
- old
+ new
@@ -11,23 +11,37 @@
def initialize(options)
@configurator = options.fetch(:configurator)
end
def perform
- 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
moduleType = configurator.ask_with_answers("Qual o tipo do módulo", ["Core", "Feature"]).to_sym
- keepDemo = configurator.ask_with_answers("Criar projeto exemplo", ["No", "Yes"]).to_sym
- hasSwiftgen = configurator.ask_with_answers("Criar Swiftgen", ["Yes", "No"]).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
+ :has_test => hasTest,
+ :mock_network => mockNetwork
}).run
end
end
-end
\ No newline at end of file
+end