mt_tool 0.1.3 → 1.0.0
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/Gemfile +6 -1
- data/README.md +74 -10
- data/Rakefile +14 -1
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/mt_tool/commands.rb +43 -229
- data/lib/mt_tool/module/module.rb +275 -0
- data/lib/mt_tool/module/template/swift/Entity.swift +15 -0
- data/lib/mt_tool/module/template/swift/Interactor.swift +16 -0
- data/lib/mt_tool/module/template/swift/Presenter.swift +28 -0
- data/lib/mt_tool/module/template/swift/Router.swift +50 -0
- data/lib/mt_tool/module/template/swift/ViewController.swift +97 -0
- data/lib/mt_tool/version.rb +1 -1
- data/mt_tool.gemspec +23 -26
- metadata +81 -111
- data/.MTModuleFilesConfig.yml +0 -5
- data/.idea/.gitignore +0 -8
- data/.idea/misc.xml +0 -4
- data/.idea/modules.xml +0 -8
- data/.idea/mt_tool.iml +0 -45
- data/.idea/vcs.xml +0 -7
- data/Gemfile.lock +0 -134
- data/lib/mt_tool/analyze.rb +0 -126
- data/lib/mt_tool/template/objc/Bundle.h +0 -21
- data/lib/mt_tool/template/objc/Bundle.m +0 -28
- data/lib/mt_tool/template/objc/CategoryHeader.h +0 -15
- data/lib/mt_tool/template/objc/PrefixHeader.pch +0 -36
- data/lib/mt_tool/template/objc/RouterDefine.h +0 -14
- data/lib/mt_tool/template/objc/RouterRegister.h +0 -16
- data/lib/mt_tool/template/objc/RouterRegister.m +0 -33
- data/lib/mt_tool/template/objc/ServiceProtocol.h +0 -15
- data/lib/mt_tool/template/objc/ServiceRegister.h +0 -16
- data/lib/mt_tool/template/objc/ServiceRegister.m +0 -25
- data/lib/mt_tool/template/objc/ToolsHeader.h +0 -13
- data/lib/mt_tool/template/objc/VendorHeader.h +0 -13
- data/lib/mt_tool/template/objc/demo/DemoViewController.h +0 -17
- data/lib/mt_tool/template/objc/demo/DemoViewController.m +0 -28
- data/lib/mt_tool/template/objc/demo/DemoViewModel.h +0 -14
- data/lib/mt_tool/template/objc/demo/DemoViewModel.m +0 -19
- data/sig/mt_tool.rbs +0 -4
- /data/lib/mt_tool/{template → module/template}/swift/RouterDefine.swift +0 -0
@@ -1,21 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>Bundle.h
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
|
10
|
-
#import <Foundation/Foundation.h>
|
11
|
-
|
12
|
-
NS_ASSUME_NONNULL_BEGIN
|
13
|
-
|
14
|
-
@interface <%= @prefixed_module %>Bundle : NSObject
|
15
|
-
|
16
|
-
+ (UINib *)bundlerNib:(NSString *)nibName ;
|
17
|
-
+ (NSBundle *)currentBundle;
|
18
|
-
|
19
|
-
@end
|
20
|
-
|
21
|
-
NS_ASSUME_NONNULL_END
|
@@ -1,28 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>Bundle.m
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#import "<%= @prefixed_module %>Bundle.h"
|
10
|
-
|
11
|
-
@implementation <%= @prefixed_module %>Bundle
|
12
|
-
|
13
|
-
+ (UINib *)bundlerNib:(NSString *)nibName {
|
14
|
-
return [UINib nibWithNibName:nibName bundle:[self currentBundle]];
|
15
|
-
}
|
16
|
-
|
17
|
-
+ (NSBundle *)currentBundle {
|
18
|
-
NSString *bundleName = @"<%= @project %>";
|
19
|
-
NSURL *associateBundleURL = [[NSBundle mainBundle] URLForResource:bundleName withExtension:@"bundle"];
|
20
|
-
if (!associateBundleURL) {
|
21
|
-
NSBundle *subBundle = [NSBundle bundleForClass:self];
|
22
|
-
associateBundleURL = [subBundle URLForResource:bundleName withExtension:@"bundle"];
|
23
|
-
}
|
24
|
-
NSBundle *bundle = [NSBundle bundleWithURL:associateBundleURL];
|
25
|
-
return bundle;
|
26
|
-
}
|
27
|
-
|
28
|
-
@end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>CategoryHeader.h
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#ifndef <%= @prefixed_module %>CategoryHeader_h
|
10
|
-
#define <%= @prefixed_module %>CategoryHeader_h
|
11
|
-
|
12
|
-
#import <MTCategoryComponent/MTCategoryComponentHeader.h>
|
13
|
-
|
14
|
-
|
15
|
-
#endif /* <%= @prefixed_module %>CategoryHeader_h */
|
@@ -1,36 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>PrefixHeader.pch
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
|
10
|
-
#ifndef <%= @prefixed_module %>PrefixHeader_pch
|
11
|
-
#define <%= @prefixed_module %>PrefixHeader_pch
|
12
|
-
|
13
|
-
// Include any system framework and library headers here that should be included in all compilation units.
|
14
|
-
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
|
15
|
-
|
16
|
-
|
17
|
-
#ifdef __OBJC__
|
18
|
-
#import <Foundation/Foundation.h>
|
19
|
-
#import <UIKit/UIKit.h>
|
20
|
-
|
21
|
-
#import "<%= @prefixed_module %>CategoryHeader.h"
|
22
|
-
#import "<%= @prefixed_module %>VendorHeader.h"
|
23
|
-
#import "<%= @prefixed_module %>ToolsHeader.h"
|
24
|
-
|
25
|
-
#import <MTBaseKit/MTBaseKitHeader.h>
|
26
|
-
#import <MTCategoryComponent/MTCategoryComponentHeader.h>
|
27
|
-
#import <MTLayoutUtilityComponent/MTLayoutUtilityComponentHeader.h>
|
28
|
-
#import <AssetModule/MTModuleImage.h>
|
29
|
-
#import <MJExtension/MJExtension.h>
|
30
|
-
|
31
|
-
#endif
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
#endif /* <%= @prefixed_module %>PrefixHeader_pch */
|
@@ -1,14 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>RouterDefine.h
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#ifndef <%= @prefixed_module %>RouterDefine_h
|
10
|
-
#define <%= @prefixed_module %>RouterDefine_h
|
11
|
-
|
12
|
-
static NSString *kDemoRouterString = @"<%= @prefixed_module %>DemoPage";
|
13
|
-
|
14
|
-
#endif /* <%= @prefixed_module %>RouterDefine_h */
|
@@ -1,16 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>RouterRegister.h
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#import <Foundation/Foundation.h>
|
10
|
-
|
11
|
-
/**
|
12
|
-
Router Register for the <%= @module %> module.
|
13
|
-
*/
|
14
|
-
@interface <%= @prefixed_module %>RouterRegister : NSObject
|
15
|
-
|
16
|
-
@end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>RouterRegister.m
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#import "<%= @prefixed_module %>RouterRegister.h"
|
10
|
-
|
11
|
-
#import <MTBaseKit/MTBaseKitHeader.h>
|
12
|
-
#import <MTCategoryComponent/MTCategoryComponentHeader.h>
|
13
|
-
|
14
|
-
#import "<%= @prefixed_module %>RouterDefine.h"
|
15
|
-
|
16
|
-
#import "<%= @prefixed_module %>DemoViewController.h"
|
17
|
-
|
18
|
-
#import <<%= @module %>/<%= @module %>-Swift.h>
|
19
|
-
|
20
|
-
@implementation <%= @prefixed_module %>RouterRegister
|
21
|
-
|
22
|
-
@MTRouterRegister() {
|
23
|
-
|
24
|
-
[[MTRouterComponent shareInstance] registerUrlPartterns:kDemoRouterString error:nil action:^(MTRouterUrlRequest * _Nonnull urlRequest, MTRouterUrlCompletion _Nonnull completetion) {
|
25
|
-
|
26
|
-
<%= @prefixed_module %>DemoViewController *vc = [[<%= @prefixed_module %>DemoViewController alloc] init];
|
27
|
-
[[UIViewController mt_topViewController].navigationController pushViewController:vc animated:YES];
|
28
|
-
|
29
|
-
}];
|
30
|
-
|
31
|
-
}
|
32
|
-
|
33
|
-
@end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>ServiceProtocol.h
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#import <Foundation/Foundation.h>
|
10
|
-
|
11
|
-
@protocol <%= @prefixed_module %>ServiceProtocol <NSObject>
|
12
|
-
|
13
|
-
- (void)replaceThisMethod;
|
14
|
-
|
15
|
-
@end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>ServiceRegister.h
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#import <Foundation/Foundation.h>
|
10
|
-
|
11
|
-
/**
|
12
|
-
Service Register for the <%= @module %> module.
|
13
|
-
*/
|
14
|
-
@interface <%= @prefixed_module %>ServiceRegister : NSObject
|
15
|
-
|
16
|
-
@end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>ServiceRegister.m
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#import "<%= @prefixed_module %>ServiceRegister.h"
|
10
|
-
#import <MTBaseKit/MTBaseKitHeader.h>
|
11
|
-
|
12
|
-
#import "<%= @prefixed_module %>ServiceProtocol.h"
|
13
|
-
|
14
|
-
|
15
|
-
#import "<%= @prefixed_module %>DemoViewModel.h"
|
16
|
-
|
17
|
-
|
18
|
-
@implementation <%= @prefixed_module %>ServiceRegister
|
19
|
-
|
20
|
-
@MTModuleServiceRegister(){
|
21
|
-
MTModuleServiceRegisterExecute(<%= @prefixed_module %>DemoViewModel.class, @protocol(<%= @prefixed_module %>ServiceProtocol), nil);
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
@end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>ToolsHeader.h
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#ifndef <%= @prefixed_module %>ToolsHeader_h
|
10
|
-
#define <%= @prefixed_module %>ToolsHeader_h
|
11
|
-
|
12
|
-
#import "<%= @prefixed_module %>Bundle.h"
|
13
|
-
#endif /* <%= @prefixed_module %>ToolsHeader_h */
|
@@ -1,13 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>VendorHeader.h
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#ifndef <%= @prefixed_module %>VendorHeader_h
|
10
|
-
#define <%= @prefixed_module %>VendorHeader_h
|
11
|
-
|
12
|
-
|
13
|
-
#endif /* <%= @prefixed_module %>VendorHeader_h */
|
@@ -1,17 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>DemoViewController.h
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#import <UIKit/UIKit.h>
|
10
|
-
|
11
|
-
NS_ASSUME_NONNULL_BEGIN
|
12
|
-
|
13
|
-
@interface <%= @prefixed_module %>DemoViewController : UIViewController
|
14
|
-
|
15
|
-
@end
|
16
|
-
|
17
|
-
NS_ASSUME_NONNULL_END
|
@@ -1,28 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>DemoViewController.m
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
|
10
|
-
#import "<%= @prefixed_module %>DemoViewController.h"
|
11
|
-
|
12
|
-
@interface <%= @prefixed_module %>DemoViewController ()
|
13
|
-
|
14
|
-
@end
|
15
|
-
|
16
|
-
@implementation <%= @prefixed_module %>DemoViewController
|
17
|
-
|
18
|
-
- (void)viewDidLoad {
|
19
|
-
[super viewDidLoad];
|
20
|
-
// Do any additional setup after loading the view from its nib.
|
21
|
-
NSLog(@"----- viewDidLoad -----");
|
22
|
-
self.view.backgroundColor = [UIColor colorWithRed:0.3 green:0.4 blue:0.35 alpha:1.0];
|
23
|
-
self.navigationItem.title = @"<%= @prefixed_module %>DemoViewController";
|
24
|
-
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
@end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>DemoViewModel.h
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#import <Foundation/Foundation.h>
|
10
|
-
|
11
|
-
#import "<%= @prefixed_module %>ServiceProtocol.h"
|
12
|
-
@interface <%= @prefixed_module %>DemoViewModel : NSObject <<%= @prefixed_module %>ServiceProtocol>
|
13
|
-
|
14
|
-
@end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// <%= @prefixed_module %>DemoViewModel.m
|
3
|
-
// <%= @project %>
|
4
|
-
//
|
5
|
-
// Created by <%= @author %> on <%= @date %>.
|
6
|
-
//
|
7
|
-
//
|
8
|
-
|
9
|
-
#import "<%= @prefixed_module %>DemoViewModel.h"
|
10
|
-
|
11
|
-
|
12
|
-
@implementation <%= @prefixed_module %>DemoViewModel
|
13
|
-
|
14
|
-
- (void)replaceThisMethod {
|
15
|
-
NSLog(@"----- replace me -----");
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
@end
|
data/sig/mt_tool.rbs
DELETED
File without changes
|