boa 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -0
- data/lib/boa/commands.rb +8 -5
- data/lib/boa/module/module.rb +6 -5
- data/lib/boa/module/templates/DataManager.h +2 -2
- data/lib/boa/module/templates/DataManager.m +3 -3
- data/lib/boa/module/templates/DependenciesBody.m +4 -4
- data/lib/boa/module/templates/DependenciesHead.m +4 -4
- data/lib/boa/module/templates/Interactor.h +7 -7
- data/lib/boa/module/templates/Interactor.m +3 -3
- data/lib/boa/module/templates/ModuleInterface.h +3 -3
- data/lib/boa/module/templates/Presenter.h +11 -11
- data/lib/boa/module/templates/Presenter.m +4 -4
- data/lib/boa/module/templates/ViewController.h +5 -5
- data/lib/boa/module/templates/ViewController.m +5 -5
- data/lib/boa/module/templates/ViewInterface.h +2 -2
- data/lib/boa/module/templates/Wireframe.h +5 -5
- data/lib/boa/module/templates/Wireframe.m +7 -7
- data/lib/boa/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
data/lib/boa/commands.rb
CHANGED
@@ -63,12 +63,15 @@ module Boa
|
|
63
63
|
|
64
64
|
desc 'configure', 'configures project properties'
|
65
65
|
def configure
|
66
|
-
|
66
|
+
config = File.exists?(CONFIG_FILE) ? YAML.load_file(CONFIG_FILE) : {}
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
project = ask("Project name [#{config[:project]}] ?")
|
69
|
+
class_prefix = ask("Class prefix [#{config[:class_prefix]}] ?")
|
70
|
+
author = ask("Author [#{config[:author]}] ?")
|
71
|
+
|
72
|
+
config[:project] = project.empty? ? config[:project] || '' : project
|
73
|
+
config[:class_prefix] = class_prefix.empty? ? config[:class_prefix] || '' : class_prefix
|
74
|
+
config[:author] = author.empty? ? config[:author] || '' : author
|
72
75
|
|
73
76
|
File.open(CONFIG_FILE, 'w') do |f|
|
74
77
|
f.write config.to_yaml
|
data/lib/boa/module/module.rb
CHANGED
@@ -35,14 +35,15 @@ module Boa
|
|
35
35
|
def create(module_name)
|
36
36
|
config = invoke('boa:commands:configure', [])
|
37
37
|
|
38
|
-
@module
|
39
|
-
@
|
40
|
-
@project
|
41
|
-
@
|
38
|
+
@module = module_name
|
39
|
+
@prefixed_module = config[:class_prefix] + @module
|
40
|
+
@project = config[:project]
|
41
|
+
@author = config[:author]
|
42
|
+
@date = Time.now.strftime('%d/%m/%y')
|
42
43
|
|
43
44
|
# copying template files
|
44
45
|
FILES.each do |file_name, folder|
|
45
|
-
template "templates/#{file_name}", "#{BASE_PATH}/#{@module}/#{folder}/#{@
|
46
|
+
template "templates/#{file_name}", "#{BASE_PATH}/#{@module}/#{folder}/#{@prefixed_module}#{file_name}"
|
46
47
|
end
|
47
48
|
|
48
49
|
# rendering dependencies head
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>DataManager.h
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
@@ -8,6 +8,6 @@
|
|
8
8
|
|
9
9
|
#import <Foundation/Foundation.h>
|
10
10
|
|
11
|
-
@interface <%= @
|
11
|
+
@interface <%= @prefixed_module %>DataManager : NSObject
|
12
12
|
|
13
13
|
@end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>DataManager.m
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
6
6
|
//
|
7
7
|
//
|
8
8
|
|
9
|
-
#import "<%= @
|
9
|
+
#import "<%= @prefixed_module %>DataManager.h"
|
10
10
|
|
11
|
-
@implementation <%= @
|
11
|
+
@implementation <%= @prefixed_module %>DataManager
|
12
12
|
|
13
13
|
@end
|
@@ -2,10 +2,10 @@
|
|
2
2
|
// begin <%= @module %> module
|
3
3
|
|
4
4
|
// instantiate classes
|
5
|
-
<%= @
|
6
|
-
<%= @
|
7
|
-
<%= @
|
8
|
-
<%= @
|
5
|
+
<%= @prefixed_module %>Wireframe *<%= @module.downcase %>Wireframe = [[<%= @prefixed_module %>Wireframe alloc] init];
|
6
|
+
<%= @prefixed_module %>Presenter *<%= @module.downcase %>Presenter = [[<%= @prefixed_module %>Presenter alloc] init];
|
7
|
+
<%= @prefixed_module %>DataManager *<%= @module.downcase %>DataManager = [[<%= @prefixed_module %>DataManager alloc] init];
|
8
|
+
<%= @prefixed_module %>Interactor *<%= @module.downcase %>Interactor = [[<%= @prefixed_module %>Interactor alloc] init];
|
9
9
|
|
10
10
|
// presenter <-> wireframe
|
11
11
|
<%= @module.downcase %>Presenter.wireframe = <%= @module.downcase %>Wireframe;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#import "<%= @
|
2
|
-
#import "<%= @
|
3
|
-
#import "<%= @
|
4
|
-
#import "<%= @
|
1
|
+
#import "<%= @prefixed_module %>Wireframe.h"
|
2
|
+
#import "<%= @prefixed_module %>Presenter.h"
|
3
|
+
#import "<%= @prefixed_module %>DataManager.h"
|
4
|
+
#import "<%= @prefixed_module %>Interactor.h"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>Interactor.h
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
@@ -8,14 +8,14 @@
|
|
8
8
|
|
9
9
|
#import <Foundation/Foundation.h>
|
10
10
|
|
11
|
-
#import "<%= @
|
12
|
-
#import "<%= @
|
11
|
+
#import "<%= @prefixed_module %>Presenter.h"
|
12
|
+
#import "<%= @prefixed_module %>DataManager.h"
|
13
13
|
|
14
|
-
@class <%= @
|
14
|
+
@class <%= @prefixed_module %>Presenter;
|
15
15
|
|
16
|
-
@interface <%= @
|
16
|
+
@interface <%= @prefixed_module %>Interactor : NSObject
|
17
17
|
|
18
|
-
@property (nonatomic, strong) <%= @
|
19
|
-
@property (nonatomic, strong) <%= @
|
18
|
+
@property (nonatomic, strong) <%= @prefixed_module %>Presenter *presenter;
|
19
|
+
@property (nonatomic, strong) <%= @prefixed_module %>DataManager *dataManager;
|
20
20
|
|
21
21
|
@end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>Interactor.m
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
6
6
|
//
|
7
7
|
//
|
8
8
|
|
9
|
-
#import "<%= @
|
9
|
+
#import "<%= @prefixed_module %>Interactor.h"
|
10
10
|
|
11
|
-
@implementation <%= @
|
11
|
+
@implementation <%= @prefixed_module %>Interactor
|
12
12
|
|
13
13
|
@end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>ModuleInterface.h
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
@@ -8,10 +8,10 @@
|
|
8
8
|
|
9
9
|
#import <Foundation/Foundation.h>
|
10
10
|
|
11
|
-
@protocol <%= @
|
11
|
+
@protocol <%= @prefixed_module %>ModuleInterface <NSObject>
|
12
12
|
|
13
13
|
@end
|
14
14
|
|
15
|
-
@protocol <%= @
|
15
|
+
@protocol <%= @prefixed_module %>ModuleDelegate <NSObject>
|
16
16
|
|
17
17
|
@end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>Presenter.h
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
@@ -8,20 +8,20 @@
|
|
8
8
|
|
9
9
|
#import <Foundation/Foundation.h>
|
10
10
|
|
11
|
-
#import "<%= @
|
11
|
+
#import "<%= @prefixed_module %>ModuleInterface.h"
|
12
12
|
|
13
|
-
#import "<%= @
|
14
|
-
#import "<%= @
|
15
|
-
#import "<%= @
|
13
|
+
#import "<%= @prefixed_module %>Interactor.h"
|
14
|
+
#import "<%= @prefixed_module %>Wireframe.h"
|
15
|
+
#import "<%= @prefixed_module %>ViewInterface.h"
|
16
16
|
|
17
|
-
@class <%= @
|
18
|
-
@class <%= @
|
17
|
+
@class <%= @prefixed_module %>Wireframe;
|
18
|
+
@class <%= @prefixed_module %>Interactor;
|
19
19
|
|
20
|
-
@interface <%= @
|
20
|
+
@interface <%= @prefixed_module %>Presenter : NSObject <<%= @prefixed_module %>ModuleInterface>
|
21
21
|
|
22
|
-
@property (nonatomic, strong) <%= @
|
23
|
-
@property (nonatomic, strong) <%= @
|
22
|
+
@property (nonatomic, strong) <%= @prefixed_module %>Interactor *interactor;
|
23
|
+
@property (nonatomic, strong) <%= @prefixed_module %>Wireframe *wireframe;
|
24
24
|
|
25
|
-
@property (nonatomic, strong) UIViewController<<%= @
|
25
|
+
@property (nonatomic, strong) UIViewController<<%= @prefixed_module %>ViewInterface> *userInterface;
|
26
26
|
|
27
27
|
@end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>Presenter.m
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
6
6
|
//
|
7
7
|
//
|
8
8
|
|
9
|
-
#import "<%= @
|
9
|
+
#import "<%= @prefixed_module %>Presenter.h"
|
10
10
|
|
11
|
-
@implementation <%= @
|
11
|
+
@implementation <%= @prefixed_module %>Presenter
|
12
12
|
|
13
|
-
#pragma mark - <%= @
|
13
|
+
#pragma mark - <%= @prefixed_module %>ModuleInterface methods
|
14
14
|
|
15
15
|
// implement module interface here
|
16
16
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>ViewController.h
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
@@ -8,12 +8,12 @@
|
|
8
8
|
|
9
9
|
#import <UIKit/UIKit.h>
|
10
10
|
|
11
|
-
#import "<%= @
|
12
|
-
#import "<%= @
|
11
|
+
#import "<%= @prefixed_module %>ModuleInterface.h"
|
12
|
+
#import "<%= @prefixed_module %>ViewInterface.h"
|
13
13
|
|
14
|
-
@interface <%= @
|
14
|
+
@interface <%= @prefixed_module %>ViewController : UIViewController <<%= @prefixed_module %>ViewInterface>
|
15
15
|
|
16
|
-
@property (nonatomic, strong) id<<%= @
|
16
|
+
@property (nonatomic, strong) id<<%= @prefixed_module %>ModuleInterface> eventHandler;
|
17
17
|
|
18
18
|
// *** add UI events here
|
19
19
|
|
@@ -1,18 +1,18 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>ViewController.m
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
6
6
|
//
|
7
7
|
//
|
8
8
|
|
9
|
-
#import "<%= @
|
9
|
+
#import "<%= @prefixed_module %>ViewController.h"
|
10
10
|
|
11
|
-
@interface <%= @
|
11
|
+
@interface <%= @prefixed_module %>ViewController ()
|
12
12
|
|
13
13
|
@end
|
14
14
|
|
15
|
-
@implementation <%= @
|
15
|
+
@implementation <%= @prefixed_module %>ViewController
|
16
16
|
|
17
17
|
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
18
18
|
{
|
@@ -41,7 +41,7 @@
|
|
41
41
|
[super viewDidAppear:animated];
|
42
42
|
}
|
43
43
|
|
44
|
-
#pragma mark - <%= @
|
44
|
+
#pragma mark - <%= @prefixed_module %>ViewInterface methods
|
45
45
|
|
46
46
|
// *** implement view_interface methods here
|
47
47
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>View.h
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
@@ -8,6 +8,6 @@
|
|
8
8
|
|
9
9
|
#import <Foundation/Foundation.h>
|
10
10
|
|
11
|
-
@protocol <%= @
|
11
|
+
@protocol <%= @prefixed_module %>ViewInterface <NSObject>
|
12
12
|
|
13
13
|
@end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>Wireframe.h
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
@@ -9,14 +9,14 @@
|
|
9
9
|
#import <Foundation/Foundation.h>
|
10
10
|
|
11
11
|
#import "RootWireframe.h"
|
12
|
-
#import "<%= @
|
12
|
+
#import "<%= @prefixed_module %>Presenter.h"
|
13
13
|
|
14
|
-
@class <%= @
|
14
|
+
@class <%= @prefixed_module %>Presenter;
|
15
15
|
|
16
|
-
@interface <%= @
|
16
|
+
@interface <%= @prefixed_module %>Wireframe : NSObject
|
17
17
|
|
18
18
|
@property (nonatomic, strong) RootWireframe *rootWireframe;
|
19
|
-
@property (nonatomic, strong) <%= @
|
19
|
+
@property (nonatomic, strong) <%= @prefixed_module %>Presenter *presenter;
|
20
20
|
|
21
21
|
// initialization
|
22
22
|
- (void)presentSelfFromViewController:(UIViewController *)viewController;
|
@@ -1,26 +1,26 @@
|
|
1
1
|
//
|
2
|
-
// <%= @
|
2
|
+
// <%= @prefixed_module %>Wireframe.m
|
3
3
|
// <%= @project %>
|
4
4
|
//
|
5
5
|
// Created by <%= @author %> on <%= @date %>.
|
6
6
|
//
|
7
7
|
//
|
8
8
|
|
9
|
-
#import "<%= @
|
10
|
-
#import "<%= @
|
9
|
+
#import "<%= @prefixed_module %>Wireframe.h"
|
10
|
+
#import "<%= @prefixed_module %>ViewController.h"
|
11
11
|
|
12
|
-
@interface <%= @
|
12
|
+
@interface <%= @prefixed_module %>Wireframe ()
|
13
13
|
|
14
|
-
@property (nonatomic, strong) <%= @
|
14
|
+
@property (nonatomic, strong) <%= @prefixed_module %>ViewController *viewController;
|
15
15
|
|
16
16
|
@end
|
17
17
|
|
18
|
-
@implementation <%= @
|
18
|
+
@implementation <%= @prefixed_module %>Wireframe
|
19
19
|
|
20
20
|
- (void)presentSelfFromViewController:(UIViewController *)viewController
|
21
21
|
{
|
22
22
|
// save reference
|
23
|
-
self.viewController = [[<%= @
|
23
|
+
self.viewController = [[<%= @prefixed_module %>ViewController alloc] initWithNibName:@"<%= @prefixed_module %>ViewController" bundle:nil];
|
24
24
|
|
25
25
|
// view <-> presenter
|
26
26
|
self.presenter.userInterface = self.viewController;
|
data/lib/boa/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|