-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Erik Sundin
committed
Sep 7, 2013
1 parent
294e523
commit 201b25d
Showing
27 changed files
with
12,593 additions
and
3,385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// TYPHOON FRAMEWORK | ||
// Copyright 2013, Jasper Blues & Contributors | ||
// All Rights Reserved. | ||
// | ||
// NOTICE: The authors permit you to use, modify, and distribute this file | ||
// in accordance with the terms of the license agreement accompanying it. | ||
// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
#import "TyphoonDefinition.h" | ||
|
||
@class TyphoonPropertyPlaceholderConfigurer; | ||
@protocol TyphoonResource; | ||
|
||
/** | ||
Declares short-hand definition factory methods for infrastructure components. | ||
*/ | ||
@interface TyphoonDefinition (Infrastructure) | ||
|
||
+ (TyphoonDefinition*)propertyPlaceholderWithResource:(id<TyphoonResource>)resource; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// TYPHOON FRAMEWORK | ||
// Copyright 2013, Jasper Blues & Contributors | ||
// All Rights Reserved. | ||
// | ||
// NOTICE: The authors permit you to use, modify, and distribute this file | ||
// in accordance with the terms of the license agreement accompanying it. | ||
// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
#import "TyphoonDefinition+Infrastructure.h" | ||
#import "TyphoonPropertyPlaceholderConfigurer.h" | ||
#import "TyphoonResource.h" | ||
#import "TyphoonInitializer.h" | ||
|
||
@implementation TyphoonDefinition (Infrastructure) | ||
|
||
+ (NSString *)generateInfrastructureComponentKey { | ||
CFUUIDRef uuid = CFUUIDCreate(NULL); | ||
NSString *UUID = CFBridgingRelease(CFUUIDCreateString(NULL, uuid)); | ||
return UUID; | ||
} | ||
|
||
+ (TyphoonDefinition *)propertyPlaceholderWithResource:(id<TyphoonResource>)resource { | ||
|
||
TyphoonDefinition *definition = [self withClass:[TyphoonPropertyPlaceholderConfigurer class] initialization:^(TyphoonInitializer *initializer) { | ||
|
||
initializer.selector = @selector(configurerWithResource:); | ||
[initializer injectWithObject:resource]; | ||
|
||
}]; | ||
definition.key = [self generateInfrastructureComponentKey]; | ||
return definition; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// InfrastructureComponentsAssembly.h | ||
// Tests | ||
// | ||
// Created by Erik Sundin on 9/7/13. | ||
// | ||
// | ||
|
||
#import "TyphoonAssembly.h" | ||
|
||
@interface InfrastructureComponentsAssembly : TyphoonAssembly | ||
|
||
- (id)propertyPlaceHolderConfigurer; | ||
|
||
- (id)knight; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// InfrastructureComponentsAssembly.m | ||
// Tests | ||
// | ||
// Created by Erik Sundin on 9/7/13. | ||
// | ||
// | ||
|
||
#import "InfrastructureComponentsAssembly.h" | ||
#import "Typhoon.h" | ||
#import "Knight.h" | ||
|
||
@implementation InfrastructureComponentsAssembly | ||
|
||
- (id)propertyPlaceHolderConfigurer | ||
{ | ||
return [TyphoonDefinition propertyPlaceholderWithResource:[TyphoonBundleResource withName:@"SomeProperties.properties"]]; | ||
} | ||
|
||
- (id)knight | ||
{ | ||
return [TyphoonDefinition withClass:[Knight class] properties:^(TyphoonDefinition *definition) { | ||
[definition injectProperty:@selector(damselsRescued) withValueAsText:@"${damsels.rescued}"]; | ||
}]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.