ccios 2.3.0 → 4.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29703bfd0d7ddbcbd3ab7a98bce4f6e8bd1826df86cc38085235b3396441a925
4
- data.tar.gz: ccb448d02fab86e5e851f110f6692cbd2d267f430351ed1d8d2e92ed4d5e18f6
3
+ metadata.gz: 3f8159d13b805646ece40483ebefb21ff1294579b58e28eaafb3a353274fa554
4
+ data.tar.gz: 248f6b498d1b435af918bc1a8675760f426ebf52ffcd1ca7e09f8a8ea85b2b2b
5
5
  SHA512:
6
- metadata.gz: dd988ebb1bf5dc9811c4f6b04a828635850f3513a7095135575359313f5f374524d122cd9ca5056526b9efc4d91bc10123d2ce10904a543f68fd3ead28985518
7
- data.tar.gz: 938c34078cd51d64ddbd3af8bd5ff3e68da3e34e1659c781e5f4a3f3e598f0787bc4ee1bbbd6132ce57e5c39fe45e5fb5a145569c97166464c1456a644d54181
6
+ metadata.gz: 8cb1756d184f9291d86f4a4e2a6a4b57d4e43f54dd4e67c9162f209c35333f4bc5657edfb4b6c9e4df361fc6c93d3b4138b7db7a3e1efcdeeb179e4b6d1a0b64
7
+ data.tar.gz: 2ba3f77bb27f682a8f2d492a9f52c3a70da99db92e03633afda28b3f64c2f700c12a517731b45d2b3870a5455ef96614d57d447458ed8d074c1bbc0b4eb9fc23
data/CHANGELOG.md CHANGED
@@ -2,6 +2,41 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  `ADUtils` adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [Unreleased]
6
+
7
+ ## [4.0.2]
8
+
9
+ ### Fixed
10
+
11
+ - Do not duplicate suffix if already present in the command name
12
+
13
+ ## [4.0.1]
14
+
15
+ ### Fixed
16
+
17
+ - Do not generate new groups with name if using folder references
18
+
19
+ ## [4.0.0]
20
+
21
+ ### Added
22
+ - Use `ADCoordinator` dependency in coordinator files
23
+
24
+ ### Fixed
25
+ - Use `active_support` instead of `rails` dependency
26
+ - Add dev dependencies
27
+
28
+ ## [3.0.0]
29
+
30
+ ### Fixed
31
+ - Use `ApplicationDependencyProvider` in Coordinator
32
+ - Updated by [Denis Poifol](https://github.com/denisPoifol) in Pull Request [#10](https://github.com/felginep/ccios/pull/10)
33
+
34
+ ## [2.3.1]
35
+
36
+ ### Fixed
37
+ - Import `Core` in Repository implementations
38
+ - Updated by [Hervé Béranger](https://github.com/hberenger) in Pull Request [#11](https://github.com/felginep/ccios/pull/11)
39
+
5
40
  ## [2.3.0]
6
41
 
7
42
  ### Added
data/Gemfile.lock CHANGED
@@ -1,139 +1,48 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ccios (2.3.0)
4
+ ccios (4.0.2)
5
+ activesupport (> 4)
5
6
  mustache (~> 1.0)
6
- rails (~> 5.1)
7
7
  xcodeproj (~> 1.4)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- CFPropertyList (3.0.2)
13
- actioncable (5.2.4.2)
14
- actionpack (= 5.2.4.2)
15
- nio4r (~> 2.0)
16
- websocket-driver (>= 0.6.1)
17
- actionmailer (5.2.4.2)
18
- actionpack (= 5.2.4.2)
19
- actionview (= 5.2.4.2)
20
- activejob (= 5.2.4.2)
21
- mail (~> 2.5, >= 2.5.4)
22
- rails-dom-testing (~> 2.0)
23
- actionpack (5.2.4.2)
24
- actionview (= 5.2.4.2)
25
- activesupport (= 5.2.4.2)
26
- rack (~> 2.0, >= 2.0.8)
27
- rack-test (>= 0.6.3)
28
- rails-dom-testing (~> 2.0)
29
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
30
- actionview (5.2.4.2)
31
- activesupport (= 5.2.4.2)
32
- builder (~> 3.1)
33
- erubi (~> 1.4)
34
- rails-dom-testing (~> 2.0)
35
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
36
- activejob (5.2.4.2)
37
- activesupport (= 5.2.4.2)
38
- globalid (>= 0.3.6)
39
- activemodel (5.2.4.2)
40
- activesupport (= 5.2.4.2)
41
- activerecord (5.2.4.2)
42
- activemodel (= 5.2.4.2)
43
- activesupport (= 5.2.4.2)
44
- arel (>= 9.0)
45
- activestorage (5.2.4.2)
46
- actionpack (= 5.2.4.2)
47
- activerecord (= 5.2.4.2)
48
- marcel (~> 0.3.1)
49
- activesupport (5.2.4.2)
12
+ CFPropertyList (3.0.3)
13
+ activesupport (6.1.3)
50
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
51
- i18n (>= 0.7, < 2)
52
- minitest (~> 5.1)
53
- tzinfo (~> 1.1)
54
- arel (9.0.0)
15
+ i18n (>= 1.6, < 2)
16
+ minitest (>= 5.1)
17
+ tzinfo (~> 2.0)
18
+ zeitwerk (~> 2.3)
55
19
  atomos (0.1.3)
56
- builder (3.2.4)
57
20
  claide (1.0.3)
58
21
  colored2 (3.1.2)
59
- concurrent-ruby (1.1.6)
60
- crass (1.0.6)
61
- erubi (1.9.0)
62
- globalid (0.4.2)
63
- activesupport (>= 4.2.0)
64
- i18n (1.8.2)
22
+ concurrent-ruby (1.1.8)
23
+ i18n (1.8.9)
65
24
  concurrent-ruby (~> 1.0)
66
- loofah (2.5.0)
67
- crass (~> 1.0.2)
68
- nokogiri (>= 1.5.9)
69
- mail (2.7.1)
70
- mini_mime (>= 0.1.1)
71
- marcel (0.3.3)
72
- mimemagic (~> 0.3.2)
73
- method_source (1.0.0)
74
- mimemagic (0.3.4)
75
- mini_mime (1.0.2)
76
- mini_portile2 (2.4.0)
77
- minitest (5.14.0)
25
+ minitest (5.14.2)
78
26
  mustache (1.1.1)
79
- nanaimo (0.2.6)
80
- nio4r (2.5.2)
81
- nokogiri (1.10.9)
82
- mini_portile2 (~> 2.4.0)
83
- rack (2.2.2)
84
- rack-test (1.1.0)
85
- rack (>= 1.0, < 3)
86
- rails (5.2.4.2)
87
- actioncable (= 5.2.4.2)
88
- actionmailer (= 5.2.4.2)
89
- actionpack (= 5.2.4.2)
90
- actionview (= 5.2.4.2)
91
- activejob (= 5.2.4.2)
92
- activemodel (= 5.2.4.2)
93
- activerecord (= 5.2.4.2)
94
- activestorage (= 5.2.4.2)
95
- activesupport (= 5.2.4.2)
96
- bundler (>= 1.3.0)
97
- railties (= 5.2.4.2)
98
- sprockets-rails (>= 2.0.0)
99
- rails-dom-testing (2.0.3)
100
- activesupport (>= 4.2.0)
101
- nokogiri (>= 1.6)
102
- rails-html-sanitizer (1.3.0)
103
- loofah (~> 2.3)
104
- railties (5.2.4.2)
105
- actionpack (= 5.2.4.2)
106
- activesupport (= 5.2.4.2)
107
- method_source
108
- rake (>= 0.8.7)
109
- thor (>= 0.19.0, < 2.0)
110
- rake (13.0.1)
111
- sprockets (4.0.0)
27
+ nanaimo (0.3.0)
28
+ rake (12.3.3)
29
+ tzinfo (2.0.4)
112
30
  concurrent-ruby (~> 1.0)
113
- rack (> 1, < 3)
114
- sprockets-rails (3.2.1)
115
- actionpack (>= 4.0)
116
- activesupport (>= 4.0)
117
- sprockets (>= 3.0.0)
118
- thor (1.0.1)
119
- thread_safe (0.3.6)
120
- tzinfo (1.2.7)
121
- thread_safe (~> 0.1)
122
- websocket-driver (0.7.1)
123
- websocket-extensions (>= 0.1.0)
124
- websocket-extensions (0.1.4)
125
- xcodeproj (1.16.0)
31
+ xcodeproj (1.19.0)
126
32
  CFPropertyList (>= 2.3.3, < 4.0)
127
33
  atomos (~> 0.1.3)
128
34
  claide (>= 1.0.2, < 2.0)
129
35
  colored2 (~> 3.1)
130
- nanaimo (~> 0.2.6)
36
+ nanaimo (~> 0.3.0)
37
+ zeitwerk (2.4.2)
131
38
 
132
39
  PLATFORMS
133
40
  ruby
134
41
 
135
42
  DEPENDENCIES
136
43
  ccios!
44
+ minitest (~> 5.11)
45
+ rake (~> 12.3)
137
46
 
138
47
  BUNDLED WITH
139
48
  1.17.3
data/Makefile CHANGED
@@ -8,4 +8,4 @@ clean:
8
8
  rm -f ccios-*.gem
9
9
 
10
10
  tests:
11
- rake test
11
+ bundle exec rake test
data/README.md CHANGED
@@ -14,7 +14,7 @@ gem install ./ccios-x.x.x.gem
14
14
  ```
15
15
 
16
16
  To run the tests run:
17
- ```rake test```
17
+ ```bundle exec rake test```
18
18
 
19
19
  # How to use
20
20
 
data/ccios.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ccios'
3
- s.version = '2.3.0'
3
+ s.version = '4.0.2'
4
4
  s.executables << 'ccios'
5
5
  s.date = '2016-08-03'
6
6
  s.summary = "Clean Code iOS Generator"
@@ -11,7 +11,10 @@ Gem::Specification.new do |s|
11
11
  s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
12
12
  s.homepage = 'http://rubygems.org/gems/hola'
13
13
  s.license = 'MIT'
14
+ s.add_dependency 'activesupport', '> 4'
14
15
  s.add_dependency 'xcodeproj', '~> 1.4'
15
- s.add_dependency 'rails', '~> 5.1'
16
16
  s.add_dependency "mustache", "~> 1.0"
17
+
18
+ s.add_development_dependency 'rake', '~> 12.3'
19
+ s.add_development_dependency 'minitest', '~> 5.11'
17
20
  end
data/lib/ccios.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
  require 'xcodeproj'
3
3
  require 'optparse'
4
- require 'rails' # for underscore method used in code_templater.rb
4
+ require 'active_support'
5
5
  require 'ccios/presenter_generator'
6
6
  require 'ccios/coordinator_generator'
7
7
  require 'ccios/interactor_generator'
@@ -1,5 +1,5 @@
1
1
  require 'mustache'
2
- require 'rails'
2
+ require 'active_support/core_ext/string'
3
3
 
4
4
  class CodeTemplater
5
5
  def initialize(options = {})
@@ -12,6 +12,7 @@ class CoordinatorGenerator
12
12
  coordinator_group = @parser.coordinator_group
13
13
  file_creator = FileCreator.new(options)
14
14
  target = @parser.app_target
15
+ coordinator_name = coordinator_name.gsub("Coordinator", "")
15
16
  file_creator.create_file(coordinator_name, 'Coordinator', coordinator_group, target)
16
17
  end
17
18
  end
@@ -1,5 +1,18 @@
1
1
  require_relative 'code_templater'
2
2
  require 'fileutils'
3
+ require 'logger'
4
+
5
+ class Xcodeproj::Project::Object::PBXGroup
6
+
7
+ def pf_new_group(associate_path_to_group:, name:, path:)
8
+ # When using "Group with folder" we only provide a path
9
+ # When using "Group without folder" we only provide a name
10
+ new_group(
11
+ associate_path_to_group ? nil : name,
12
+ associate_path_to_group ? path : nil
13
+ )
14
+ end
15
+ end
3
16
 
4
17
  class FileCreator
5
18
 
@@ -10,13 +10,18 @@ class InteractorGenerator
10
10
 
11
11
  def generate(interactor_name, options = {})
12
12
  interactor_group = @parser.interactor_group
13
+ interactor_name = interactor_name.gsub("Interactor", "")
13
14
  new_group_name = "#{interactor_name}Interactor"
14
15
 
15
16
  associate_path_to_group = !interactor_group.path.nil?
16
17
 
17
18
  raise "[Error] Group #{new_group_name} already exists in #{app_group.display_name}" if interactor_group[new_group_name]
18
19
  new_group_path = File.join(interactor_group.real_path, new_group_name)
19
- new_group = interactor_group.new_group(new_group_name, associate_path_to_group ? new_group_path : nil)
20
+ new_group = interactor_group.pf_new_group(
21
+ associate_path_to_group: associate_path_to_group,
22
+ name: new_group_name,
23
+ path: new_group_path
24
+ )
20
25
 
21
26
  file_creator = FileCreator.new(options)
22
27
  target = @parser.core_target
@@ -1,4 +1,5 @@
1
1
  require 'xcodeproj'
2
+ require 'active_support/core_ext/object/blank'
2
3
 
3
4
  class PBXProjParser
4
5
 
@@ -10,27 +10,51 @@ class PresenterGenerator
10
10
 
11
11
  def generate(presenter_name, options = {})
12
12
  app_group = @parser.presenter_group
13
-
13
+ presenter_name = presenter_name.gsub("Presenter", "")
14
14
  associate_path_to_group = !app_group.path.nil?
15
15
 
16
16
  raise "[Error] Group #{presenter_name} already exists in #{app_group.display_name}" if app_group[presenter_name]
17
17
  new_group_path = File.join(app_group.real_path, presenter_name)
18
- new_group = app_group.new_group(presenter_name, associate_path_to_group ? new_group_path : nil)
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
+ )
19
23
 
20
24
  ui_group_path = File.join(new_group_path, "UI")
21
- ui_group = new_group.new_group("UI", associate_path_to_group ? ui_group_path : nil)
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
+ )
22
30
 
23
31
  view_group_path = File.join(ui_group_path, "View")
24
- view_group = ui_group.new_group("View", associate_path_to_group ? view_group_path : nil)
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
+ )
25
37
 
26
38
  view_controller_group_path = File.join(ui_group_path, "ViewController")
27
- view_controller_group = ui_group.new_group("ViewController", associate_path_to_group ? view_controller_group_path : nil)
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
+ )
28
44
 
29
45
  presenter_group_path = File.join(new_group_path, "Presenter")
30
- presenter_group = new_group.new_group("Presenter", associate_path_to_group ? presenter_group_path : nil)
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
+ )
31
51
 
32
52
  model_group_path = File.join(new_group_path, "Model")
33
- model_group = new_group.new_group("Model", associate_path_to_group ? model_group_path : nil)
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
+ )
34
58
 
35
59
  file_creator = FileCreator.new(options)
36
60
  target = @parser.app_target
@@ -11,16 +11,25 @@ class RepositoryGenerator
11
11
  def generate(repository_name, options = {})
12
12
  core_group = @parser.repository_core_group
13
13
  data_group = @parser.repository_data_group
14
+ repository_name = repository_name.gsub("Repository", "")
14
15
 
15
16
  raise "[Error] Group #{repository_name} already exists in #{core_group.display_name}" if core_group[repository_name]
16
17
  associate_path_to_group = !core_group.path.nil?
17
18
  core_data_new_group_path = File.join(core_group.real_path, repository_name)
18
- core_data_new_group = core_group.new_group(repository_name, associate_path_to_group ? core_data_new_group_path : nil)
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
+ )
19
24
 
20
25
  raise "[Error] Group #{repository_name} already exists in #{data_group.display_name}" if data_group[repository_name]
21
26
  associate_path_to_group = !data_group.path.nil?
22
27
  data_new_group_path = File.join(data_group.real_path, repository_name)
23
- data_new_group = data_group.new_group(repository_name, associate_path_to_group ? data_new_group_path : nil)
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
+ )
24
33
 
25
34
  file_creator = FileCreator.new(options)
26
35
  core_target = @parser.core_target
@@ -7,6 +7,7 @@
7
7
  //
8
8
 
9
9
  import Foundation
10
+ import ADCoordinator
10
11
 
11
12
  {{#generate_delegate}}
12
13
  protocol {{name}}CoordinatorDelegate: AnyObject {
@@ -19,15 +20,20 @@ class {{name}}Coordinator: Coordinator {
19
20
  {{#generate_delegate}}
20
21
  weak var delegate: {{name}}CoordinatorDelegate?
21
22
  {{/generate_delegate}}
22
- private let navigationController: UINavigationController
23
+ private let dependencyProvider: ApplicationDependencyProvider
24
+ private unowned var navigationController: UINavigationController
23
25
 
24
- init(navigationController: UINavigationController) {
26
+ init(navigationController: UINavigationController,
27
+ dependencyProvider: ApplicationDependencyProvider) {
25
28
  self.navigationController = navigationController
29
+ self.dependencyProvider = dependencyProvider
26
30
  }
27
31
 
28
32
  // MARK: - Public
29
33
 
30
34
  func start() {
31
-
35
+ let viewController = UIViewController()
36
+ navigationController.pushViewController(viewController, animated: false)
37
+ bindToLifecycle(of: viewController)
32
38
  }
33
39
  }
@@ -8,6 +8,7 @@
8
8
  //
9
9
 
10
10
  import Foundation
11
+ import Core
11
12
 
12
13
  public class {{name}}RepositoryImplementation: {{name}}Repository {
13
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ccios
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Felgines
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2016-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">"
18
+ - !ruby/object:Gem::Version
19
+ version: '4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">"
25
+ - !ruby/object:Gem::Version
26
+ version: '4'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: xcodeproj
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -25,33 +39,47 @@ dependencies:
25
39
  - !ruby/object:Gem::Version
26
40
  version: '1.4'
27
41
  - !ruby/object:Gem::Dependency
28
- name: rails
42
+ name: mustache
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '5.1'
47
+ version: '1.0'
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '5.1'
54
+ version: '1.0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: mustache
56
+ name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '1.0'
48
- type: :runtime
61
+ version: '12.3'
62
+ type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '1.0'
68
+ version: '12.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '5.11'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '5.11'
55
83
  description: Clean Code iOS Generator
56
84
  email: pierre.felgines@gmail.com
57
85
  executables: