vipergeng 1.0.2 → 1.0.4
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/README.md +5 -1
- data/lib/templates/default/objc/DataManager/API/VIPERAPIDataManager.h +5 -2
- data/lib/templates/default/objc/DataManager/API/VIPERAPIDataManager.m +5 -2
- data/lib/templates/default/objc/DataManager/Local/VIPERLocalDataManager.h +5 -2
- data/lib/templates/default/objc/DataManager/Local/VIPERLocalDataManager.m +5 -2
- data/lib/templates/default/objc/Interactor/VIPERInteractor.h +5 -2
- data/lib/templates/default/objc/Interactor/VIPERInteractor.m +5 -2
- data/lib/templates/default/objc/Interactor/VIPERItem.h +5 -2
- data/lib/templates/default/objc/Interactor/VIPERItem.m +5 -2
- data/lib/templates/default/objc/Presenter/VIPERPresenter.h +5 -2
- data/lib/templates/default/objc/Presenter/VIPERPresenter.m +5 -2
- data/lib/templates/default/objc/Protocols/VIPERProtocols.h +5 -2
- data/lib/templates/default/objc/ViewController/VIPERViewController.h +17 -0
- data/lib/templates/default/objc/{View/VIPERView.m → ViewController/VIPERViewController.m} +18 -9
- data/lib/templates/default/objc/ViewController/VIPERViewController.xib +20 -0
- data/lib/templates/default/objc/WireFrame/VIPERWireFrame.h +6 -4
- data/lib/templates/default/objc/WireFrame/VIPERWireFrame.m +6 -3
- data/lib/templates/default/swift/ViewController/VIPERViewController.xib +20 -0
- data/lib/templates/default/swift/WireFrame/VIPERWireFrame.swift +14 -19
- data/lib/vipergen/generator.rb +6 -2
- data/lib/vipergen/version.rb +1 -1
- data/lib/vipergen/viperthor.rb +4 -3
- metadata +6 -4
- data/lib/templates/default/objc/View/VIPERView.h +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 341bf3e61b4234ca54d323b804a0cc239180cb4c
|
4
|
+
data.tar.gz: b3823c34a8c2254759093c9e6630b38e680b0a44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ff987fbf1e92eb0a6483c8d744dc2e6fab7b05ee3a113a0ef3e68a15f9291fd847e6cd2f8c76db713750ba42b2868558f929f0192d58265333424a837d5813f
|
7
|
+
data.tar.gz: 618c262b5ed0f73f54c99790b38234b168a8cef26942bfe9214f750eebb8453d829cdfcebf49756fa59783e52fe7f68ac199bb3c210883e248f6906e77726245
|
data/README.md
CHANGED
@@ -33,6 +33,10 @@ The implementation scheme returned by this generator is hardly inspired in the e
|
|
33
33
|
- g command 추가.
|
34
34
|
- generate or g 사용시 --path 인자를 지정하지 않으면 현재 폴더에 생성하도록 수정
|
35
35
|
|
36
|
+
### Changelog 1.0.2
|
37
|
+
- g/generate command에 --base 추가. base에는 ViewController의 base class를 지정한다. 디폴트값은 UIViewController이다.
|
38
|
+
- ViewController 소스에 viewWill/DidAppear, viewWill/DidDisappear 추가
|
39
|
+
|
36
40
|
## Viper files structure
|
37
41
|
```bash
|
38
42
|
.swift
|
@@ -69,7 +73,7 @@ vipergeng g MyFirstViperModule
|
|
69
73
|
```
|
70
74
|
Another example:
|
71
75
|
```bash
|
72
|
-
vipergeng generate MySecondViperModule --path=~/myproject/shared --author='My Name' --company='My Company' --project='project name'
|
76
|
+
vipergeng generate MySecondViperModule --path=~/myproject/shared --author='My Name' --company='My Company' --project='project name --base=MyBaseViewController'
|
73
77
|
```
|
74
78
|
|
75
79
|
And then the files structure will be automatically created. Don't forget to add this folder to your project dragging it into the XCode/Appcode inspector
|
@@ -1,6 +1,9 @@
|
|
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/Foundation.h>
|
@@ -1,6 +1,9 @@
|
|
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 "VIPERAPIDataManager.h"
|
@@ -1,6 +1,9 @@
|
|
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/Foundation.h>
|
@@ -1,6 +1,9 @@
|
|
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 "VIPERLocalDataManager.h"
|
@@ -1,6 +1,9 @@
|
|
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/Foundation.h>
|
@@ -1,6 +1,9 @@
|
|
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 "VIPERInteractor.h"
|
@@ -1,6 +1,9 @@
|
|
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/Foundation.h>
|
@@ -1,6 +1,9 @@
|
|
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 "VIPERItem.h"
|
@@ -1,6 +1,9 @@
|
|
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/Foundation.h>
|
@@ -1,6 +1,9 @@
|
|
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 "VIPERPresenter.h"
|
@@ -1,6 +1,9 @@
|
|
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/Foundation.h>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
//
|
2
|
+
// ___FILENAME___.swift
|
3
|
+
// ___PROJECTNAME___
|
4
|
+
//
|
5
|
+
// Created by ___FULLUSERNAME___ on ___DATE___.
|
6
|
+
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <UIKit/UIKit.h>
|
10
|
+
#import "VIPERProtocols.h"
|
11
|
+
#import "_BASE_VIEW_CONTROLLER_.h"
|
12
|
+
|
13
|
+
@interface VIPERViewController : _BASE_VIEW_CONTROLLER_<VIPERViewProtocol>
|
14
|
+
|
15
|
+
@property (nonatomic, strong) id <VIPERPresenterProtocol> presenter;
|
16
|
+
|
17
|
+
@end
|
@@ -1,11 +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
|
-
#import "
|
9
|
+
#import "VIPERViewController.h"
|
7
10
|
|
8
|
-
@implementation
|
11
|
+
@implementation VIPERViewController
|
9
12
|
|
10
13
|
#pragma mark - ViewController Lifecycle
|
11
14
|
|
@@ -14,11 +17,6 @@
|
|
14
17
|
[super viewDidLoad];
|
15
18
|
}
|
16
19
|
|
17
|
-
- (void)viewDidDisappear:(BOOL)animated
|
18
|
-
{
|
19
|
-
[super viewDidDisappear:animated];
|
20
|
-
}
|
21
|
-
|
22
20
|
- (void)viewWillAppear:(BOOL)animated
|
23
21
|
{
|
24
22
|
[super viewWillAppear:animated];
|
@@ -29,4 +27,15 @@
|
|
29
27
|
[super viewWillDisappear:animated];
|
30
28
|
}
|
31
29
|
|
30
|
+
- (void)viewDidAppear:(BOOL)animated
|
31
|
+
{
|
32
|
+
[super viewDidAppear:animated];
|
33
|
+
}
|
34
|
+
|
35
|
+
- (void)viewDidDisappear:(BOOL)animated
|
36
|
+
{
|
37
|
+
[super viewDidDisappear:animated];
|
38
|
+
}
|
39
|
+
|
40
|
+
|
32
41
|
@end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
3
|
+
<dependencies>
|
4
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
|
5
|
+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
6
|
+
</dependencies>
|
7
|
+
<objects>
|
8
|
+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VIPERViewController" customModuleProvider="target">
|
9
|
+
<connections>
|
10
|
+
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
11
|
+
</connections>
|
12
|
+
</placeholder>
|
13
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
14
|
+
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
15
|
+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
16
|
+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
17
|
+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
18
|
+
</view>
|
19
|
+
</objects>
|
20
|
+
</document>
|
@@ -1,16 +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/Foundation.h>
|
7
10
|
#import "VIPERProtocols.h"
|
8
|
-
#import "
|
11
|
+
#import "VIPERViewController.h"
|
9
12
|
#import "VIPERLocalDataManager.h"
|
10
13
|
#import "VIPERAPIDataManager.h"
|
11
14
|
#import "VIPERInteractor.h"
|
12
15
|
#import "VIPERPresenter.h"
|
13
|
-
#import "VIPERWireframe.h"
|
14
16
|
#import <UIKit/UIKit.h>
|
15
17
|
|
16
18
|
@interface VIPERWireFrame : NSObject <VIPERWireFrameProtocol>
|
@@ -1,6 +1,9 @@
|
|
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 "VIPERWireFrame.h"
|
@@ -10,7 +13,7 @@
|
|
10
13
|
+ (void)presentVIPERModuleFrom:(UIViewController*)fromViewController
|
11
14
|
{
|
12
15
|
// Generating module components
|
13
|
-
id <VIPERViewProtocol> view = [[
|
16
|
+
id <VIPERViewProtocol> view = [[VIPERViewController alloc] initWithNibName:@"VIPERViewController" bundle:nil];
|
14
17
|
id <VIPERPresenterProtocol, VIPERInteractorOutputProtocol> presenter = [VIPERPresenter new];
|
15
18
|
id <VIPERInteractorInputProtocol> interactor = [VIPERInteractor new];
|
16
19
|
id <VIPERAPIDataManagerInputProtocol> APIDataManager = [VIPERAPIDataManager new];
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
3
|
+
<dependencies>
|
4
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
|
5
|
+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
6
|
+
</dependencies>
|
7
|
+
<objects>
|
8
|
+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VIPERViewController" customModuleProvider="target">
|
9
|
+
<connections>
|
10
|
+
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
11
|
+
</connections>
|
12
|
+
</placeholder>
|
13
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
14
|
+
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
15
|
+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
16
|
+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
17
|
+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
18
|
+
</view>
|
19
|
+
</objects>
|
20
|
+
</document>
|
@@ -13,26 +13,21 @@ class VIPERWireFrame: VIPERWireFrameProtocol {
|
|
13
13
|
static func presentVIPERModule(fromVC: UIViewController) {
|
14
14
|
|
15
15
|
// Generating module components
|
16
|
-
let
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
let wireFrame: VIPERWireFrameProtocol = VIPERWireFrame()
|
16
|
+
let view = VIPERViewController(nibName: "VIPERViewController", bundle: nil)
|
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()
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
23
|
+
// Connecting
|
24
|
+
view.presenter = presenter
|
25
|
+
presenter.view = view
|
26
|
+
presenter.wireFrame = wireFrame
|
27
|
+
presenter.interactor = interactor
|
28
|
+
interactor.presenter = presenter
|
29
|
+
interactor.APIDataManager = APIDataManager
|
30
|
+
interactor.localDatamanager = localDataManager
|
33
31
|
}
|
34
32
|
|
35
|
-
static var storyboard: UIStoryboard {
|
36
|
-
return UIStoryboard(name: "Main", bundle: Bundle.main)
|
37
|
-
}
|
38
33
|
}
|
data/lib/vipergen/generator.rb
CHANGED
@@ -10,7 +10,8 @@ module Vipergen
|
|
10
10
|
PROJECT_REPLACEMENT_KEY = "___PROJECTNAME___"
|
11
11
|
FILE_REPLACEMENT_KEY= "___FILENAME___"
|
12
12
|
DATE_REPLACEMENT_KEY= "___DATE___"
|
13
|
-
|
13
|
+
BASE_VC_REPLACEMENT_KEY= "_BASE_VIEW_CONTROLLER_"
|
14
|
+
BASE_VC_IMPORT_REPLACE_KEY = '#import "_BASE_VIEW_CONTROLLER_.h"'
|
14
15
|
|
15
16
|
# Main method that generate the VIPER files structure
|
16
17
|
def self.generate_viper(template, language, name, path, author, company, project, baseviewcontroller)
|
@@ -66,7 +67,10 @@ module Vipergen
|
|
66
67
|
content = content.gsub((Vipergen::Generator::FILE_REPLACEMENT_KEY), File.basename(filename,File.extname(filename)))
|
67
68
|
str = '%02d/%02d/%02d' % [Time.new.day, Time.new.month, Time.new.year%100]
|
68
69
|
content = content.gsub((Vipergen::Generator::DATE_REPLACEMENT_KEY), str)
|
69
|
-
|
70
|
+
if baseviewcontroller == 'UIViewController' then
|
71
|
+
content = content.gsub((Vipergen::Generator::BASE_VC_IMPORT_REPLACE_KEY), '')
|
72
|
+
end
|
73
|
+
content = content.gsub((Vipergen::Generator::BASE_VC_REPLACEMENT_KEY), baseviewcontroller)
|
70
74
|
|
71
75
|
# Saving content with replaced string
|
72
76
|
File.open(filename, "w+") do |file|
|
data/lib/vipergen/version.rb
CHANGED
data/lib/vipergen/viperthor.rb
CHANGED
@@ -4,7 +4,7 @@ require 'vipergen'
|
|
4
4
|
module Vipergen
|
5
5
|
class ViperThor < Thor
|
6
6
|
desc "generate MODULE", "Generate a VIPER module"
|
7
|
-
|
7
|
+
option :language, :required => false, :default => 'swift', :type => :string, :desc => "The language of the generated module (swift, objc)"
|
8
8
|
option :template, :required => false, :default => 'default', :type => :string , :desc => "Template for the generation"
|
9
9
|
option :path, :required => false, :default => './', :type => :string , :desc => "Path where the output module is going to be saved"
|
10
10
|
option :author, :required => false, :default => 'AuthorXXX', :type => :string , :desc => "Author to be specified on the file's header. Otherwise VIPER will be used"
|
@@ -12,10 +12,11 @@ module Vipergen
|
|
12
12
|
option :project, :required => false, :default => 'ProjectXXX', :type => :string, :desc => "Project to be specified on the file's header. Otherwise Project will be used"
|
13
13
|
option :base, :required => false, :default => 'UIViewController', :type => :string, :desc => "View Controller의 베이스 클래스 이름"
|
14
14
|
def generate(name)
|
15
|
-
Vipergen::Generator.generate_viper(options[:template],
|
15
|
+
Vipergen::Generator.generate_viper(options[:template], options[:language], name, options[:path], options[:author], options[:company], options[:project], options[:base])
|
16
16
|
end
|
17
17
|
|
18
18
|
desc "g MODULE", "Generate a VIPER module"
|
19
|
+
option :language, :required => false, :default => 'swift', :type => :string, :desc => "The language of the generated module (swift, objc)"
|
19
20
|
option :template, :required => false, :default => 'default', :type => :string , :desc => "Template for the generation"
|
20
21
|
option :path, :required => false, :default => './', :type => :string , :desc => "Path where the output module is going to be saved"
|
21
22
|
option :author, :required => false, :default => 'AuthorXXX', :type => :string , :desc => "Author to be specified on the file's header. Otherwise VIPER will be used"
|
@@ -23,7 +24,7 @@ module Vipergen
|
|
23
24
|
option :project, :required => false, :default => 'ProjectXXX', :type => :string, :desc => "Project to be specified on the file's header. Otherwise Project will be used"
|
24
25
|
option :base, :required => false, :default => 'UIViewController', :type => :string, :desc => "View Controller의 베이스 클래스 이름"
|
25
26
|
def g(name)
|
26
|
-
Vipergen::Generator.generate_viper(options[:template],
|
27
|
+
Vipergen::Generator.generate_viper(options[:template], options[:language], name, options[:path], options[:author], options[:company], options[:project], options[:base])
|
27
28
|
end
|
28
29
|
|
29
30
|
desc "templates", "Get a list of available templates"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vipergeng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Piñera
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -103,8 +103,9 @@ files:
|
|
103
103
|
- lib/templates/default/objc/Presenter/VIPERPresenter.h
|
104
104
|
- lib/templates/default/objc/Presenter/VIPERPresenter.m
|
105
105
|
- lib/templates/default/objc/Protocols/VIPERProtocols.h
|
106
|
-
- lib/templates/default/objc/
|
107
|
-
- lib/templates/default/objc/
|
106
|
+
- lib/templates/default/objc/ViewController/VIPERViewController.h
|
107
|
+
- lib/templates/default/objc/ViewController/VIPERViewController.m
|
108
|
+
- lib/templates/default/objc/ViewController/VIPERViewController.xib
|
108
109
|
- lib/templates/default/objc/WireFrame/VIPERWireFrame.h
|
109
110
|
- lib/templates/default/objc/WireFrame/VIPERWireFrame.m
|
110
111
|
- lib/templates/default/swift/DataManager/API/VIPERAPIDataManager.swift
|
@@ -114,6 +115,7 @@ files:
|
|
114
115
|
- lib/templates/default/swift/Presenter/VIPERPresenter.swift
|
115
116
|
- lib/templates/default/swift/Protocols/VIPERProtocols.swift
|
116
117
|
- lib/templates/default/swift/ViewController/VIPERViewController.swift
|
118
|
+
- lib/templates/default/swift/ViewController/VIPERViewController.xib
|
117
119
|
- lib/templates/default/swift/WireFrame/VIPERWireFrame.swift
|
118
120
|
- lib/templates/default/viperspec.yml
|
119
121
|
- lib/templates/naja/swift/Interactor/VIPERInteractor.swift
|
@@ -1,13 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// Created by AUTHOR
|
3
|
-
// Copyright (c) YEAR AUTHOR. All rights reserved.
|
4
|
-
//
|
5
|
-
|
6
|
-
#import <UIKit/UIKit.h>
|
7
|
-
#import "VIPERProtocols.h"
|
8
|
-
|
9
|
-
@interface VIPERView : UIViewController <VIPERViewProtocol>
|
10
|
-
|
11
|
-
@property (nonatomic, strong) id <VIPERPresenterProtocol> presenter;
|
12
|
-
|
13
|
-
@end
|