ccios 4.1.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/CHANGELOG.md +35 -0
  4. data/Gemfile.lock +34 -15
  5. data/MAINTAINER.md +8 -0
  6. data/README.md +188 -56
  7. data/ccios.gemspec +2 -2
  8. data/lib/ccios/argument_template_parameter.rb +33 -0
  9. data/lib/ccios/code_templater.rb +24 -8
  10. data/lib/ccios/config.rb +41 -91
  11. data/lib/ccios/file_creator.rb +37 -24
  12. data/lib/ccios/file_template_definition.rb +95 -0
  13. data/lib/ccios/flag_template_parameter.rb +17 -0
  14. data/lib/ccios/group_template_definition.rb +54 -0
  15. data/lib/ccios/pbxproj_parser.rb +4 -55
  16. data/lib/ccios/snippet_template_definition.rb +27 -0
  17. data/lib/ccios/template_definition.rb +116 -0
  18. data/lib/ccios/templates/{coordinator.mustache → Coordinator/coordinator.mustache} +5 -2
  19. data/lib/ccios/templates/Coordinator/template.yml +19 -0
  20. data/lib/ccios/templates/{interactor_implementation.mustache → Interactor/interactor_implementation.mustache} +2 -2
  21. data/lib/ccios/templates/Interactor/template.yml +24 -0
  22. data/{templates_library/async → lib/ccios/templates/Presenter}/dependency_provider.mustache +6 -2
  23. data/lib/ccios/templates/{presenter_implementation.mustache → Presenter/presenter_implementation.mustache} +4 -1
  24. data/lib/ccios/templates/Presenter/template.yml +55 -0
  25. data/lib/ccios/templates/{view_contract.mustache → Presenter/view_contract.mustache} +2 -1
  26. data/lib/ccios/templates/{view_controller.mustache → Presenter/view_controller.mustache} +4 -0
  27. data/{templates_library/async/repository.mustache → lib/ccios/templates/Presenter/view_model.mustache} +2 -3
  28. data/lib/ccios/templates/Presenter/view_model_mapper.mustache +16 -0
  29. data/lib/ccios/templates/Repository/template.yml +25 -0
  30. data/lib/ccios/templates_loader.rb +31 -0
  31. data/lib/ccios.rb +65 -43
  32. data/templates_library/async/Coordinator/template.yml +20 -0
  33. data/{lib/ccios/templates → templates_library/async/Presenter}/presenter.mustache +2 -0
  34. data/templates_library/async/Presenter/template.yml +49 -0
  35. metadata +40 -34
  36. data/lib/ccios/coordinator_generator.rb +0 -18
  37. data/lib/ccios/interactor_generator.rb +0 -33
  38. data/lib/ccios/presenter_generator.rb +0 -71
  39. data/lib/ccios/repository_generator.rb +0 -44
  40. data/templates_library/async/interactor.mustache +0 -13
  41. data/templates_library/async/interactor_assembly.mustache +0 -5
  42. data/templates_library/async/interactor_implementation.mustache +0 -22
  43. data/templates_library/async/repository_assembly.mustache +0 -6
  44. data/templates_library/async/repository_implementation.mustache +0 -20
  45. /data/lib/ccios/templates/{interactor.mustache → Interactor/interactor.mustache} +0 -0
  46. /data/lib/ccios/templates/{interactor_assembly.mustache → Interactor/interactor_assembly.mustache} +0 -0
  47. /data/{templates_library/async → lib/ccios/templates/Presenter}/presenter.mustache +0 -0
  48. /data/lib/ccios/templates/{presenter_assembly.mustache → Presenter/presenter_assembly.mustache} +0 -0
  49. /data/lib/ccios/templates/{repository.mustache → Repository/repository.mustache} +0 -0
  50. /data/lib/ccios/templates/{repository_assembly.mustache → Repository/repository_assembly.mustache} +0 -0
  51. /data/lib/ccios/templates/{repository_implementation.mustache → Repository/repository_implementation.mustache} +0 -0
  52. /data/templates_library/async/{coordinator.mustache → Coordinator/coordinator.mustache} +0 -0
  53. /data/{lib/ccios/templates → templates_library/async/Presenter}/dependency_provider.mustache +0 -0
  54. /data/templates_library/async/{presenter_assembly.mustache → Presenter/presenter_assembly.mustache} +0 -0
  55. /data/templates_library/async/{presenter_implementation.mustache → Presenter/presenter_implementation.mustache} +0 -0
  56. /data/templates_library/async/{view_contract.mustache → Presenter/view_contract.mustache} +0 -0
  57. /data/templates_library/async/{view_controller.mustache → Presenter/view_controller.mustache} +0 -0
@@ -1,71 +0,0 @@
1
- require_relative 'file_creator'
2
- require_relative "pbxproj_parser"
3
-
4
- class PresenterGenerator
5
-
6
- def initialize(parser, config)
7
- @parser = parser
8
- @config = config
9
- end
10
-
11
- def generate(presenter_name, options = {})
12
- app_group = @parser.presenter_group
13
- presenter_name = presenter_name.gsub("Presenter", "")
14
- associate_path_to_group = !app_group.path.nil?
15
-
16
- raise "[Error] Group #{presenter_name} already exists in #{app_group.display_name}" if app_group[presenter_name]
17
- new_group_path = File.join(app_group.real_path, presenter_name)
18
- new_group = app_group.pf_new_group(
19
- associate_path_to_group: associate_path_to_group,
20
- name: presenter_name,
21
- path: new_group_path
22
- )
23
-
24
- ui_group_path = File.join(new_group_path, "UI")
25
- ui_group = new_group.pf_new_group(
26
- associate_path_to_group: associate_path_to_group,
27
- name: "UI",
28
- path: ui_group_path
29
- )
30
-
31
- view_group_path = File.join(ui_group_path, "View")
32
- view_group = ui_group.pf_new_group(
33
- associate_path_to_group: associate_path_to_group,
34
- name: "View",
35
- path: view_group_path
36
- )
37
-
38
- view_controller_group_path = File.join(ui_group_path, "ViewController")
39
- view_controller_group = ui_group.pf_new_group(
40
- associate_path_to_group: associate_path_to_group,
41
- name: "ViewController",
42
- path: view_controller_group_path
43
- )
44
-
45
- presenter_group_path = File.join(new_group_path, "Presenter")
46
- presenter_group = new_group.pf_new_group(
47
- associate_path_to_group: associate_path_to_group,
48
- name: "Presenter",
49
- path: presenter_group_path
50
- )
51
-
52
- model_group_path = File.join(new_group_path, "Model")
53
- model_group = new_group.pf_new_group(
54
- associate_path_to_group: associate_path_to_group,
55
- name: "Model",
56
- path: model_group_path
57
- )
58
-
59
- file_creator = FileCreator.new(options, @config)
60
- target = @parser.app_target
61
- file_creator.create_file(presenter_name, 'ViewContract', ui_group, target)
62
- file_creator.create_file(presenter_name, 'ViewController', view_controller_group, target)
63
- file_creator.create_file(presenter_name, 'Presenter', presenter_group, target)
64
- file_creator.create_file(presenter_name, 'PresenterImplementation', presenter_group, target)
65
- file_creator.create_empty_directory(model_group)
66
- file_creator.create_empty_directory(view_group)
67
-
68
- file_creator.print_file_content(presenter_name, 'DependencyProvider')
69
- file_creator.print_file_content(presenter_name, 'PresenterAssembly')
70
- end
71
- end
@@ -1,44 +0,0 @@
1
- require_relative 'file_creator'
2
- require_relative "pbxproj_parser"
3
-
4
- class RepositoryGenerator
5
-
6
- def initialize(parser, config)
7
- @parser = parser
8
- @config = config
9
- end
10
-
11
- def generate(repository_name, options = {})
12
- core_group = @parser.repository_core_group
13
- data_group = @parser.repository_data_group
14
- repository_name = repository_name.gsub("Repository", "")
15
-
16
- raise "[Error] Group #{repository_name} already exists in #{core_group.display_name}" if core_group[repository_name]
17
- associate_path_to_group = !core_group.path.nil?
18
- core_data_new_group_path = File.join(core_group.real_path, repository_name)
19
- core_data_new_group = core_group.pf_new_group(
20
- associate_path_to_group: associate_path_to_group,
21
- name: repository_name,
22
- path: core_data_new_group_path
23
- )
24
-
25
- raise "[Error] Group #{repository_name} already exists in #{data_group.display_name}" if data_group[repository_name]
26
- associate_path_to_group = !data_group.path.nil?
27
- data_new_group_path = File.join(data_group.real_path, repository_name)
28
- data_new_group = data_group.pf_new_group(
29
- associate_path_to_group: associate_path_to_group,
30
- name: repository_name,
31
- path: data_new_group_path
32
- )
33
-
34
- file_creator = FileCreator.new(options, @config)
35
- core_target = @parser.core_target
36
- file_creator.create_file(repository_name, 'Repository', core_data_new_group, core_target)
37
-
38
- file_creator = FileCreator.new(options, @config)
39
- data_target = @parser.data_target
40
- file_creator.create_file(repository_name, 'RepositoryImplementation', data_new_group, data_target)
41
-
42
- file_creator.print_file_content(repository_name, 'RepositoryAssembly')
43
- end
44
- end
@@ -1,13 +0,0 @@
1
- //
2
- // {{name}}Interactor.swift
3
- // {{project_name}}
4
- //
5
- // Created by {{full_username}} on {{date}}.
6
- //
7
- //
8
-
9
- import Foundation
10
-
11
- public protocol {{name}}Interactor {
12
- func execute() async throws
13
- }
@@ -1,5 +0,0 @@
1
- container.register({{name}}Interactor.self) { _ in
2
- {{name}}InteractorImplementation(
3
-
4
- )
5
- }
@@ -1,22 +0,0 @@
1
- //
2
- // {{name}}InteractorImplementation.swift
3
- // {{project_name}}
4
- //
5
- // Created by {{full_username}} on {{date}}.
6
- //
7
- //
8
-
9
- import Foundation
10
-
11
- public class {{name}}InteractorImplementation: {{name}}Interactor {
12
-
13
- public init() {
14
-
15
- }
16
-
17
- // MARK: - {{name}}Interactor
18
-
19
- public func execute() async throws {
20
-
21
- }
22
- }
@@ -1,6 +0,0 @@
1
- container.register({{name}}Repository.self) { _ in
2
- {{name}}RepositoryImplementation(
3
-
4
- )
5
- }
6
- .inObjectScope(.container)
@@ -1,20 +0,0 @@
1
- //
2
- // {{name}}RepositoryImplementation.swift
3
- // {{project_name}}
4
- //
5
- // Created by {{full_username}} on {{date}}.
6
- //
7
- //
8
-
9
- import Foundation
10
- import Core
11
-
12
- public class {{name}}RepositoryImplementation: {{name}}Repository {
13
-
14
- public init() {
15
-
16
- }
17
-
18
- // MARK: - {{name}}Repository
19
-
20
- }