ccios 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17e45b6aa153c86b30ee9975a172b6a9e010c796633936310497a4d7eafea7e4
4
- data.tar.gz: 61769b9cdd9d07510d855ccbbbdcace5a79fb171391872db91d93778bfbc0448
3
+ metadata.gz: 29703bfd0d7ddbcbd3ab7a98bce4f6e8bd1826df86cc38085235b3396441a925
4
+ data.tar.gz: ccb448d02fab86e5e851f110f6692cbd2d267f430351ed1d8d2e92ed4d5e18f6
5
5
  SHA512:
6
- metadata.gz: d0782622ea52267f207de88a45a60fdcffe93629b3c6fcb8542c2ee256dccc7fd44e1aeb4b2dc1b2e4fb5514b836fbe561968e18bda962d50b4d5b23884cad34
7
- data.tar.gz: a744aaa03b197360105b3656580dfecc9675138269a9bf7116093b1daa208919ac5cf77ece3ca735b92906a303b2e79dbe95df22f12653b631c4cb0d53c842ee
6
+ metadata.gz: dd988ebb1bf5dc9811c4f6b04a828635850f3513a7095135575359313f5f374524d122cd9ca5056526b9efc4d91bc10123d2ce10904a543f68fd3ead28985518
7
+ data.tar.gz: 938c34078cd51d64ddbd3af8bd5ff3e68da3e34e1659c781e5f4a3f3e598f0787bc4ee1bbbd6132ce57e5c39fe45e5fb5a145569c97166464c1456a644d54181
@@ -2,6 +2,11 @@
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
+ ## [2.3.0]
6
+
7
+ ### Added
8
+ - Add possibilty to specify target in `.ccios.yml`
9
+
5
10
  ## [2.2.0]
6
11
 
7
12
  ### Added
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ccios (2.2.0)
4
+ ccios (2.3.0)
5
5
  mustache (~> 1.0)
6
6
  rails (~> 5.1)
7
7
  xcodeproj (~> 1.4)
data/README.md CHANGED
@@ -135,6 +135,7 @@ But you could imagine more complex project structures with multiple xcodeproj:
135
135
  ```
136
136
  app:
137
137
  project: MyProject/MyProject.xcodeproj
138
+ target: MyProject # optional
138
139
  presenter:
139
140
  group: Classes/App
140
141
  coordinator:
@@ -142,6 +143,7 @@ app:
142
143
 
143
144
  core:
144
145
  project: MyProjectCore/MyProjectCore.xcodeproj
146
+ target: MyProjectCore # optional
145
147
  interactor:
146
148
  group: MyProjectCore/Interactors
147
149
  repository:
@@ -149,6 +151,7 @@ core:
149
151
 
150
152
  data:
151
153
  project: MyProjectData/MyProjectData.xcodeproj
154
+ target: MyProjectData # optional
152
155
  repository:
153
156
  group: MyProjectData/Sources/Repositories
154
157
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ccios'
3
- s.version = '2.2.0'
3
+ s.version = '2.3.0'
4
4
  s.executables << 'ccios'
5
5
  s.date = '2016-08-03'
6
6
  s.summary = "Clean Code iOS Generator"
@@ -75,30 +75,33 @@ class Config
75
75
  end
76
76
 
77
77
  class AppConfig
78
- attr_reader :project, :presenter, :coordinator
78
+ attr_reader :project, :target, :presenter, :coordinator
79
79
 
80
80
  def initialize(hash)
81
81
  @project = hash["project"]
82
+ @target = hash["target"]
82
83
  @presenter = ObjectConfig.new hash["presenter"]
83
84
  @coordinator = ObjectConfig.new hash["coordinator"]
84
85
  end
85
86
  end
86
87
 
87
88
  class CoreConfig
88
- attr_reader :project, :interactor, :repository
89
+ attr_reader :project, :target, :interactor, :repository
89
90
 
90
91
  def initialize(hash)
91
92
  @project = hash["project"]
93
+ @target = hash["target"]
92
94
  @interactor = ObjectConfig.new hash["interactor"]
93
95
  @repository = ObjectConfig.new hash["repository"]
94
96
  end
95
97
  end
96
98
 
97
99
  class DataConfig
98
- attr_reader :project, :repository
100
+ attr_reader :project, :target, :repository
99
101
 
100
102
  def initialize(hash)
101
103
  @project = hash["project"]
104
+ @target = hash["target"]
102
105
  @repository = ObjectConfig.new hash["repository"]
103
106
  end
104
107
  end
@@ -48,15 +48,15 @@ class PBXProjParser
48
48
  end
49
49
 
50
50
  def app_target
51
- app_project.targets.first
51
+ target_for(app_project, @config.app.target)
52
52
  end
53
53
 
54
54
  def core_target
55
- core_project.targets.first
55
+ target_for(core_project, @config.core.target)
56
56
  end
57
57
 
58
58
  def data_target
59
- data_project.targets.first
59
+ target_for(data_project, @config.data.target)
60
60
  end
61
61
 
62
62
  def save
@@ -75,4 +75,12 @@ class PBXProjParser
75
75
  end
76
76
  @projects[module_project_path] ||= Xcodeproj::Project.open(resolved_module_project_path)
77
77
  end
78
+
79
+ def target_for(project, target_name)
80
+ if target_name.blank?
81
+ project.targets.find { |t| t.product_type == "com.apple.product-type.application" }
82
+ else
83
+ project.targets.find { |t| t.name == target_name }
84
+ end
85
+ end
78
86
  end
@@ -8,6 +8,6 @@
8
8
 
9
9
  import Foundation
10
10
 
11
- protocol {{name}}Interactor {
11
+ public protocol {{name}}Interactor {
12
12
  func execute()
13
13
  }
@@ -1,4 +1,4 @@
1
- container.register({{name}}Interactor.self) { r in
1
+ container.register({{name}}Interactor.self) { _ in
2
2
  {{name}}InteractorImplementation(
3
3
 
4
4
  )
@@ -8,11 +8,15 @@
8
8
 
9
9
  import Foundation
10
10
 
11
- class {{name}}InteractorImplementation: {{name}}Interactor {
11
+ public class {{name}}InteractorImplementation: {{name}}Interactor {
12
+
13
+ public init() {
14
+
15
+ }
12
16
 
13
17
  // MARK: - {{name}}Interactor
14
18
 
15
- func execute() {
19
+ public func execute() {
16
20
 
17
21
  }
18
22
  }
@@ -8,6 +8,6 @@
8
8
 
9
9
  import Foundation
10
10
 
11
- protocol {{name}}Repository {
11
+ public protocol {{name}}Repository {
12
12
 
13
13
  }
@@ -1,5 +1,6 @@
1
- container.register({{name}}Repository.self) { r in
1
+ container.register({{name}}Repository.self) { _ in
2
2
  {{name}}RepositoryImplementation(
3
3
 
4
4
  )
5
- }.inObjectScope(.container)
5
+ }
6
+ .inObjectScope(.container)
@@ -9,9 +9,9 @@
9
9
 
10
10
  import Foundation
11
11
 
12
- class {{name}}RepositoryImplementation: {{name}}Repository {
12
+ public class {{name}}RepositoryImplementation: {{name}}Repository {
13
13
 
14
- init() {
14
+ public init() {
15
15
 
16
16
  }
17
17
 
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.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Felgines