vipergeng 0.2.8 → 0.2.9
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 +4 -4
- data/lib/templates/default/swift/DataManager/API/VIPERAPIDataManager.swift +6 -4
- data/lib/templates/default/swift/DataManager/Local/VIPERLocalDataManager.swift +6 -4
- data/lib/templates/default/swift/Interactor/VIPERInteractor.swift +8 -5
- data/lib/templates/default/swift/Interactor/VIPERItem.swift +6 -4
- data/lib/templates/default/swift/Presenter/VIPERPresenter.swift +7 -5
- data/lib/templates/default/swift/Protocols/VIPERProtocols.swift +9 -10
- data/lib/templates/default/swift/View/VIPERView.swift +6 -4
- data/lib/templates/default/swift/WireFrame/VIPERWireFrame.swift +16 -13
- data/lib/vipergen/generator.rb +3 -3
- data/lib/vipergen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15712c025513c2f63ff424bfeffe884cc53a0d65
|
4
|
+
data.tar.gz: d49eb462b7baa55cfd6e4ca3c8307eb7e532e9eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 674b189163b4ed2a155795de4f58427cc4797697ff1a3248d38627735fc18512bfe33ed4cc00bf337670e20a9d299b495fe3701186610b6df44c28604a003049
|
7
|
+
data.tar.gz: 187b3086c254cc899550979052a752f17111a97b357abdd1576fe2204156a803a341fe669e990676741ae9b74b889612edb220067b7401ef39ea9993aad42617
|
@@ -1,11 +1,13 @@
|
|
1
1
|
//
|
2
|
-
//
|
3
|
-
//
|
2
|
+
// ___FILENAME___.swift
|
3
|
+
// ___PROJECTNAME___
|
4
|
+
//
|
5
|
+
// Created by ___FULLUSERNAME___ on ___DATE___.
|
6
|
+
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
4
7
|
//
|
5
8
|
|
6
9
|
import Foundation
|
7
10
|
|
8
|
-
class VIPERAPIDataManager: VIPERAPIDataManagerInputProtocol
|
9
|
-
{
|
11
|
+
class VIPERAPIDataManager: VIPERAPIDataManagerInputProtocol {
|
10
12
|
init() {}
|
11
13
|
}
|
@@ -1,11 +1,13 @@
|
|
1
1
|
//
|
2
|
-
//
|
3
|
-
//
|
2
|
+
// ___FILENAME___.swift
|
3
|
+
// ___PROJECTNAME___
|
4
|
+
//
|
5
|
+
// Created by ___FULLUSERNAME___ on ___DATE___.
|
6
|
+
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
4
7
|
//
|
5
8
|
|
6
9
|
import Foundation
|
7
10
|
|
8
|
-
class VIPERLocalDataManager: VIPERLocalDataManagerInputProtocol
|
9
|
-
{
|
11
|
+
class VIPERLocalDataManager: VIPERLocalDataManagerInputProtocol {
|
10
12
|
init() {}
|
11
13
|
}
|
@@ -1,15 +1,18 @@
|
|
1
1
|
//
|
2
|
-
//
|
3
|
-
//
|
2
|
+
// ___FILENAME___.swift
|
3
|
+
// ___PROJECTNAME___
|
4
|
+
//
|
5
|
+
// Created by ___FULLUSERNAME___ on ___DATE___.
|
6
|
+
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
4
7
|
//
|
5
8
|
|
6
9
|
import Foundation
|
7
10
|
|
8
|
-
class VIPERInteractor: VIPERInteractorInputProtocol
|
9
|
-
|
11
|
+
class VIPERInteractor: VIPERInteractorInputProtocol {
|
12
|
+
|
10
13
|
weak var presenter: VIPERInteractorOutputProtocol?
|
11
14
|
var APIDataManager: VIPERAPIDataManagerInputProtocol?
|
12
15
|
var localDatamanager: VIPERLocalDataManagerInputProtocol?
|
13
|
-
|
16
|
+
|
14
17
|
init() {}
|
15
18
|
}
|
@@ -1,12 +1,14 @@
|
|
1
1
|
//
|
2
|
-
//
|
3
|
-
//
|
2
|
+
// ___FILENAME___.swift
|
3
|
+
// ___PROJECTNAME___
|
4
|
+
//
|
5
|
+
// Created by ___FULLUSERNAME___ on ___DATE___.
|
6
|
+
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
4
7
|
//
|
5
8
|
|
6
9
|
import Foundation
|
7
10
|
|
8
|
-
struct VIPERItem
|
9
|
-
{
|
11
|
+
struct VIPERItem {
|
10
12
|
/**
|
11
13
|
* Attributes here
|
12
14
|
*/
|
@@ -1,15 +1,17 @@
|
|
1
1
|
//
|
2
|
-
//
|
3
|
-
//
|
2
|
+
// ___FILENAME___.swift
|
3
|
+
// ___PROJECTNAME___
|
4
|
+
//
|
5
|
+
// Created by ___FULLUSERNAME___ on ___DATE___.
|
6
|
+
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
4
7
|
//
|
5
8
|
|
6
9
|
import Foundation
|
7
10
|
|
8
|
-
class VIPERPresenter: VIPERPresenterProtocol, VIPERInteractorOutputProtocol
|
9
|
-
{
|
11
|
+
class VIPERPresenter: VIPERPresenterProtocol, VIPERInteractorOutputProtocol {
|
10
12
|
weak var view: VIPERViewProtocol?
|
11
13
|
var interactor: VIPERInteractorInputProtocol?
|
12
14
|
var wireFrame: VIPERWireFrameProtocol?
|
13
|
-
|
15
|
+
|
14
16
|
init() {}
|
15
17
|
}
|
@@ -1,28 +1,28 @@
|
|
1
1
|
//
|
2
|
-
//
|
3
|
-
//
|
2
|
+
// ___FILENAME___.swift
|
3
|
+
// ___PROJECTNAME___
|
4
|
+
//
|
5
|
+
// Created by ___FULLUSERNAME___ on ___DATE___.
|
6
|
+
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
4
7
|
//
|
5
8
|
|
6
9
|
import Foundation
|
7
10
|
|
8
|
-
protocol VIPERViewProtocol: class
|
9
|
-
{
|
11
|
+
protocol VIPERViewProtocol: class {
|
10
12
|
var presenter: VIPERPresenterProtocol? { get set }
|
11
13
|
/**
|
12
14
|
* Add here your methods for communication PRESENTER -> VIEW
|
13
15
|
*/
|
14
16
|
}
|
15
17
|
|
16
|
-
protocol VIPERWireFrameProtocol: class
|
17
|
-
{
|
18
|
+
protocol VIPERWireFrameProtocol: class {
|
18
19
|
static func presentVIPERModule(fromView view: AnyObject)
|
19
20
|
/**
|
20
21
|
* Add here your methods for communication PRESENTER -> WIREFRAME
|
21
22
|
*/
|
22
23
|
}
|
23
24
|
|
24
|
-
protocol VIPERPresenterProtocol: class
|
25
|
-
{
|
25
|
+
protocol VIPERPresenterProtocol: class {
|
26
26
|
var view: VIPERViewProtocol? { get set }
|
27
27
|
var interactor: VIPERInteractorInputProtocol? { get set }
|
28
28
|
var wireFrame: VIPERWireFrameProtocol? { get set }
|
@@ -31,8 +31,7 @@ protocol VIPERPresenterProtocol: class
|
|
31
31
|
*/
|
32
32
|
}
|
33
33
|
|
34
|
-
protocol VIPERInteractorOutputProtocol: class
|
35
|
-
{
|
34
|
+
protocol VIPERInteractorOutputProtocol: class {
|
36
35
|
/**
|
37
36
|
* Add here your methods for communication INTERACTOR -> PRESENTER
|
38
37
|
*/
|
@@ -1,12 +1,14 @@
|
|
1
1
|
//
|
2
|
-
//
|
3
|
-
//
|
2
|
+
// ___FILENAME___.swift
|
3
|
+
// ___PROJECTNAME___
|
4
|
+
//
|
5
|
+
// Created by ___FULLUSERNAME___ on ___DATE___.
|
6
|
+
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
4
7
|
//
|
5
8
|
|
6
9
|
import Foundation
|
7
10
|
import UIKit
|
8
11
|
|
9
|
-
class
|
10
|
-
{
|
12
|
+
class VIPERViewController: UIViewController, VIPERViewProtocol {
|
11
13
|
var presenter: VIPERPresenterProtocol?
|
12
14
|
}
|
@@ -1,22 +1,25 @@
|
|
1
1
|
//
|
2
|
-
//
|
3
|
-
//
|
2
|
+
// ___FILENAME___.swift
|
3
|
+
// ___PROJECTNAME___
|
4
|
+
//
|
5
|
+
// Created by ___FULLUSERNAME___ on ___DATE___.
|
6
|
+
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
4
7
|
//
|
5
8
|
|
6
9
|
import Foundation
|
7
10
|
|
8
|
-
class VIPERWireFrame: VIPERWireFrameProtocol
|
9
|
-
|
10
|
-
static func presentVIPERModule(fromView
|
11
|
-
|
11
|
+
class VIPERWireFrame: VIPERWireFrameProtocol {
|
12
|
+
|
13
|
+
static func presentVIPERModule(fromView: AnyObject) {
|
14
|
+
|
12
15
|
// Generating module components
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
let view: VIPERViewProtocol = VIPERViewController()
|
17
|
+
let presenter: VIPERPresenterProtocol & VIPERInteractorOutputProtocol = VIPERPresenter()
|
18
|
+
let interactor: VIPERInteractorInputProtocol = VIPERInteractor()
|
19
|
+
let APIDataManager: VIPERAPIDataManagerInputProtocol = VIPERAPIDataManager()
|
20
|
+
let localDataManager: VIPERLocalDataManagerInputProtocol = VIPERLocalDataManager()
|
21
|
+
let wireFrame: VIPERWireFrameProtocol = VIPERWireFrame()
|
22
|
+
|
20
23
|
// Connecting
|
21
24
|
view.presenter = presenter
|
22
25
|
presenter.view = view
|
data/lib/vipergen/generator.rb
CHANGED
@@ -4,9 +4,9 @@ module Vipergen
|
|
4
4
|
# Constants
|
5
5
|
LANGUAGES = ["swift", "objc"]
|
6
6
|
REPLACEMENT_KEY = "VIPER"
|
7
|
-
AUTHOR_REPLACEMENT_KEY = "
|
8
|
-
YEAR_REPLACEMENT_KEY = "
|
9
|
-
|
7
|
+
AUTHOR_REPLACEMENT_KEY = "___FULLUSERNAME___"
|
8
|
+
YEAR_REPLACEMENT_KEY = "___YEAR___"
|
9
|
+
COMPANY_REPLACEMENT_KEY = "___ORGANIZATIONNAME___"
|
10
10
|
|
11
11
|
# Main method that generate the VIPER files structure
|
12
12
|
def self.generate_viper(template, language, name, path, author, company)
|
data/lib/vipergen/version.rb
CHANGED