Skip to content

Commit b829fee

Browse files
committed
Merge pull request #36 from Swinject/sort_into_folders
2 parents 3956dd8 + 3e647cc commit b829fee

26 files changed

+65
-112
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ install:
77
- pod setup
88
- pod install --project-directory=ExampleProject/CodeGenerationExample
99
script:
10-
- ruby test.rb
10+
- ruby -X Tests test.rb
1111
- scan --scheme CodeGenerationExample --workspace ExampleProject/CodeGenerationExample/CodeGenerationExample.xcworkspace
1212
rvm:
1313
- 2.0

ExampleScript/generateCode.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#/bin/sh
2-
../swinject_codegen -i example.csv -o containerExtension.swift
3-
../swinject_codegen -i example.yml -o containerExtension2.swift
4-
../swinject_codegen -i example.csv -c -o example.csv.yml
5-
../swinject_codegen -i example.yml -c -o example.yml.csv
6-
../swinject_codegen -i example.csv -m
7-
../swinject_codegen -i example.yml -m
8-
../swinject_codegen -i example.csv.yml -o containerExtension3.swift
9-
../swinject_codegen -i example.yml.csv -o containerExtension4.swift
2+
../codegen/swinject_codegen -i example.csv -o containerExtension.swift
3+
../codegen/swinject_codegen -i example.yml -o containerExtension2.swift
4+
../codegen/swinject_codegen -i example.csv -c -o example.csv.yml
5+
../codegen/swinject_codegen -i example.yml -c -o example.yml.csv
6+
../codegen/swinject_codegen -i example.csv -m
7+
../codegen/swinject_codegen -i example.yml -m
8+
../codegen/swinject_codegen -i example.csv.yml -o containerExtension3.swift
9+
../codegen/swinject_codegen -i example.yml.csv -o containerExtension4.swift

README.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -109,50 +109,50 @@ Example for a .yml definition:
109109
:DEPENDENCIES:
110110
- ADependency
111111
:DEFINITIONS:
112-
- :baseClass: PersonType
113-
:targetClass: InjectablePerson
114-
:targetClassName: InjectablePerson
112+
- :base_class: PersonType
113+
:target_class: InjectablePerson
114+
:target_class_name: InjectablePerson
115115
:name: initializer
116-
- :baseClass: PersonType
117-
:targetClass: InjectablePerson
118-
:targetClassName: InjectablePerson
119-
- :baseClass: PersonType
120-
:targetClass: PersonType
121-
:targetClassName: PersonType
122-
- :baseClass: AnotherPersonType
123-
:targetClass: AnotherPersonType
124-
:targetClassName: AnotherPersonType
125-
- :baseClass: PersonType
126-
:targetClass: InjectablePerson
127-
:targetClassName: InjectablePerson
116+
- :base_class: PersonType
117+
:target_class: InjectablePerson
118+
:target_class_name: InjectablePerson
119+
- :base_class: PersonType
120+
:target_class: PersonType
121+
:target_class_name: PersonType
122+
- :base_class: AnotherPersonType
123+
:target_class: AnotherPersonType
124+
:target_class_name: AnotherPersonType
125+
- :base_class: PersonType
126+
:target_class: InjectablePerson
127+
:target_class_name: InjectablePerson
128128
:arguments:
129-
- :argumentName: argumentName
130-
:argumentType: ArgumentType
131-
- :baseClass: PersonType
132-
:targetClass: InjectablePerson
133-
:targetClassName: InjectablePerson
129+
- :argument_name: argument_name
130+
:argument_type: argument_type
131+
- :base_class: PersonType
132+
:target_class: InjectablePerson
133+
:target_class_name: InjectablePerson
134134
:arguments:
135-
- :argumentName: argumentName
136-
:argumentType: ArgumentType
137-
- :argumentName: argumenttypewithoutspecificname
138-
:argumentType: ArgumentTypeWithoutSpecificName
139-
- :argumentName: title
140-
:argumentType: String
141-
- :argumentName: string
142-
:argumentType: String
143-
- :baseClass: PersonType
144-
:targetClass: InjectablePerson
145-
:targetClassName: InjectablePerson
135+
- :argument_name: argument_name
136+
:argument_type: argument_type
137+
- :argument_name: argument_typewithoutspecificname
138+
:argument_type: argument_typeWithoutSpecificName
139+
- :argument_name: title
140+
:argument_type: String
141+
- :argument_name: string
142+
:argument_type: String
143+
- :base_class: PersonType
144+
:target_class: InjectablePerson
145+
:target_class_name: InjectablePerson
146146
:name: initializer
147147
:arguments:
148-
- :argumentName: argumentName
149-
:argumentType: ArgumentType
150-
- :argumentName: argumenttypewithoutspecificname
151-
:argumentType: ArgumentTypeWithoutSpecificName
152-
- :argumentName: title
153-
:argumentType: String
154-
- :argumentName: string
155-
:argumentType: String
148+
- :argument_name: argument_name
149+
:argument_type: argument_type
150+
- :argument_name: argument_typewithoutspecificname
151+
:argument_type: argument_typeWithoutSpecificName
152+
- :argument_name: title
153+
:argument_type: String
154+
- :argument_name: string
155+
:argument_type: String
156156
```
157157
158158
## Generation Examples

README.erb renamed to Support/README.erb

Lines changed: 13 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -105,54 +105,7 @@ Empty lines are ignored and can be used for grouping.
105105

106106
Example for a .yml definition:
107107
```yml
108-
---
109-
:DEPENDENCIES:
110-
- ADependency
111-
:DEFINITIONS:
112-
- :baseClass: PersonType
113-
:targetClass: InjectablePerson
114-
:targetClassName: InjectablePerson
115-
:name: initializer
116-
- :baseClass: PersonType
117-
:targetClass: InjectablePerson
118-
:targetClassName: InjectablePerson
119-
- :baseClass: PersonType
120-
:targetClass: PersonType
121-
:targetClassName: PersonType
122-
- :baseClass: AnotherPersonType
123-
:targetClass: AnotherPersonType
124-
:targetClassName: AnotherPersonType
125-
- :baseClass: PersonType
126-
:targetClass: InjectablePerson
127-
:targetClassName: InjectablePerson
128-
:arguments:
129-
- :argumentName: argumentName
130-
:argumentType: ArgumentType
131-
- :baseClass: PersonType
132-
:targetClass: InjectablePerson
133-
:targetClassName: InjectablePerson
134-
:arguments:
135-
- :argumentName: argumentName
136-
:argumentType: ArgumentType
137-
- :argumentName: argumenttypewithoutspecificname
138-
:argumentType: ArgumentTypeWithoutSpecificName
139-
- :argumentName: title
140-
:argumentType: String
141-
- :argumentName: string
142-
:argumentType: String
143-
- :baseClass: PersonType
144-
:targetClass: InjectablePerson
145-
:targetClassName: InjectablePerson
146-
:name: initializer
147-
:arguments:
148-
- :argumentName: argumentName
149-
:argumentType: ArgumentType
150-
- :argumentName: argumenttypewithoutspecificname
151-
:argumentType: ArgumentTypeWithoutSpecificName
152-
- :argumentName: title
153-
:argumentType: String
154-
- :argumentName: string
155-
:argumentType: String
108+
<%= File.read("../ExampleScript/example.yml").chomp %>
156109
```
157110

158111
## Generation Examples
@@ -162,71 +115,71 @@ Example for a .yml definition:
162115

163116
#### Input
164117
```CSV
165-
<%= File.read("ReadmeExamples/ExampleA.csv").chomp %>
118+
<%= File.read("../Tests/Examples/ExampleA.csv").chomp %>
166119
```
167120

168121
#### Output
169122
```Swift
170-
<%= %x(./swinject_codegen -i ReadmeExamples/ExampleA.csv).chomp %>
123+
<%= %x(./../codegen/swinject_codegen -i ../Tests/Examples/ExampleA.csv).chomp %>
171124
```
172125

173126
### Example B: Different source and target
174127

175128
#### Input
176129
```CSV
177-
<%= File.read("ReadmeExamples/ExampleB.csv").chomp %>
130+
<%= File.read("../Tests/Examples/ExampleB.csv").chomp %>
178131
```
179132

180133
#### Output
181134
```Swift
182-
<%= %x(./swinject_codegen -i ReadmeExamples/ExampleB.csv).chomp %>
135+
<%= %x(./../codegen/swinject_codegen -i ../Tests/Examples/ExampleB.csv).chomp %>
183136
```
184137

185138
### Example C: Different source and target class with name
186139

187140
#### Input
188141
```CSV
189-
<%= File.read("ReadmeExamples/ExampleC.csv").chomp %>
142+
<%= File.read("../Tests/Examples/ExampleC.csv").chomp %>
190143
```
191144

192145
#### Output
193146
```Swift
194-
<%= %x(./swinject_codegen -i ReadmeExamples/ExampleC.csv).chomp %>
147+
<%= %x(./../codegen/swinject_codegen -i ../Tests/Examples/ExampleC.csv).chomp %>
195148
```
196149

197150
### Example D: Different source and target with a single, explicitly named argument
198151
#### Input
199152
```CSV
200-
<%= File.read("ReadmeExamples/ExampleD.csv").chomp %>
153+
<%= File.read("../Tests/Examples/ExampleD.csv").chomp %>
201154
```
202155

203156
#### Output
204157
```Swift
205-
<%= %x(./swinject_codegen -i ReadmeExamples/ExampleD.csv).chomp %>
158+
<%= %x(./../codegen/swinject_codegen -i ../Tests/Examples/ExampleD.csv).chomp %>
206159
```
207160

208161
### Example E: Different source and target with multiple arguments, both explicitly named and not
209162
If no explicit name is given, the lowercase type is used as argumentname.
210163

211164
#### Input
212165
```CSV
213-
<%= File.read("ReadmeExamples/ExampleE.csv").chomp %>
166+
<%= File.read("../Tests/Examples/ExampleE.csv").chomp %>
214167
```
215168

216169
#### Output
217170
```Swift
218-
<%= %x(./swinject_codegen -i ReadmeExamples/ExampleE.csv).chomp %>
171+
<%= %x(./../codegen/swinject_codegen -i ../Tests/Examples/ExampleE.csv).chomp %>
219172
```
220173

221174
### Example F: Different source and target with name with multiple arguments, both explicitly named and not
222175
#### Input
223176
```CSV
224-
<%= File.read("ReadmeExamples/ExampleF.csv").chomp %>
177+
<%= File.read("../Tests/Examples/ExampleF.csv").chomp %>
225178
```
226179

227180
#### Output
228181
```Swift
229-
<%= %x(./swinject_codegen -i ReadmeExamples/ExampleF.csv).chomp %>
182+
<%= %x(./../codegen/swinject_codegen -i ../Tests/Examples/ExampleF.csv).chomp %>
230183
```
231184

232185
## Usage Examples

Support/updateReadme.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#/bin/sh
2+
erb Readme.erb > ../Readme.md

0 commit comments

Comments
 (0)