blue_printer 0.1.3 → 0.1.5

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 (24) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/VIP Architecture.xctemplate/TemplateIcon.png b/data/Clean Swift → Tests.xctemplate/TemplateIcon.png +0 -0
  4. data/VIP Architecture.xctemplate/TemplateIcon@2x.png b/data/Clean Swift → Tests.xctemplate/TemplateIcon@2x.png +0 -0
  5. data/VIP Architecture.xctemplate/TemplateInfo.plist b/data/Clean Swift → Tests.xctemplate/TemplateInfo.plist +0 -0
  6. data/{VIP Architecture.xctemplate → Clean Swift Tests.xctemplate}/___FILEBASENAME___InteractorTests.swift +7 -9
  7. data/{VIP Architecture.xctemplate → Clean Swift Tests.xctemplate}/___FILEBASENAME___PresenterTests.swift +8 -2
  8. data/{VIP Architecture.xctemplate → Clean Swift Tests.xctemplate}/___FILEBASENAME___ViewControllerTests.swift +8 -2
  9. data/Clean Swift VIP.xctemplate/TemplateIcon.png +0 -0
  10. data/Clean Swift VIP.xctemplate/TemplateIcon@2x.png +0 -0
  11. data/Clean Swift VIP.xctemplate/TemplateInfo.plist +39 -0
  12. data/{VIP Architecture.xctemplate → Clean Swift VIP.xctemplate}/___FILEBASENAME___Interactor.swift +10 -1
  13. data/Clean Swift VIP.xctemplate/___FILEBASENAME___Model.swift +18 -0
  14. data/{VIP Architecture.xctemplate → Clean Swift VIP.xctemplate}/___FILEBASENAME___Presenter.swift +11 -1
  15. data/VIP Architecture.xctemplate/___FILEBASENAME___Router.swift b/data/Clean Swift → VIP.xctemplate/___FILEBASENAME___Router.swift +0 -0
  16. data/{VIP Architecture.xctemplate → Clean Swift VIP.xctemplate}/___FILEBASENAME___ViewController.swift +11 -10
  17. data/VIP Architecture.xctemplate/___FILEBASENAME___ViewController.xib b/data/Clean Swift → VIP.xctemplate/___FILEBASENAME___ViewController.xib +0 -0
  18. data/{VIP Architecture.xctemplate → Clean Swift VIP.xctemplate}/___FILEBASENAME___Worker.swift +4 -3
  19. data/Gemfile.lock +1 -1
  20. data/README.md +3 -3
  21. data/exe/blue_printer +6 -0
  22. data/lib/blue_printer.rb +5 -21
  23. data/lib/blue_printer/version.rb +1 -1
  24. metadata +21 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2533583c71cfe1c73e174069dd79103023a1e19ae99f34647d43935495ca99c6
4
- data.tar.gz: 469fa3056e8fd51b574073c65ac1377ced8c637e31c77fb259f13b01d4ed7103
3
+ metadata.gz: 3f0106f3346cb66ba81d907d08929fc3aa734020910220111ce418c78a185cf1
4
+ data.tar.gz: 19967f4efc8340a9be94b12e50736da30ab8e4f1151a748f252ee77ade72fc65
5
5
  SHA512:
6
- metadata.gz: 0cf7d093f85f89638a916dee656d86f8c38c74a0eb3110ce6ce3aad5f9f1836a4b25085e0c0a6733c212b070079cdbaadf8f7d0aea87578bf506446f0fe22674
7
- data.tar.gz: 8505a5d63840311d41c153c975dd3f7861c8bba0cefedc18f512a2a501c808793d01957a1db3eb3049fac50ad66811698a0d50f9a20928e359f3cbd9a3bb29d2
6
+ metadata.gz: a1f4996b32fc4b9e57307be9d4e5a5f7401176a32ad442de8bf220656d1fd3447f585f84452706e7fc0e2462313c3875c7473620cf0b954c5deb7f4cf909eecc
7
+ data.tar.gz: 9c5805209cb07313ac98ab7ef3bafdef5a31507330183e3ef8c0d5b908b07e3334fa135ba6813923759bd2d41298735a316aaca336c8e156b586669fb06abf3a
data/.DS_Store CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  //___FILEHEADER___
2
2
 
3
3
  import XCTest
4
- @testable import ___PACKAGENAME___
4
+ @testable import ___PROJECTNAME___
5
5
 
6
6
  class ___FILEBASENAMEASIDENTIFIER___: XCTestCase {
7
7
 
@@ -23,24 +23,22 @@ class ___FILEBASENAMEASIDENTIFIER___: XCTestCase {
23
23
  // }
24
24
  }
25
25
 
26
- class WorkerSpy: ___VARIABLE_productName___DataProvidable {
27
-
28
- }
29
-
30
26
  // MARK: - Properties
31
27
  var sut: ___VARIABLE_productName___Interactor!
32
28
  var presenterSpy: PresenterSpy!
33
- var workerSpy: WorkerSpy!
29
+ lazy var moduleConfiguration: ModuleConfiguration = {
30
+ let moduleConfiguration = ModuleConfiguration()
31
+ // moduleConfiguration.add(module: MockAnalyticsService, interface: AnalyticsService.self)
32
+ return moduleConfiguration
33
+ }()
34
34
 
35
35
  // MARK: - Test lifecycle
36
36
  override func setUp() {
37
37
  super.setUp()
38
38
 
39
39
  presenterSpy = PresenterSpy()
40
- workerSpy = WorkerSpy()
41
- sut = ___VARIABLE_productName___Interactor()
40
+ sut = ___VARIABLE_productName___Interactor(moduleConfiguration)
42
41
  sut.presenter = presenterSpy
43
- sut.worker = workerSpy
44
42
  }
45
43
 
46
44
  // MARK: - Tests
@@ -1,7 +1,7 @@
1
1
  //___FILEHEADER___
2
2
 
3
3
  import XCTest
4
- @testable import ___PACKAGENAME___
4
+ @testable import ___PROJECTNAME___
5
5
 
6
6
  class ___FILEBASENAMEASIDENTIFIER___: XCTestCase {
7
7
 
@@ -14,11 +14,17 @@ class ___FILEBASENAMEASIDENTIFIER___: XCTestCase {
14
14
  var sut: ___VARIABLE_productName___Presenter!
15
15
  var viewControllerSpy: ViewControllerSpy!
16
16
 
17
+ lazy var moduleConfiguration: ModuleConfiguration = {
18
+ let moduleConfiguration = ModuleConfiguration()
19
+ // moduleConfiguration.add(module: localizationService, interface: ABNLocalizationService.self)
20
+ return moduleConfiguration
21
+ }()
22
+
17
23
  // MARK: - Test lifecycle
18
24
  override func setUp() {
19
25
  super.setUp()
20
26
  viewControllerSpy = ViewControllerSpy()
21
- sut = ___VARIABLE_productName___Presenter()
27
+ sut = ___VARIABLE_productName___Presenter(moduleConfiguration)
22
28
  sut.viewController = viewControllerSpy
23
29
  }
24
30
 
@@ -1,7 +1,7 @@
1
1
  //___FILEHEADER___
2
2
 
3
3
  import XCTest
4
- @testable import ___PACKAGENAME___
4
+ @testable import ___PROJECTNAME___
5
5
 
6
6
  class ___FILEBASENAMEASIDENTIFIER___: XCTestCase {
7
7
 
@@ -15,6 +15,12 @@ class ___FILEBASENAMEASIDENTIFIER___: XCTestCase {
15
15
  var dataStore: ___VARIABLE_productName___DataStore?
16
16
  }
17
17
 
18
+ let moduleConfiguration: ModuleConfiguration = {
19
+ let config = ModuleConfiguration()
20
+ // moduleConfiguration.add(module: localizationService, interface: ABNLocalizationService.self)
21
+ return config
22
+ }()
23
+
18
24
  // MARK: - Properties
19
25
  var sut: ___VARIABLE_productName___ViewController!
20
26
  var interactorSpy: InteractorSpy!
@@ -25,7 +31,7 @@ class ___FILEBASENAMEASIDENTIFIER___: XCTestCase {
25
31
  super.setUp()
26
32
  interactorSpy = InteractorSpy()
27
33
  routerSpy = RouterSpy()
28
- sut = ___VARIABLE_productName___ViewController()
34
+ sut = ___VARIABLE_productName___ViewController(moduleConfiguration)
29
35
  sut.interactor = interactorSpy
30
36
  sut.router = routerSpy
31
37
  sut.beginAppearanceTransition(true, animated: false)
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>Kind</key>
6
+ <string>Xcode.IDEFoundation.TextSubstitutionFileTemplateKind</string>
7
+ <key>Description</key>
8
+ <string>An empty Swift file.</string>
9
+ <key>Summary</key>
10
+ <string>An empty Swift file</string>
11
+ <key>SortOrder</key>
12
+ <string>30</string>
13
+ <key>AllowedTypes</key>
14
+ <array>
15
+ <string>public.swift-source</string>
16
+ </array>
17
+ <key>DefaultCompletionName</key>
18
+ <string></string>
19
+ <key>MainTemplateFile</key>
20
+ <string>___FILEBASENAME___.swift</string>
21
+ <key>Options</key>
22
+ <array>
23
+ <dict>
24
+ <key>Identifier</key>
25
+ <string>productName</string>
26
+ <key>Required</key>
27
+ <true/>
28
+ <key>Name</key>
29
+ <string>Class:</string>
30
+ <key>Description</key>
31
+ <string>The name of the class to create</string>
32
+ <key>Type</key>
33
+ <string>text</string>
34
+ <key>NotPersisted</key>
35
+ <false/>
36
+ </dict>
37
+ </array>
38
+ </dict>
39
+ </plist>
@@ -14,6 +14,15 @@ class ___FILEBASENAMEASIDENTIFIER___: ___VARIABLE_productName___Interactable, __
14
14
 
15
15
  // MARK: - Properties
16
16
  var presenter: ___VARIABLE_productName___Presentable?
17
- var worker: ___VARIABLE_productName___DataProvidable?
17
+ private let configuration: ModuleConfiguration?
18
18
 
19
+ // MARK: - Services
20
+ // var service: Service? {
21
+ // return configuration?.getModule(Service.self)
22
+ // }
23
+
24
+ // MARK: - Initializer
25
+ init(_ moduleConfiguration: ModuleConfiguration?) {
26
+ self.configuration = moduleConfiguration
27
+ }
19
28
  }
@@ -0,0 +1,18 @@
1
+ //___FILEHEADER___
2
+
3
+ import UIKit
4
+ enum ___VARIABLE_productName___
5
+ {
6
+ enum Something
7
+ {
8
+ struct Request
9
+ {
10
+ }
11
+ struct Response
12
+ {
13
+ }
14
+ struct ViewModel
15
+ {
16
+ }
17
+ }
18
+ }
@@ -10,7 +10,17 @@ class ___FILEBASENAMEASIDENTIFIER___: ___VARIABLE_productName___Presentable {
10
10
 
11
11
  // MARK: - Properties
12
12
  weak var viewController: ___VARIABLE_productName___Displayable?
13
-
13
+ private let moduleConfiguration: ModuleConfiguration!
14
+
15
+ // MARK: - Services
16
+ // private var localizationService: LocalizationService! {
17
+ // return moduleConfiguration.getModule(LocalizationService.self)
18
+ // }
19
+
20
+ // MARK: - Initializers
21
+ init(_ moduleConfiguration: ModuleConfiguration!) {
22
+ self.moduleConfiguration = moduleConfiguration
23
+ }
14
24
  }
15
25
 
16
26
  //extension ___FILEBASENAMEASIDENTIFIER___: LoadingPresentable {
@@ -11,29 +11,30 @@ class ___FILEBASENAMEASIDENTIFIER___: UIViewController, ___VARIABLE_productName_
11
11
  // MARK: - Properties
12
12
  var router: (___VARIABLE_productName___Routable & ___VARIABLE_productName___DataPassing)!
13
13
  var interactor: ___VARIABLE_productName___Interactable!
14
+ private let moduleConfiguration: ModuleConfiguration?
14
15
 
15
16
  // MARK: - Initializers
16
- override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
17
- super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
17
+ init(_ moduleConfiguration: ModuleConfiguration! = ModuleConfiguration.currentConfiguration) {
18
+ self.moduleConfiguration = moduleConfiguration
19
+ super.init(nibName: nil, bundle: nil)
18
20
  setupVIP()
19
21
  }
20
22
 
21
23
  required init?(coder aDecoder: NSCoder) {
22
- super.init(coder: aDecoder)
23
- setupVIP()
24
+ fatalError("init(coder:) has not been implemented")
24
25
  }
25
26
 
26
27
  // MARK: - Setup VIP
27
28
  private func setupVIP() {
28
- let interactor = ___VARIABLE_productName___Interactor()
29
- let presenter = ___VARIABLE_productName___Presenter()
29
+ let interactor = ___VARIABLE_productName___Interactor(moduleConfiguration)
30
+ let presenter = ___VARIABLE_productName___Presenter(moduleConfiguration)
30
31
  let router = ___VARIABLE_productName___Router()
31
- self.interactor = interactor
32
- self.router = router
33
- interactor.presenter = presenter
34
32
  presenter.viewController = self
35
- router.viewController = self
33
+ interactor.presenter = presenter
36
34
  router.dataStore = interactor
35
+ router.viewController = self
36
+ self.interactor = interactor
37
+ self.router = router
37
38
  }
38
39
 
39
40
  // MARK: - Lifecycle
@@ -9,9 +9,10 @@ protocol ___VARIABLE_productName___DataProvidable {
9
9
  class ___FILEBASENAMEASIDENTIFIER___: ___VARIABLE_productName___DataProvidable {
10
10
 
11
11
  // MARK: - Properties
12
-
12
+ private let moduleConfiguration: ModuleConfiguration!
13
+
13
14
  // MARK: - Initializers
14
- init() {
15
-
15
+ init(_ moduleConfiguration: ModuleConfiguration!) {
16
+ self.moduleConfiguration = moduleConfiguration
16
17
  }
17
18
  }
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blue_printer (0.1.3)
4
+ blue_printer (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -6,11 +6,11 @@ TODO: Delete this and the text above, and describe your gem
6
6
 
7
7
  ## Roadmap
8
8
 
9
+ - Add a seperate xctemplate for Tests
10
+ - Create models template file e.g. GuidedInvestmentsOverviewModels.swift (with Analytics, Errors, SceneModel)
11
+ - -Remove 'ios-xcode-templates' from folder path-
9
12
  - -Move it to the right directory-
10
13
  - -Create a *.xctemplate directory-
11
- - Create swift template files
12
- - Create resources
13
- - Fill it with boilerplate code
14
14
 
15
15
  ## Installation
16
16
 
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "blue_printer"
5
+
6
+ BluePrinter.move_to_xcode_template_directory()
@@ -6,32 +6,16 @@ module BluePrinter
6
6
 
7
7
  XCODE_TEMPLATE_PATH = File.join("Library", "Developer", "Xcode", "Templates")
8
8
  TEMPLATE_DIR = File.join(File.expand_path('~'), XCODE_TEMPLATE_PATH)
9
- IOS_TEMPLATE_DIR = File.join(TEMPLATE_DIR, "ios-xcode-templates")
10
- TEMPLATE_NAME = "VIP Architecture.xctemplate"
9
+ TEMPLATE_NAME = "Clean Swift VIP.xctemplate"
10
+ TEMPLATE_NAME_TESTS = "Clean Swift Tests.xctemplate"
11
11
 
12
12
  def self.root
13
13
  File.dirname __dir__
14
14
  end
15
15
 
16
- def self.generate
17
- template_path = "tmp/VIP Architecture.xctemplate"
18
- FileUtils.mkdir_p template_path
19
- [
20
- "Interactor",
21
- "Presenter",
22
- "ViewController",
23
- "InteractorTests",
24
- "PresenterTests",
25
- "ViewControllerTests",
26
- "Router",
27
- "Worker"
28
- ].each do |filename|
29
- File.open("#{template_path}/___FILEBASENAME___#{filename}.swift", "w")
30
- end
31
- end
32
-
33
16
  def self.move_to_xcode_template_directory
34
- FileUtils.mkdir_p IOS_TEMPLATE_DIR
35
- FileUtils.copy_entry File.join(root, TEMPLATE_NAME), File.join(IOS_TEMPLATE_DIR, TEMPLATE_NAME)
17
+ FileUtils.mkdir_p TEMPLATE_DIR
18
+ FileUtils.copy_entry File.join(root, TEMPLATE_NAME), File.join(TEMPLATE_DIR, TEMPLATE_NAME)
19
+ FileUtils.copy_entry File.join(root, TEMPLATE_NAME_TESTS), File.join(TEMPLATE_DIR, TEMPLATE_NAME_TESTS)
36
20
  end
37
21
  end
@@ -1,3 +1,3 @@
1
1
  module BluePrinter
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blue_printer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dunya Kirkali
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-06-24 00:00:00.000000000 Z
12
+ date: 2019-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -85,7 +85,8 @@ description: Will generate xctemplate files for CleanSwift
85
85
  email:
86
86
  - dunyakirkali@gmail.com
87
87
  - devrind@me.com
88
- executables: []
88
+ executables:
89
+ - blue_printer
89
90
  extensions: []
90
91
  extra_rdoc_files: []
91
92
  files:
@@ -94,25 +95,30 @@ files:
94
95
  - ".rspec"
95
96
  - ".travis.yml"
96
97
  - CHANGELOG.md
98
+ - Clean Swift Tests.xctemplate/TemplateIcon.png
99
+ - Clean Swift Tests.xctemplate/TemplateIcon@2x.png
100
+ - Clean Swift Tests.xctemplate/TemplateInfo.plist
101
+ - Clean Swift Tests.xctemplate/___FILEBASENAME___InteractorTests.swift
102
+ - Clean Swift Tests.xctemplate/___FILEBASENAME___PresenterTests.swift
103
+ - Clean Swift Tests.xctemplate/___FILEBASENAME___ViewControllerTests.swift
104
+ - Clean Swift VIP.xctemplate/TemplateIcon.png
105
+ - Clean Swift VIP.xctemplate/TemplateIcon@2x.png
106
+ - Clean Swift VIP.xctemplate/TemplateInfo.plist
107
+ - Clean Swift VIP.xctemplate/___FILEBASENAME___Interactor.swift
108
+ - Clean Swift VIP.xctemplate/___FILEBASENAME___Model.swift
109
+ - Clean Swift VIP.xctemplate/___FILEBASENAME___Presenter.swift
110
+ - Clean Swift VIP.xctemplate/___FILEBASENAME___Router.swift
111
+ - Clean Swift VIP.xctemplate/___FILEBASENAME___ViewController.swift
112
+ - Clean Swift VIP.xctemplate/___FILEBASENAME___ViewController.xib
113
+ - Clean Swift VIP.xctemplate/___FILEBASENAME___Worker.swift
97
114
  - Gemfile
98
115
  - Gemfile.lock
99
116
  - README.md
100
117
  - Rakefile
101
- - VIP Architecture.xctemplate/TemplateIcon.png
102
- - VIP Architecture.xctemplate/TemplateIcon@2x.png
103
- - VIP Architecture.xctemplate/TemplateInfo.plist
104
- - VIP Architecture.xctemplate/___FILEBASENAME___Interactor.swift
105
- - VIP Architecture.xctemplate/___FILEBASENAME___InteractorTests.swift
106
- - VIP Architecture.xctemplate/___FILEBASENAME___Presenter.swift
107
- - VIP Architecture.xctemplate/___FILEBASENAME___PresenterTests.swift
108
- - VIP Architecture.xctemplate/___FILEBASENAME___Router.swift
109
- - VIP Architecture.xctemplate/___FILEBASENAME___ViewController.swift
110
- - VIP Architecture.xctemplate/___FILEBASENAME___ViewController.xib
111
- - VIP Architecture.xctemplate/___FILEBASENAME___ViewControllerTests.swift
112
- - VIP Architecture.xctemplate/___FILEBASENAME___Worker.swift
113
118
  - bin/console
114
119
  - bin/setup
115
120
  - blue_printer.gemspec
121
+ - exe/blue_printer
116
122
  - lib/blue_printer.rb
117
123
  - lib/blue_printer/version.rb
118
124
  homepage: https://p-bitbucket.nl.eu.abnamro.com:7999/users/c44755/repos/blue_printer