diff --git a/Guides/runtime/booleans.md b/Guides/runtime/booleans.md index 1cfc5a7b..d1fdbd3b 100644 --- a/Guides/runtime/booleans.md +++ b/Guides/runtime/booleans.md @@ -102,30 +102,7 @@ A consequence is that all properties declared as `char` will be considered as bo @end ``` -We thought that built-in support for `BOOL` properties was worth this annoyance, since it should be pretty rare that you would use a value of such a type in a template. - -However, should this behavior annoy you, we provide a mechanism for having GRMustache consider `char` and `BOOL` properties as what they really are: numbers. - -Use the `GRMustacheTemplateOptionStrictBoolean` option when loading and rendering templates: - -```objc -Person *alice = [Person new]; -alice.pretty = NO; - -// All the following renderings return @"whistle", because alice's pretty property is now considered as a number. - -// On-the-fly rendering: -[GRMustacheTemplate renderObject:alice fromString:templateString options:GRMustacheTemplateOptionStrictBoolean]; - -// With a GRMustacheTemplate: -GRMustacheTemplate *template = [GRMustacheTemplate templateFromString:templateString options:GRMustacheTemplateOptionStrictBoolean error:NULL]; -[template renderObject:alice]; - -// With a GRMustacheTemplate loaded from a GRMustacheTemplateRepository: -GRMustacheTemplateRepository *templateRepository = [GRMustacheTemplateRepository templateRepositoryWith... options:GRMustacheTemplateOptionStrictBoolean]; -GRMustacheTemplate *template = [templateRepository templateFromString:templateString error:NULL]; -[template renderObject:alice]; -``` +We thought that built-in support for `BOOL` properties was worth this annoyance, since it should be pretty rare that you would use a value of such a type in a template. ### The case for C99 bool diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0b1245a2..b8c213b1 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -3,6 +3,48 @@ GRMustache Release Notes You can compare the performances of GRMustache versions at https://github.com/groue/GRMustacheBenchmark. +## v3.0.0 + +**There is no option** + +Removed APIs: + +```objc +enum { + GRMustacheTemplateOptionNone, + GRMustacheTemplateOptionStrictBoolean +}; + +typedef NSUInteger GRMustacheTemplateOptions; + +@interface GRMustacheTemplate: NSObject { ++ (id)templateFromString:(NSString *)templateString options:(GRMustacheTemplateOptions)options error:(NSError **)outError; ++ (id)templateFromContentsOfFile:(NSString *)path options:(GRMustacheTemplateOptions)options error:(NSError **)outError; ++ (id)templateFromContentsOfURL:(NSURL *)url options:(GRMustacheTemplateOptions)options error:(NSError **)outError; ++ (id)templateFromResource:(NSString *)name bundle:(NSBundle *)bundle options:(GRMustacheTemplateOptions)options error:(NSError **)outError; ++ (id)templateFromResource:(NSString *)name withExtension:(NSString *)ext bundle:(NSBundle *)bundle options:(GRMustacheTemplateOptions)options error:(NSError **)outError; ++ (NSString *)renderObject:(id)object fromString:(NSString *)templateString options:(GRMustacheTemplateOptions)options error:(NSError **)outError; ++ (NSString *)renderObject:(id)object fromContentsOfFile:(NSString *)path options:(GRMustacheTemplateOptions)options error:(NSError **)outError; ++ (NSString *)renderObject:(id)object fromContentsOfURL:(NSURL *)url options:(GRMustacheTemplateOptions)options error:(NSError **)outError; ++ (NSString *)renderObject:(id)object fromResource:(NSString *)name bundle:(NSBundle *)bundle options:(GRMustacheTemplateOptions)options error:(NSError **)outError; ++ (NSString *)renderObject:(id)object fromResource:(NSString *)name withExtension:(NSString *)ext bundle:(NSBundle *)bundle options:(GRMustacheTemplateOptions)options error:(NSError **)outError; +@end + +@protocol GRMustacheTemplateRepositoryDataSource ++ (id)templateRepositoryWithBaseURL:(NSURL *)URL options:(GRMustacheTemplateOptions)options; ++ (id)templateRepositoryWithBaseURL:(NSURL *)URL templateExtension:(NSString *)ext options:(GRMustacheTemplateOptions)options; ++ (id)templateRepositoryWithBaseURL:(NSURL *)URL templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding options:(GRMustacheTemplateOptions)options; ++ (id)templateRepositoryWithDirectory:(NSString *)path options:(GRMustacheTemplateOptions)options; ++ (id)templateRepositoryWithDirectory:(NSString *)path templateExtension:(NSString *)ext options:(GRMustacheTemplateOptions)options; ++ (id)templateRepositoryWithDirectory:(NSString *)path templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding options:(GRMustacheTemplateOptions)options; ++ (id)templateRepositoryWithBundle:(NSBundle *)bundle options:(GRMustacheTemplateOptions)options; ++ (id)templateRepositoryWithBundle:(NSBundle *)bundle templateExtension:(NSString *)ext options:(GRMustacheTemplateOptions)options; ++ (id)templateRepositoryWithBundle:(NSBundle *)bundle templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding options:(GRMustacheTemplateOptions)options; ++ (id)templateRepositoryWithPartialsDictionary:(NSDictionary *)partialsDictionary options:(GRMustacheTemplateOptions)options; ++ (id)templateRepositoryWithOptions:(GRMustacheTemplateOptions)options; +@end +``` + ## v2.0.0 **Performance improvements and API simplification** diff --git a/include/GRMustache.h b/include/GRMustache.h index 13c0e11b..7dd5b31d 100644 --- a/include/GRMustache.h +++ b/include/GRMustache.h @@ -23,14 +23,6 @@ #import #import "GRMustacheAvailabilityMacros.h" -enum { - GRMustacheTemplateOptionNone = 0, - GRMustacheTemplateOptionStrictBoolean = 0x01, -}; - -typedef NSUInteger GRMustacheTemplateOptions; - - /** A C struct that hold GRMustache version information @@ -60,7 +52,7 @@ typedef struct { @return The version of GRMustache as a GRMustacheVersion struct. @since v1.0 */ -+ (GRMustacheVersion)version AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (GRMustacheVersion)version AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ////////////////////////////////////////////////////////////////////////////////////////// /// @name Preventing NSUndefinedKeyException when using GRMustache in Development configuration @@ -83,32 +75,7 @@ typedef struct { @since v1.7 */ -+ (void)preventNSUndefinedKeyExceptionAttack AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; - - -////////////////////////////////////////////////////////////////////////////////////////// -/// @name Global template options -////////////////////////////////////////////////////////////////////////////////////////// - -/** - Returns the default template options. The default value is GRMustacheTemplateOptionNone. - - @return The default template options. The default value is GRMustacheTemplateOptionNone. - @see setDefaultTemplateOptions: - @since v1.8 - */ -+ (GRMustacheTemplateOptions)defaultTemplateOptions AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; - -/** - Sets the default template options. - - Those options will be used by all GRMustacheTemplate rendering and parsing methods, such as [GRMustacheTemplate templateFromString:error:] and [GRMustacheTemplate renderObject:fromString:error:]. - - @param templateOptions A mask of options indicating the default behavior of templates. - @see defaultTemplateOptions - @since v1.8 - */ -+ (void)setDefaultTemplateOptions:(GRMustacheTemplateOptions)templateOptions AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (void)preventNSUndefinedKeyExceptionAttack AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; @end diff --git a/include/GRMustacheAvailabilityMacros.h b/include/GRMustacheAvailabilityMacros.h index 35dcdac7..dd8fcfaa 100644 --- a/include/GRMustacheAvailabilityMacros.h +++ b/include/GRMustacheAvailabilityMacros.h @@ -28,7 +28,7 @@ /* * Set up standard GRMustache versions */ -#define GRMUSTACHE_VERSION_2_0 2000 +#define GRMUSTACHE_VERSION_3_0 3000 @@ -36,10 +36,10 @@ /* - * If max GRMustacheVersion not specified, assume 2.0 + * If max GRMustacheVersion not specified, assume 3.0 */ #ifndef GRMUSTACHE_VERSION_MAX_ALLOWED -#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_2_0 +#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_3_0 #endif /* @@ -55,8 +55,8 @@ #if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_MIN_REQUIRED #error GRMUSTACHE_VERSION_MAX_ALLOWED must be >= GRMUSTACHE_VERSION_MIN_REQUIRED #endif -#if GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_2_0 -#error GRMUSTACHE_VERSION_MIN_REQUIRED must be >= GRMUSTACHE_VERSION_2_0 +#if GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_3_0 +#error GRMUSTACHE_VERSION_MIN_REQUIRED must be >= GRMUSTACHE_VERSION_3_0 #endif @@ -65,26 +65,26 @@ /* - * AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER + * AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER * - * Used on declarations introduced in GRMustache 2.0 + * Used on declarations introduced in GRMustache 3.0 */ -#define AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER +#define AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER /* - * AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER_BUT_DEPRECATED + * AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER_BUT_DEPRECATED * - * Used on declarations introduced in GRMustache 2.0, - * and deprecated in GRMustache 2.0 + * Used on declarations introduced in GRMustache 3.0, + * and deprecated in GRMustache 3.0 */ -#define AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE +#define AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE /* - * DEPRECATED_IN_GRMUSTACHE_VERSION_2_0_AND_LATER + * DEPRECATED_IN_GRMUSTACHE_VERSION_3_0_AND_LATER * - * Used on types deprecated in GRMustache 2.0 + * Used on types deprecated in GRMustache 3.0 */ -#define DEPRECATED_IN_GRMUSTACHE_VERSION_2_0_AND_LATER DEPRECATED_ATTRIBUTE +#define DEPRECATED_IN_GRMUSTACHE_VERSION_3_0_AND_LATER DEPRECATED_ATTRIBUTE diff --git a/include/GRMustacheError.h b/include/GRMustacheError.h index a383d702..ac88be0e 100644 --- a/include/GRMustacheError.h +++ b/include/GRMustacheError.h @@ -29,7 +29,7 @@ @since v1.0 */ -extern NSString* const GRMustacheErrorDomain AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +extern NSString* const GRMustacheErrorDomain AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; /** The codes of a GRMustache-generated NSError @@ -50,6 +50,6 @@ typedef enum { @since v1.0 */ GRMustacheErrorCodeTemplateNotFound, -} GRMustacheErrorCode AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +} GRMustacheErrorCode AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; diff --git a/include/GRMustacheHelper.h b/include/GRMustacheHelper.h index 74d04c2e..2858e9c2 100644 --- a/include/GRMustacheHelper.h +++ b/include/GRMustacheHelper.h @@ -31,7 +31,7 @@ @protocol GRMustacheHelper @required -- (NSString *)renderSection:(GRMustacheSection *)section AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +- (NSString *)renderSection:(GRMustacheSection *)section AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; @end @@ -41,7 +41,7 @@ #if NS_BLOCKS_AVAILABLE @interface GRMustacheHelper: NSObject -+ (id)helperWithBlock:(NSString *(^)(GRMustacheSection* section))block AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)helperWithBlock:(NSString *(^)(GRMustacheSection* section))block AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; @end #endif /* if NS_BLOCKS_AVAILABLE */ diff --git a/include/GRMustacheInvocation.h b/include/GRMustacheInvocation.h index 0a6df337..97dd24e2 100644 --- a/include/GRMustacheInvocation.h +++ b/include/GRMustacheInvocation.h @@ -28,6 +28,6 @@ id _returnValue; id _token; } -@property (nonatomic, readonly) NSString *key AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -@property (nonatomic, retain) id returnValue AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +@property (nonatomic, readonly) NSString *key AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; +@property (nonatomic, retain) id returnValue AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; @end diff --git a/include/GRMustacheSection.h b/include/GRMustacheSection.h index 71a64996..d92a7bbe 100644 --- a/include/GRMustacheSection.h +++ b/include/GRMustacheSection.h @@ -47,7 +47,7 @@ @since v2.0 */ -@property (nonatomic, readonly) id renderingContext AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +@property (nonatomic, readonly) id renderingContext AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; @@ -61,7 +61,7 @@ @since v2.0 */ -@property (nonatomic, readonly) NSString *innerTemplateString AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +@property (nonatomic, readonly) NSString *innerTemplateString AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ////////////////////////////////////////////////////////////////////////////////////////// @@ -75,6 +75,6 @@ @since v2.0 */ -- (NSString *)render AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +- (NSString *)render AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; @end diff --git a/include/GRMustacheTemplate.h b/include/GRMustacheTemplate.h index 555b7dc2..4f376975 100644 --- a/include/GRMustacheTemplate.h +++ b/include/GRMustacheTemplate.h @@ -33,11 +33,10 @@ @interface GRMustacheTemplate: NSObject { @private NSArray *_elems; - GRMustacheTemplateOptions _options; id _delegate; } -@property (nonatomic, assign) id delegate AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +@property (nonatomic, assign) id delegate AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ////////////////////////////////////////////////////////////////////////////////////////// @@ -52,25 +51,10 @@ @return A GRMustacheTemplate instance @param templateString The template string @param outError If there is an error loading or parsing template and partials, upon return contains an NSError object that describes the problem. - @see templateFromString:options:error: @see [GRMustache defaultTemplateOptions] @since v1.11 */ -+ (id)templateFromString:(NSString *)templateString error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; - -/** - Parses a template string, and returns a compiled template. - - The behavior of the returned template is determined by the _options_ parameter, not by [GRMustache defaultTemplateOptions]. - - @return A GRMustacheTemplate instance - @param templateString The template string - @param options A mask of options indicating the behavior of the template. - @param outError If there is an error loading or parsing template and partials, upon return contains an NSError object that describes the problem. - @see templateFromString:error: - @since v1.11 - */ -+ (id)templateFromString:(NSString *)templateString options:(GRMustacheTemplateOptions)options error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)templateFromString:(NSString *)templateString error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; /** Renders a context object from a template string. @@ -82,8 +66,7 @@ @since v1.0 */ -+ (NSString *)renderObject:(id)object fromString:(NSString *)templateString error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (NSString *)renderObject:(id)object fromString:(NSString *)templateString options:(GRMustacheTemplateOptions)options error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (NSString *)renderObject:(id)object fromString:(NSString *)templateString error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ////////////////////////////////////////////////////////////////////////////////////////// @@ -101,8 +84,7 @@ @since v1.11 */ -+ (id)templateFromContentsOfFile:(NSString *)path error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateFromContentsOfFile:(NSString *)path options:(GRMustacheTemplateOptions)options error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)templateFromContentsOfFile:(NSString *)path error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; #if !TARGET_OS_IPHONE || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 @@ -117,8 +99,7 @@ @since v1.11 */ -+ (id)templateFromContentsOfURL:(NSURL *)url error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateFromContentsOfURL:(NSURL *)url options:(GRMustacheTemplateOptions)options error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)templateFromContentsOfURL:(NSURL *)url error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; #endif /* if !TARGET_OS_IPHONE || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 */ @@ -134,8 +115,7 @@ @since v1.4 */ -+ (NSString *)renderObject:(id)object fromContentsOfFile:(NSString *)path error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (NSString *)renderObject:(id)object fromContentsOfFile:(NSString *)path options:(GRMustacheTemplateOptions)options error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (NSString *)renderObject:(id)object fromContentsOfFile:(NSString *)path error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; #if !TARGET_OS_IPHONE || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 @@ -152,8 +132,7 @@ @since v1.0 */ -+ (NSString *)renderObject:(id)object fromContentsOfURL:(NSURL *)url error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (NSString *)renderObject:(id)object fromContentsOfURL:(NSURL *)url options:(GRMustacheTemplateOptions)options error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (NSString *)renderObject:(id)object fromContentsOfURL:(NSURL *)url error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; #endif /* if !TARGET_OS_IPHONE || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 */ @@ -176,8 +155,7 @@ @since v1.11 */ -+ (id)templateFromResource:(NSString *)name bundle:(NSBundle *)bundle error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateFromResource:(NSString *)name bundle:(NSBundle *)bundle options:(GRMustacheTemplateOptions)options error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)templateFromResource:(NSString *)name bundle:(NSBundle *)bundle error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; /** Parses a bundle resource template, and returns a compiled template. @@ -194,8 +172,7 @@ @since v1.11 */ -+ (id)templateFromResource:(NSString *)name withExtension:(NSString *)ext bundle:(NSBundle *)bundle error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateFromResource:(NSString *)name withExtension:(NSString *)ext bundle:(NSBundle *)bundle options:(GRMustacheTemplateOptions)options error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)templateFromResource:(NSString *)name withExtension:(NSString *)ext bundle:(NSBundle *)bundle error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; /** @@ -213,8 +190,7 @@ @since v1.0 */ -+ (NSString *)renderObject:(id)object fromResource:(NSString *)name bundle:(NSBundle *)bundle error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (NSString *)renderObject:(id)object fromResource:(NSString *)name bundle:(NSBundle *)bundle options:(GRMustacheTemplateOptions)options error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (NSString *)renderObject:(id)object fromResource:(NSString *)name bundle:(NSBundle *)bundle error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; /** Renders a context object from a bundle resource template. @@ -232,8 +208,7 @@ @since v1.0 */ -+ (NSString *)renderObject:(id)object fromResource:(NSString *)name withExtension:(NSString *)ext bundle:(NSBundle *)bundle error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (NSString *)renderObject:(id)object fromResource:(NSString *)name withExtension:(NSString *)ext bundle:(NSBundle *)bundle options:(GRMustacheTemplateOptions)options error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (NSString *)renderObject:(id)object fromResource:(NSString *)name withExtension:(NSString *)ext bundle:(NSBundle *)bundle error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ////////////////////////////////////////////////////////////////////////////////////////// @@ -248,7 +223,7 @@ @since v1.0 */ -- (NSString *)renderObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +- (NSString *)renderObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; /** Renders a template with context objects. @@ -258,7 +233,7 @@ @since v1.5 */ -- (NSString *)renderObjects:(id)object, ... __attribute__ ((sentinel)) AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +- (NSString *)renderObjects:(id)object, ... __attribute__ ((sentinel)) AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; /** Renders a template without any context object for interpreting Mustache tags. @@ -267,6 +242,6 @@ @since v1.0 */ -- (NSString *)render AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +- (NSString *)render AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; @end diff --git a/include/GRMustacheTemplateDelegate.h b/include/GRMustacheTemplateDelegate.h index be94b0a7..bb37c2fc 100644 --- a/include/GRMustacheTemplateDelegate.h +++ b/include/GRMustacheTemplateDelegate.h @@ -28,8 +28,8 @@ @protocol GRMustacheTemplateDelegate @optional -- (void)templateWillRender:(GRMustacheTemplate *)template AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -- (void)templateDidRender:(GRMustacheTemplate *)template AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -- (void)template:(GRMustacheTemplate *)template willRenderReturnValueOfInvocation:(GRMustacheInvocation *)invocation AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -- (void)template:(GRMustacheTemplate *)template didRenderReturnValueOfInvocation:(GRMustacheInvocation *)invocation AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +- (void)templateWillRender:(GRMustacheTemplate *)template AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; +- (void)templateDidRender:(GRMustacheTemplate *)template AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; +- (void)template:(GRMustacheTemplate *)template willRenderReturnValueOfInvocation:(GRMustacheInvocation *)invocation AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; +- (void)template:(GRMustacheTemplate *)template didRenderReturnValueOfInvocation:(GRMustacheInvocation *)invocation AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; @end diff --git a/include/GRMustacheTemplateRepository.h b/include/GRMustacheTemplateRepository.h index 5756b2ba..79b34937 100644 --- a/include/GRMustacheTemplateRepository.h +++ b/include/GRMustacheTemplateRepository.h @@ -29,49 +29,37 @@ @protocol GRMustacheTemplateRepositoryDataSource @required -- (id)templateRepository:(GRMustacheTemplateRepository *)templateRepository templateIDForName:(NSString *)name relativeToTemplateID:(id)templateID AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -- (NSString *)templateRepository:(GRMustacheTemplateRepository *)templateRepository templateStringForTemplateID:(id)templateID error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +- (id)templateRepository:(GRMustacheTemplateRepository *)templateRepository templateIDForName:(NSString *)name relativeToTemplateID:(id)templateID AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; +- (NSString *)templateRepository:(GRMustacheTemplateRepository *)templateRepository templateStringForTemplateID:(id)templateID error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; @end @interface GRMustacheTemplateRepository : NSObject { @private id _dataSource; - GRMustacheTemplateOptions _options; NSMutableDictionary *_templateForTemplateID; id _currentlyParsedTemplateID; } -@property (nonatomic, assign) id dataSource AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +@property (nonatomic, assign) id dataSource AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; #if !TARGET_OS_IPHONE || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 -+ (id)templateRepositoryWithBaseURL:(NSURL *)URL AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBaseURL:(NSURL *)URL options:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBaseURL:(NSURL *)URL templateExtension:(NSString *)ext AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBaseURL:(NSURL *)URL templateExtension:(NSString *)ext options:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBaseURL:(NSURL *)URL templateExtension:(NSString *)ext AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBaseURL:(NSURL *)URL templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBaseURL:(NSURL *)URL templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding options:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)templateRepositoryWithBaseURL:(NSURL *)URL AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ++ (id)templateRepositoryWithBaseURL:(NSURL *)URL templateExtension:(NSString *)ext AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ++ (id)templateRepositoryWithBaseURL:(NSURL *)URL templateExtension:(NSString *)ext AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ++ (id)templateRepositoryWithBaseURL:(NSURL *)URL templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; #endif /* if !TARGET_OS_IPHONE || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 */ -+ (id)templateRepositoryWithDirectory:(NSString *)path AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithDirectory:(NSString *)path options:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithDirectory:(NSString *)path templateExtension:(NSString *)ext AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithDirectory:(NSString *)path templateExtension:(NSString *)ext options:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithDirectory:(NSString *)path templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithDirectory:(NSString *)path templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding options:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)templateRepositoryWithDirectory:(NSString *)path AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ++ (id)templateRepositoryWithDirectory:(NSString *)path templateExtension:(NSString *)ext AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ++ (id)templateRepositoryWithDirectory:(NSString *)path templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; -+ (id)templateRepositoryWithBundle:(NSBundle *)bundle AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBundle:(NSBundle *)bundle options:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBundle:(NSBundle *)bundle templateExtension:(NSString *)ext AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBundle:(NSBundle *)bundle templateExtension:(NSString *)ext options:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBundle:(NSBundle *)bundle templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithBundle:(NSBundle *)bundle templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding options:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)templateRepositoryWithBundle:(NSBundle *)bundle AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ++ (id)templateRepositoryWithBundle:(NSBundle *)bundle templateExtension:(NSString *)ext AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; ++ (id)templateRepositoryWithBundle:(NSBundle *)bundle templateExtension:(NSString *)ext encoding:(NSStringEncoding)encoding AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; -+ (id)templateRepositoryWithPartialsDictionary:(NSDictionary *)partialsDictionary AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithPartialsDictionary:(NSDictionary *)partialsDictionary options:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)templateRepositoryWithPartialsDictionary:(NSDictionary *)partialsDictionary AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; -+ (id)templateRepository AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -+ (id)templateRepositoryWithOptions:(GRMustacheTemplateOptions)options AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; ++ (id)templateRepository AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; -- (GRMustacheTemplate *)templateForName:(NSString *)name error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; -- (GRMustacheTemplate *)templateFromString:(NSString *)templateString error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_2_0_AND_LATER; +- (GRMustacheTemplate *)templateForName:(NSString *)name error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; +- (GRMustacheTemplate *)templateFromString:(NSString *)templateString error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_3_0_AND_LATER; @end diff --git a/include/GRMustacheVersion.h b/include/GRMustacheVersion.h index 50a70c20..8c33ba8f 100644 --- a/include/GRMustacheVersion.h +++ b/include/GRMustacheVersion.h @@ -26,7 +26,7 @@ @since v1.0 */ -#define GRMUSTACHE_MAJOR_VERSION 2 +#define GRMUSTACHE_MAJOR_VERSION 3 /** The minor component of GRMustache version diff --git a/lib/libGRMustache2-MacOS.a b/lib/libGRMustache2-MacOS.a index 45ade8f8..c0d4cfd9 100644 Binary files a/lib/libGRMustache2-MacOS.a and b/lib/libGRMustache2-MacOS.a differ diff --git a/lib/libGRMustache2-iOS.a b/lib/libGRMustache2-iOS.a index 3549416e..be0833c3 100644 Binary files a/lib/libGRMustache2-iOS.a and b/lib/libGRMustache2-iOS.a differ