Permalink
Browse files

v1.9.0

  • Loading branch information...
1 parent 84618c3 commit 8020800528d19ae1941c2a7a45bcf70224756127 @groue committed Jan 23, 2012
@@ -33,12 +33,12 @@
@since v1.0
*/
-#define GRMUSTACHE_MINOR_VERSION 8
+#define GRMUSTACHE_MINOR_VERSION 9
/**
The patch-level component of GRMustache version
@since v1.0
*/
-#define GRMUSTACHE_PATCH_VERSION 6
+#define GRMUSTACHE_PATCH_VERSION 0
View
@@ -1,6 +1,17 @@
GRMustache Release Notes
========================
+## v1.9
+
+**Better lambda encapsulation with classes conforming to the GRMustacheHelper protocol.**
+
+New protocol:
+
+ @protocol GRMustacheHelper<NSObject>
+ @required
+ - (NSString *)renderSection:(GRMustacheSection *)section withContext:(id)context
+ @end
+
## v1.8.6
Fixed bug in [GRMustacheTemplate renderObjects:...]
View
@@ -33,19 +33,19 @@
@see GRYes#yes
@see GRMustache#strictBooleanMode
@see GRNo
- @since v1.0.0
+ @since v1.0
*/
@interface GRYes : NSObject <NSCopying>
/**
@deprecated Use `[NSNumber numberWithBool:YES]` instead.
- @returns the GRYes singleton.
- @since v1.0.0
+ @return the GRYes singleton.
+ @since v1.0
*/
+ (GRYes *)yes AVAILABLE_GRMUSTACHE_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_2;
/**
- @returns YES
- @since v1.1.0
+ @return YES
+ @since v1.1
*/
- (BOOL)boolValue AVAILABLE_GRMUSTACHE_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_2;
@end
@@ -62,19 +62,19 @@
@see GRNo#no
@see GRMustache#strictBooleanMode
@see GRYes
- @since v1.0.0
+ @since v1.0
*/
@interface GRNo : NSObject <NSCopying>
/**
@deprecated Use `[NSNumber numberWithBool:NO]` instead.
- @returns the GRNo singleton.
- @since v1.0.0
+ @return the GRNo singleton.
+ @since v1.0
*/
+ (GRNo *)no AVAILABLE_GRMUSTACHE_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_2;
/**
- @returns NO
- @since v1.1.0
+ @return NO
+ @since v1.1
*/
- (BOOL)boolValue AVAILABLE_GRMUSTACHE_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_2;
@end
View
@@ -34,7 +34,7 @@ typedef NSUInteger GRMustacheTemplateOptions;
/**
A C struct that hold GRMustache version information
- @since v1.0.0
+ @since v1.0
*/
typedef struct {
int major; /**< The major component of the version. */
@@ -46,7 +46,7 @@ typedef struct {
/**
The GRMustache class provides with global-level information and configuration
of the GRMustache library.
- @since v1.0.0
+ @since v1.0
*/
@interface GRMustache: NSObject
@@ -55,23 +55,21 @@ typedef struct {
//////////////////////////////////////////////////////////////////////////////////////////
/**
- @returns the version of GRMustache as a GRMustacheVersion.
+ Returns the version of GRMustache as a GRMustacheVersion struct.
- @since v1.0.0
+ @return The version of GRMustache as a GRMustacheVersion struct.
+ @since v1.0
*/
+ (GRMustacheVersion)version AVAILABLE_GRMUSTACHE_VERSION_1_0_AND_LATER;
//////////////////////////////////////////////////////////////////////////////////////////
-/// @name Handling of boolean properties
+/// @name Handling of BOOL properties
//////////////////////////////////////////////////////////////////////////////////////////
/**
- A Boolean value that determines whether GRMustache renders templates in strict
+ Returns a Boolean value that determines whether GRMustache renders templates in strict
boolean mode.
- @returns YES if GRMustache renders templates in strict boolean mode,
- NO otherwise. The default value is NO.
-
In strict boolean mode, properties of context objects that are declared as BOOL
are interpreted as numbers, and can not be used for controlling Mustache
boolean sections.
@@ -80,28 +78,80 @@ typedef struct {
those declared as BOOL), are interpreted as booleans, and can be used for
controlling Mustache boolean sections.
- @see GRMustache#setStrictBooleanMode:
- @see GRYes
- @see GRNo
- @since v1.0.0
+ @return YES if GRMustache renders templates in strict boolean mode,
+ NO otherwise. The default value is NO.
+
+ @see setStrictBooleanMode:
+ @see [GRMustacheContext valueForKey:]
+ @since v1.0
*/
+ (BOOL)strictBooleanMode AVAILABLE_GRMUSTACHE_VERSION_1_0_AND_LATER;
/**
Sets the strict boolean mode of GMustache.
- @param aBool YES if GRMustache should render templates in strict boolean mode,
+ See the documentation for strictBooleanMode for more information.
+
+ @param strictBooleanMode YES if GRMustache should render templates in strict boolean mode,
NO otherwise.
- @see GRMustache#strictBooleanMode
- @since v1.0.0
+ @see strictBooleanMode
+ @see [GRMustacheContext valueForKey:]
+ @since v1.0
*/
-+ (void)setStrictBooleanMode:(BOOL)aBool AVAILABLE_GRMUSTACHE_VERSION_1_0_AND_LATER;
++ (void)setStrictBooleanMode:(BOOL)strictBooleanMode AVAILABLE_GRMUSTACHE_VERSION_1_0_AND_LATER;
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/// @name Preventing NSUndefinedKeyException when using GRMustache in Development configuration
+//////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ Have GRMustache raise much less `NSUndefinedKeyExceptions` when rendering templates.
+
+ The rendering of a GRMustache template can lead to many `NSUndefinedKeyExceptions` to be raised, because of the heavy usage of Key-Value Coding. Those exceptions are nicely handled by GRMustache, and are part of the regular rendering of a template.
+
+ Unfortunately, when debugging a project, developers usually set their debugger to stop on every Objective-C exceptions. GRMustache rendering can thus become a huge annoyance. This method prevents it.
+
+ You'll get a slight performance hit, so you'd probably make sure this call does not enter your Release configuration.
+
+ One way to achieve this is to add `-DDEBUG` to the "Other C Flags" setting of your development configuration, and to wrap the `preventNSUndefinedKeyExceptionAttack` method call in a #if block, like:
+
+ #ifdef DEBUG
+ [GRMustache preventNSUndefinedKeyExceptionAttack];
+ #endif
+
+ @since v1.7
+ */
+ (void)preventNSUndefinedKeyExceptionAttack AVAILABLE_GRMUSTACHE_VERSION_1_7_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_1_8_AND_LATER;
+/**
+ Sets the default template options.
+
+ Those options will be used by all GRMustacheTemplate rendering and parsing methods, such as [GRMustacheTemplate parseString:error:] and [GRMustacheTemplate renderObject:fromString:error:].
+
+ For instance, you'll trigger support for the [Mustache Specification 1.1.2](https://github.com/mustache/spec) with:
+
+ [GRMustache setDefaultTemplateOptions:GRMustacheTemplateOptionMustacheSpecCompatibility];
+
+ @param templateOptions A mask of options indicating the default behavior of templates.
+ @see defaultTemplateOptions
+ @since v1.8
+ */
+ (void)setDefaultTemplateOptions:(GRMustacheTemplateOptions)templateOptions AVAILABLE_GRMUSTACHE_VERSION_1_8_AND_LATER;
@end
@@ -33,6 +33,7 @@
#define GRMUSTACHE_VERSION_1_6 1060
#define GRMUSTACHE_VERSION_1_7 1070
#define GRMUSTACHE_VERSION_1_8 1080
+#define GRMUSTACHE_VERSION_1_9 1090
@@ -44,13 +45,13 @@
#endif
/*
- * if max GRMustacheVersion not specified, assume largerof(1.8, min)
+ * if max GRMustacheVersion not specified, assume largerof(1.9, min)
*/
#ifndef GRMUSTACHE_VERSION_MAX_ALLOWED
-#if GRMUSTACHE_VERSION_MIN_REQUIRED > GRMUSTACHE_VERSION_1_8
+#if GRMUSTACHE_VERSION_MIN_REQUIRED > GRMUSTACHE_VERSION_1_9
#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_MIN_REQUIRED
#else
-#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_1_8
+#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_1_9
#endif
#endif
@@ -902,3 +903,152 @@
#endif
+
+
+
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_9_AND_LATER
+ *
+ * Used on declarations introduced in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_9_AND_LATER UNAVAILABLE_ATTRIBUTE
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_9_AND_LATER WEAK_IMPORT_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_9_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_9_AND_LATER_BUT_DEPRECATED
+ *
+ * Used on declarations introduced in GRMustache 1.9,
+ * and deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_9_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_9_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_1_9_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9
+ *
+ * Used on declarations introduced in GRMustache 1.0,
+ * but later deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 AVAILABLE_GRMUSTACHE_VERSION_1_0_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9
+ *
+ * Used on declarations introduced in GRMustache 1.1,
+ * but later deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 AVAILABLE_GRMUSTACHE_VERSION_1_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9
+ *
+ * Used on declarations introduced in GRMustache 1.2,
+ * but later deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 AVAILABLE_GRMUSTACHE_VERSION_1_2_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9
+ *
+ * Used on declarations introduced in GRMustache 1.3,
+ * but later deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 AVAILABLE_GRMUSTACHE_VERSION_1_3_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9
+ *
+ * Used on declarations introduced in GRMustache 1.4,
+ * but later deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_4_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 AVAILABLE_GRMUSTACHE_VERSION_1_4_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9
+ *
+ * Used on declarations introduced in GRMustache 1.5,
+ * but later deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_5_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 AVAILABLE_GRMUSTACHE_VERSION_1_5_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_6_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9
+ *
+ * Used on declarations introduced in GRMustache 1.6,
+ * but later deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_6_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_6_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 AVAILABLE_GRMUSTACHE_VERSION_1_6_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_7_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9
+ *
+ * Used on declarations introduced in GRMustache 1.7,
+ * but later deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_7_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_7_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 AVAILABLE_GRMUSTACHE_VERSION_1_7_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_1_8_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9
+ *
+ * Used on declarations introduced in GRMustache 1.8,
+ * but later deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define AVAILABLE_GRMUSTACHE_VERSION_1_8_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_1_8_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_1_9 AVAILABLE_GRMUSTACHE_VERSION_1_8_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_1_9_AND_LATER
+ *
+ * Used on types deprecated in GRMustache 1.9
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_1_9
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_1_9_AND_LATER DEPRECATED_ATTRIBUTE
+#else
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_1_9_AND_LATER
+#endif
+
+
Oops, something went wrong. Retry.

0 comments on commit 8020800

Please sign in to comment.