Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update 3rd party libraries.

  • Loading branch information...
commit 3a98c9686776a73bf8155a3940f2a346723173f7 1 parent b1ff4bd
Michael Morris authored

Showing 20 changed files with 1,029 additions and 327 deletions. Show diff stats Hide diff stats

  1. 8  Classes/Headers/External Libraries/GCDAsyncSocket.h
  2. 42  Classes/Headers/External Libraries/GRMustache.h
  3. 242  Classes/Headers/External Libraries/GRMustacheAvailabilityMacros.h
  4. 217  Classes/Headers/External Libraries/GRMustacheConfiguration.h
  5. 71  Classes/Headers/External Libraries/GRMustacheContext.h
  6. 29  Classes/Headers/External Libraries/GRMustacheError.h
  7. 12  Classes/Headers/External Libraries/GRMustacheFilter.h
  8. 107  Classes/Headers/External Libraries/GRMustacheLocalizer.h
  9. 9  Classes/Headers/External Libraries/GRMustacheRendering.h
  10. 28  Classes/Headers/External Libraries/GRMustacheTag.h
  11. 5  Classes/Headers/External Libraries/GRMustacheTagDelegate.h
  12. 96  Classes/Headers/External Libraries/GRMustacheTemplate.h
  13. 263  Classes/Headers/External Libraries/GRMustacheTemplateRepository.h
  14. 7  Classes/Headers/External Libraries/GRMustacheVersion.h
  15. 26  Classes/Headers/TextualApplication.h
  16. 46  Classes/Library/External Libraries/Sockets/GCDAsyncSocket.m
  17. 35  Classes/Library/External Libraries/Sockets/RLMAsyncSocket.m
  18. BIN  Frameworks/Mustache Templates/libmustache.a
  19. 109  Main Project (Textual).xcodeproj/project.pbxproj
  20. 4  Resources/Info.plist
8  Classes/Headers/External Libraries/GCDAsyncSocket.h
@@ -1028,8 +1028,8 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
1028 1028
  * Note that this method may be called multiple times for a single read if you return positive numbers.
1029 1029
  **/
1030 1030
 - (NSTimeInterval)socket:(GCDAsyncSocket *)sock shouldTimeoutReadWithTag:(long)tag
1031  
-				 elapsed:(NSTimeInterval)elapsed
1032  
-			   bytesDone:(NSUInteger)length;
  1031
+                 elapsed:(NSTimeInterval)elapsed
  1032
+               bytesDone:(NSUInteger)length;
1033 1033
 
1034 1034
 /**
1035 1035
  * Called if a write operation has reached its timeout without completing.
@@ -1043,8 +1043,8 @@ typedef enum GCDAsyncSocketError GCDAsyncSocketError;
1043 1043
  * Note that this method may be called multiple times for a single write if you return positive numbers.
1044 1044
  **/
1045 1045
 - (NSTimeInterval)socket:(GCDAsyncSocket *)sock shouldTimeoutWriteWithTag:(long)tag
1046  
-				 elapsed:(NSTimeInterval)elapsed
1047  
-			   bytesDone:(NSUInteger)length;
  1046
+                 elapsed:(NSTimeInterval)elapsed
  1047
+               bytesDone:(NSUInteger)length;
1048 1048
 
1049 1049
 /**
1050 1050
  * Conditionally called if the read stream closes, but the write stream may still be writeable.
42  Classes/Headers/External Libraries/GRMustache.h 100755 → 100644
... ...
@@ -1,6 +1,6 @@
1 1
 // The MIT License
2 2
 // 
3  
-// Copyright (c) 2012 Gwendal Roué
  3
+// Copyright (c) 2013 Gwendal Roué
4 4
 // 
5 5
 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
 // of this software and associated documentation files (the "Software"), to deal
@@ -20,10 +20,10 @@
20 20
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 21
 // THE SOFTWARE.
22 22
 
23  
-#import "TextualApplication.h"
  23
+#import <Foundation/Foundation.h>
  24
+#import "GRMustacheAvailabilityMacros.h"
24 25
 
25 26
 @protocol GRMustacheRendering;
26  
-
27 27
 @class GRMustacheTag;
28 28
 @class GRMustacheContext;
29 29
 @class GRMustacheTemplateRepository;
@@ -59,8 +59,9 @@ typedef struct {
59 59
  */
60 60
 + (GRMustacheVersion)version AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
61 61
 
  62
+
62 63
 ////////////////////////////////////////////////////////////////////////////////
63  
-/// @name Preventing NSUndefinedKeyException when using GRMustache in Development configuration
  64
+/// @name Preventing NSUndefinedKeyException in Development configuration
64 65
 ////////////////////////////////////////////////////////////////////////////////
65 66
 
66 67
 /**
@@ -81,17 +82,34 @@ typedef struct {
81 82
  * 
82 83
  * One way to achieve this is to add `-DDEBUG` to the "Other C Flags" setting of
83 84
  * your development configuration, and to wrap the
84  
- * `prevenRZUndefinedKeyExceptionAttack` method call in a #if block, like:
  85
+ * `preventNSUndefinedKeyExceptionAttack` method call in a #if block, like:
85 86
  * 
86 87
  *     #ifdef DEBUG
87  
- *     [GRMustache prevenRZUndefinedKeyExceptionAttack];
  88
+ *     [GRMustache preventNSUndefinedKeyExceptionAttack];
88 89
  *     #endif
89 90
  * 
90 91
  * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/runtime.md
91 92
  * 
92 93
  * @since v1.7
93 94
  */
94  
-+ (void)prevenRZUndefinedKeyExceptionAttack AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
  95
++ (void)preventNSUndefinedKeyExceptionAttack AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
  96
+
  97
+
  98
+////////////////////////////////////////////////////////////////////////////////
  99
+/// @name Standard Library
  100
+////////////////////////////////////////////////////////////////////////////////
  101
+
  102
+/**
  103
+ * @return The GRMustache standard library.
  104
+ *
  105
+ * @since v6.4
  106
+ */
  107
++ (NSObject *)standardLibrary AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  108
+
  109
+
  110
+////////////////////////////////////////////////////////////////////////////////
  111
+/// @name Building rendering objects
  112
+////////////////////////////////////////////////////////////////////////////////
95 113
 
96 114
 /**
97 115
  * Returns a rendering object that is able to render the argument _object_ for
@@ -116,11 +134,15 @@ typedef struct {
116 134
 /**
117 135
  * Returns a rendering object that renders with the provided block.
118 136
  *
119  
- * @param block  A block that returns a tag rendering, provided with a rendering
120  
- *               context.
  137
+ * @param block  A block that follows the semantics of the
  138
+ *               renderForMustacheTag:context:HTMLSafe:error: method defined by
  139
+ *               the GRMustacheRendering protocol. See the documentation of this
  140
+ *               method.
121 141
  *
122 142
  * @return A rendering object
123 143
  *
  144
+ * @see GRMustacheRendering protocol
  145
+ *
124 146
  * @since v6.0
125 147
  */
126 148
 + (id<GRMustacheRendering>)renderingObjectWithBlock:(NSString *(^)(GRMustacheTag *tag, GRMustacheContext *context, BOOL *HTMLSafe, NSError **error))block AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
@@ -136,3 +158,5 @@ typedef struct {
136 158
 #import "GRMustacheContext.h"
137 159
 #import "GRMustacheRendering.h"
138 160
 #import "GRMustacheTag.h"
  161
+#import "GRMustacheConfiguration.h"
  162
+#import "GRMustacheLocalizer.h"
242  Classes/Headers/External Libraries/GRMustacheAvailabilityMacros.h 100755 → 100644
... ...
@@ -1,6 +1,6 @@
1 1
 // The MIT License
2 2
 // 
3  
-// Copyright (c) 2012 Gwendal Roué
  3
+// Copyright (c) 2013 Gwendal Roué
4 4
 // 
5 5
 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
 // of this software and associated documentation files (the "Software"), to deal
@@ -20,7 +20,7 @@
20 20
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 21
 // THE SOFTWARE.
22 22
 
23  
-#import "TextualApplication.h"
  23
+
24 24
 
25 25
 
26 26
 
@@ -30,6 +30,9 @@
30 30
  */
31 31
 #define GRMUSTACHE_VERSION_6_0  6000
32 32
 #define GRMUSTACHE_VERSION_6_1  6010
  33
+#define GRMUSTACHE_VERSION_6_2  6020
  34
+#define GRMUSTACHE_VERSION_6_3  6030
  35
+#define GRMUSTACHE_VERSION_6_4  6040
33 36
 
34 37
 
35 38
 
@@ -37,10 +40,10 @@
37 40
 
38 41
 
39 42
 /* 
40  
- * If max GRMustacheVersion not specified, assume 6.1
  43
+ * If max GRMustacheVersion not specified, assume 6.4
41 44
  */
42 45
 #ifndef GRMUSTACHE_VERSION_MAX_ALLOWED
43  
-#define GRMUSTACHE_VERSION_MAX_ALLOWED    GRMUSTACHE_VERSION_6_1
  46
+#define GRMUSTACHE_VERSION_MAX_ALLOWED    GRMUSTACHE_VERSION_6_4
44 47
 #endif
45 48
 
46 49
 /*
@@ -145,3 +148,234 @@
145 148
 
146 149
 
147 150
 
  151
+/*
  152
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
  153
+ * 
  154
+ * Used on declarations introduced in GRMustache 6.2
  155
+ */
  156
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_2
  157
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER    UNAVAILABLE_ATTRIBUTE
  158
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_2
  159
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER    WEAK_IMPORT_ATTRIBUTE
  160
+#else
  161
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
  162
+#endif
  163
+
  164
+/*
  165
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED
  166
+ * 
  167
+ * Used on declarations introduced in GRMustache 6.2,
  168
+ * and deprecated in GRMustache 6.2
  169
+ */
  170
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_2
  171
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED    DEPRECATED_ATTRIBUTE
  172
+#else
  173
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED    AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
  174
+#endif
  175
+
  176
+/*
  177
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2
  178
+ * 
  179
+ * Used on declarations introduced in GRMustache 6.0,
  180
+ * but later deprecated in GRMustache 6.2
  181
+ */
  182
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_2
  183
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2    DEPRECATED_ATTRIBUTE
  184
+#else
  185
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2    AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
  186
+#endif
  187
+
  188
+/*
  189
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2
  190
+ * 
  191
+ * Used on declarations introduced in GRMustache 6.1,
  192
+ * but later deprecated in GRMustache 6.2
  193
+ */
  194
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_2
  195
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2    DEPRECATED_ATTRIBUTE
  196
+#else
  197
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_2    AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
  198
+#endif
  199
+
  200
+/*
  201
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_2_AND_LATER
  202
+ * 
  203
+ * Used on types deprecated in GRMustache 6.2
  204
+ */
  205
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_2
  206
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_2_AND_LATER    DEPRECATED_ATTRIBUTE
  207
+#else
  208
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_2_AND_LATER
  209
+#endif
  210
+
  211
+
  212
+
  213
+
  214
+
  215
+
  216
+/*
  217
+ * AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
  218
+ * 
  219
+ * Used on declarations introduced in GRMustache 6.3
  220
+ */
  221
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_3
  222
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER    UNAVAILABLE_ATTRIBUTE
  223
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_3
  224
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER    WEAK_IMPORT_ATTRIBUTE
  225
+#else
  226
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
  227
+#endif
  228
+
  229
+/*
  230
+ * AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED
  231
+ * 
  232
+ * Used on declarations introduced in GRMustache 6.3,
  233
+ * and deprecated in GRMustache 6.3
  234
+ */
  235
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_3
  236
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED    DEPRECATED_ATTRIBUTE
  237
+#else
  238
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED    AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
  239
+#endif
  240
+
  241
+/*
  242
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3
  243
+ * 
  244
+ * Used on declarations introduced in GRMustache 6.0,
  245
+ * but later deprecated in GRMustache 6.3
  246
+ */
  247
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_3
  248
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3    DEPRECATED_ATTRIBUTE
  249
+#else
  250
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3    AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
  251
+#endif
  252
+
  253
+/*
  254
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3
  255
+ * 
  256
+ * Used on declarations introduced in GRMustache 6.1,
  257
+ * but later deprecated in GRMustache 6.3
  258
+ */
  259
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_3
  260
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3    DEPRECATED_ATTRIBUTE
  261
+#else
  262
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3    AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
  263
+#endif
  264
+
  265
+/*
  266
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3
  267
+ * 
  268
+ * Used on declarations introduced in GRMustache 6.2,
  269
+ * but later deprecated in GRMustache 6.3
  270
+ */
  271
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_3
  272
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3    DEPRECATED_ATTRIBUTE
  273
+#else
  274
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_3    AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
  275
+#endif
  276
+
  277
+/*
  278
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_3_AND_LATER
  279
+ * 
  280
+ * Used on types deprecated in GRMustache 6.3
  281
+ */
  282
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_3
  283
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_3_AND_LATER    DEPRECATED_ATTRIBUTE
  284
+#else
  285
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_3_AND_LATER
  286
+#endif
  287
+
  288
+
  289
+
  290
+
  291
+
  292
+
  293
+/*
  294
+ * AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER
  295
+ * 
  296
+ * Used on declarations introduced in GRMustache 6.4
  297
+ */
  298
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_6_4
  299
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER    UNAVAILABLE_ATTRIBUTE
  300
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_6_4
  301
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER    WEAK_IMPORT_ATTRIBUTE
  302
+#else
  303
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER
  304
+#endif
  305
+
  306
+/*
  307
+ * AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED
  308
+ * 
  309
+ * Used on declarations introduced in GRMustache 6.4,
  310
+ * and deprecated in GRMustache 6.4
  311
+ */
  312
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
  313
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED    DEPRECATED_ATTRIBUTE
  314
+#else
  315
+#define AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER_BUT_DEPRECATED    AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER
  316
+#endif
  317
+
  318
+/*
  319
+ * AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4
  320
+ * 
  321
+ * Used on declarations introduced in GRMustache 6.0,
  322
+ * but later deprecated in GRMustache 6.4
  323
+ */
  324
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
  325
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4    DEPRECATED_ATTRIBUTE
  326
+#else
  327
+#define AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4    AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER
  328
+#endif
  329
+
  330
+/*
  331
+ * AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4
  332
+ * 
  333
+ * Used on declarations introduced in GRMustache 6.1,
  334
+ * but later deprecated in GRMustache 6.4
  335
+ */
  336
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
  337
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4    DEPRECATED_ATTRIBUTE
  338
+#else
  339
+#define AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4    AVAILABLE_GRMUSTACHE_VERSION_6_1_AND_LATER
  340
+#endif
  341
+
  342
+/*
  343
+ * AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4
  344
+ * 
  345
+ * Used on declarations introduced in GRMustache 6.2,
  346
+ * but later deprecated in GRMustache 6.4
  347
+ */
  348
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
  349
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4    DEPRECATED_ATTRIBUTE
  350
+#else
  351
+#define AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4    AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER
  352
+#endif
  353
+
  354
+/*
  355
+ * AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4
  356
+ * 
  357
+ * Used on declarations introduced in GRMustache 6.3,
  358
+ * but later deprecated in GRMustache 6.4
  359
+ */
  360
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
  361
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4    DEPRECATED_ATTRIBUTE
  362
+#else
  363
+#define AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_6_4    AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER
  364
+#endif
  365
+
  366
+/*
  367
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_6_4_AND_LATER
  368
+ * 
  369
+ * Used on types deprecated in GRMustache 6.4
  370
+ */
  371
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_6_4
  372
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_4_AND_LATER    DEPRECATED_ATTRIBUTE
  373
+#else
  374
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_6_4_AND_LATER
  375
+#endif
  376
+
  377
+
  378
+
  379
+
  380
+
  381
+
217  Classes/Headers/External Libraries/GRMustacheConfiguration.h
... ...
@@ -0,0 +1,217 @@
  1
+// The MIT License
  2
+//
  3
+// Copyright (c) 2013 Gwendal Roué
  4
+//
  5
+// Permission is hereby granted, free of charge, to any person obtaining a copy
  6
+// of this software and associated documentation files (the "Software"), to deal
  7
+// in the Software without restriction, including without limitation the rights
  8
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9
+// copies of the Software, and to permit persons to whom the Software is
  10
+// furnished to do so, subject to the following conditions:
  11
+//
  12
+// The above copyright notice and this permission notice shall be included in
  13
+// all copies or substantial portions of the Software.
  14
+//
  15
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21
+// THE SOFTWARE.
  22
+
  23
+#import <Foundation/Foundation.h>
  24
+#import "GRMustacheAvailabilityMacros.h"
  25
+
  26
+@class GRMustacheContext;
  27
+
  28
+/**
  29
+ * The content type of strings rendered by templates.
  30
+ *
  31
+ * @see GRMustacheConfiguration
  32
+ * @see GRMustacheTemplateRepository
  33
+ *
  34
+ * @since v6.2
  35
+ */
  36
+typedef NS_ENUM(NSUInteger, GRMustacheContentType) {
  37
+    /**
  38
+     * The `GRMustacheContentTypeHTML` content type has templates render HTML.
  39
+     * HTML template escape the input of variable tags such as `{{name}}`. Use
  40
+     * triple mustache tags `{{{content}}}` in order to avoid the HTML-escaping.
  41
+     *
  42
+     * @since v6.2
  43
+     */
  44
+    GRMustacheContentTypeHTML AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER,
  45
+
  46
+    /**
  47
+     * The `GRMustacheContentTypeText` content type has templates render text.
  48
+     * They do not HTML-escape their input: `{{name}}` and `{{{name}}}` have
  49
+     * identical renderings.
  50
+     *
  51
+     * @since v6.2
  52
+     */
  53
+    GRMustacheContentTypeText AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER,
  54
+} AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER;
  55
+
  56
+/**
  57
+ * A GRMustacheConfiguration instance configures GRMustache rendering.
  58
+ *
  59
+ * The default configuration [GRMustacheConfiguration defaultConfiguration]
  60
+ * applies to all GRMustache rendering by default:
  61
+ *
  62
+ *     // Have GRMustache templates render text by default,
  63
+ *     // and do not HTML-escape their input.
  64
+ *     [GRMustacheConfiguration defaultConfiguration].contentType = GRMustacheContentTypeText;
  65
+ *
  66
+ * You can also alter the configuration of a specific template repository: its
  67
+ * configuration only applies to the templates built by this very template
  68
+ * repository:
  69
+ *
  70
+ *     // All templates loaded from _repo_ will use [[ and ]] as tag delimiters.
  71
+ *     GRMustacheTemplateRepository *repo = [GRMustacheTemplateRepository templateRepositoryWithBundle:nil];
  72
+ *     repo.configuration.tagStartDelimiter = @"[[";
  73
+ *     repo.configuration.tagEndDelimiter = @"]]";
  74
+ *
  75
+ * A third option is to create a new configuration, and assign it to the template:
  76
+ *
  77
+ *     // Create a configuration
  78
+ *     GRMustacheConfiguration *configuration = [GRMustacheConfiguration configuration];
  79
+ *     configuration.... // setup
  80
+ *
  81
+ *     GRMustacheTemplateRepository *repo = [GRMustacheTemplateRepository templateRepositoryWithBundle:nil];
  82
+ *     repo.configuration = configuration;
  83
+ *
  84
+ * The `contentType` option can be specified at the template level, so that your
  85
+ * repositories can mix HTML and text templates: see the documentation of this
  86
+ * property.
  87
+ *
  88
+ * The `tagStartDelimiter` and `tagEndDelimiter` options can also be specified
  89
+ * at the template level, using a "Set Delimiters tag": see the documentation of
  90
+ * these properties.
  91
+ *
  92
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/configuration.md
  93
+ *
  94
+ * @see GRMustacheTemplateRepository
  95
+ *
  96
+ * @since v6.2
  97
+ */
  98
+@interface GRMustacheConfiguration : NSObject<NSCopying> {
  99
+    GRMustacheContentType _contentType;
  100
+    NSString *_tagStartDelimiter;
  101
+    NSString *_tagEndDelimiter;
  102
+    GRMustacheContext *_baseContext;
  103
+    BOOL _locked;
  104
+}
  105
+
  106
+
  107
+////////////////////////////////////////////////////////////////////////////////
  108
+/// @name Default Configuration
  109
+////////////////////////////////////////////////////////////////////////////////
  110
+
  111
+
  112
+/**
  113
+ * The default configuration.
  114
+ *
  115
+ * All templates and template repositories use the default configuration unless
  116
+ * you specify otherwise by setting the configuration of a template repository.
  117
+ *
  118
+ * The "default" defaultConfiguration has GRMustacheContentTypeHTML contentType,
  119
+ * and {{ and }} as tag delimiters.
  120
+ *
  121
+ * @returns The default configuration.
  122
+ *
  123
+ * @since v6.2
  124
+ */
  125
++ (GRMustacheConfiguration *)defaultConfiguration AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER;
  126
+
  127
+
  128
+////////////////////////////////////////////////////////////////////////////////
  129
+/// @name Creating Configuration
  130
+////////////////////////////////////////////////////////////////////////////////
  131
+
  132
+
  133
+/**
  134
+ * @returns A new factory configuration.
  135
+ *
  136
+ * Its contentType is GRMustacheContentTypeHTML.
  137
+ * Its tag delimiters are {{ and }}.
  138
+ *
  139
+ * @since v6.2
  140
+ */
  141
++ (GRMustacheConfiguration *)configuration AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER;
  142
+
  143
+
  144
+////////////////////////////////////////////////////////////////////////////////
  145
+/// @name Set Up Configuration
  146
+////////////////////////////////////////////////////////////////////////////////
  147
+
  148
+
  149
+/**
  150
+ * The base context for templates rendering. The default base context contains
  151
+ * the GRMustache standard Library.
  152
+ *
  153
+ * @see GRMustacheTemplate
  154
+ *
  155
+ * @since v6.4
  156
+ */
  157
+@property (nonatomic, retain) GRMustacheContext *baseContext AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  158
+
  159
+/**
  160
+ * The content type of strings rendered by templates.
  161
+ *
  162
+ * This property affects the HTML-escaping of your data, and the inclusion
  163
+ * of templates in other templates.
  164
+ *
  165
+ * The `GRMustacheContentTypeHTML` content type has templates render HTML.
  166
+ * This is the default behavior. HTML template escape the input of variable tags
  167
+ * such as `{{name}}`. Use triple mustache tags `{{{content}}}` in order to
  168
+ * avoid the HTML-escaping.
  169
+ *
  170
+ * The `GRMustacheContentTypeText` content type has templates render text.
  171
+ * They do not HTML-escape their input: `{{name}}` and `{{{name}}}` have
  172
+ * identical renderings.
  173
+ *
  174
+ * GRMustache safely keeps track of the content type of templates: should a HTML
  175
+ * template embed a text template, the content of the text template would be
  176
+ * HTML-escaped.
  177
+ *
  178
+ * There is no API to specify the content type of individual templates. However,
  179
+ * you can use pragma tags right in the content of your templates:
  180
+ *
  181
+ * - `{{% CONTENT_TYPE:TEXT }}` turns a template into a text template.
  182
+ * - `{{% CONTENT_TYPE:HTML }}` turns a template into a HTML template.
  183
+ *
  184
+ * Insert those pragma tags early in your templates. For example:
  185
+ *
  186
+ *     {{! This template renders a bash script. }}
  187
+ *     {{% CONTENT_TYPE:TEXT }}
  188
+ *     export LANG={{ENV.LANG}}
  189
+ *     ...
  190
+ *
  191
+ * Should two such pragmas be found in a template content, the last one wins.
  192
+ *
  193
+ * @since v6.2
  194
+ */
  195
+@property (nonatomic) GRMustacheContentType contentType AVAILABLE_GRMUSTACHE_VERSION_6_2_AND_LATER;
  196
+
  197
+/**
  198
+ * The opening delimiter for Mustache tags. Its default value is @"{{".
  199
+ *
  200
+ * You can also change the delimiters right in your templates using a "Set
  201
+ * Delimiter tag": {{=[[ ]]=}} changes start and end delimiters to [[ and ]].
  202
+ *
  203
+ * @since v6.4
  204
+ */
  205
+@property (nonatomic, copy) NSString *tagStartDelimiter AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  206
+
  207
+/**
  208
+ * The closing delimiter for Mustache tags. Its default value is @"}}".
  209
+ *
  210
+ * You can also change the delimiters right in your templates using a "Set
  211
+ * Delimiter tag": {{=[[ ]]=}} changes start and end delimiters to [[ and ]].
  212
+ *
  213
+ * @since v6.4
  214
+ */
  215
+@property (nonatomic, copy) NSString *tagEndDelimiter AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  216
+
  217
+@end
71  Classes/Headers/External Libraries/GRMustacheContext.h 100755 → 100644
... ...
@@ -1,6 +1,6 @@
1 1
 // The MIT License
2 2
 //
3  
-// Copyright (c) 2012 Gwendal Roué
  3
+// Copyright (c) 2013 Gwendal Roué
4 4
 //
5 5
 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
 // of this software and associated documentation files (the "Software"), to deal
@@ -21,9 +21,9 @@
21 21
 // THE SOFTWARE.
22 22
 
23 23
 #import <objc/message.h>
24  
-
25  
-#import "TextualApplication.h"
26  
-#import "GRMustacheTagDelegate.h" // @protocol
  24
+#import <Foundation/Foundation.h>
  25
+#import "GRMustacheAvailabilityMacros.h"
  26
+#import "GRMustacheTagDelegate.h"
27 27
 
28 28
 /**
29 29
  * The GRMustacheContext represents a Mustache rendering context: it internally
@@ -34,9 +34,6 @@
34 34
  * - a *tag delegate stack*, so that tag delegates are notified when a Mustache
35 35
  *   tag is rendered.
36 36
  *
37  
- * You may derive new rendering contexts when you implement *rendering objects*,
38  
- * using the contextByAddingObject: and contextByAddingTagDelegate: methods.
39  
- *
40 37
  * @see GRMustacheRendering protocol
41 38
  */
42 39
 @interface GRMustacheContext : NSObject {
@@ -53,6 +50,64 @@
53 50
     id _templateOverride;
54 51
 }
55 52
 
  53
+
  54
+////////////////////////////////////////////////////////////////////////////////
  55
+/// @name Creating Contexts
  56
+////////////////////////////////////////////////////////////////////////////////
  57
+
  58
+
  59
+/**
  60
+ * @return An empty rendering context.
  61
+ *
  62
+ * @since v6.4
  63
+ */
  64
++ (instancetype)context AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  65
+
  66
+/**
  67
+ * Returns a context with _object_ at the top of the context stack.
  68
+ *
  69
+ * If _object_ conforms to the GRMustacheTemplateDelegate protocol, it is also
  70
+ * made the top of the tag delegate stack.
  71
+ *
  72
+ * @param object  An object
  73
+ *
  74
+ * @return A rendering context.
  75
+ *
  76
+ * @since v6.4
  77
+ */
  78
++ (instancetype)contextWithObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  79
+
  80
+/**
  81
+ * Returns a context with _object_ at the top of the protected context stack.
  82
+ *
  83
+ * Unlike contextWithObject:, this method does not put the object to the
  84
+ * tag delegate stack if it conforms to the GRMustacheTemplateDelegate protocol.
  85
+ *
  86
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/protected_context.md
  87
+ *
  88
+ * @param object  An object
  89
+ *
  90
+ * @return A rendering context.
  91
+ *
  92
+ * @since v6.4
  93
+ */
  94
++ (instancetype)contextWithProtectedObject:(id)object AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  95
+
  96
+/**
  97
+ * Returns a context with _tagDelegate_ at the top of the tag delegate stack.
  98
+ *
  99
+ * @param tagDelegate  A tag delegate
  100
+ *
  101
+ * @return A rendering context.
  102
+ */
  103
++ (instancetype)contextWithTagDelegate:(id<GRMustacheTagDelegate>)tagDelegate AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  104
+
  105
+
  106
+////////////////////////////////////////////////////////////////////////////////
  107
+/// @name Deriving New Contexts
  108
+////////////////////////////////////////////////////////////////////////////////
  109
+
  110
+
56 111
 /**
57 112
  * Returns a new rendering context that is the copy of the receiver, and the
58 113
  * given object added at the top of the context stack.
@@ -75,6 +130,8 @@
75 130
  * Unlike contextByAddingObject:, this method does not add the object to the
76 131
  * tag delegate stack if it conforms to the GRMustacheTemplateDelegate protocol.
77 132
  *
  133
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/protected_context.md
  134
+ *
78 135
  * @param object  An object
79 136
  *
80 137
  * @return A new rendering context.
29  Classes/Headers/External Libraries/GRMustacheError.h 100755 → 100644
... ...
@@ -1,6 +1,6 @@
1 1
 // The MIT License
2 2
 //
3  
-// Copyright (c) 2012 Gwendal Roué
  3
+// Copyright (c) 2013 Gwendal Roué
4 4
 //
5 5
 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
 // of this software and associated documentation files (the "Software"), to deal
@@ -20,14 +20,16 @@
20 20
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 21
 // THE SOFTWARE.
22 22
 
23  
-#import "TextualApplication.h"
  23
+#import <Foundation/Foundation.h>
  24
+#import "GRMustacheAvailabilityMacros.h"
  25
+
24 26
 
25 27
 /**
26 28
  * The codes of a GRMustache-generated NSError
27 29
  *
28 30
  * @since v1.0
29 31
  */
30  
-typedef enum {
  32
+typedef NS_ENUM(NSInteger, GRMustacheErrorCode) {
31 33
     /**
32 34
      * The error code for parse errors.
33 35
      *
@@ -41,8 +43,15 @@ typedef enum {
41 43
      * @since v1.0
42 44
      */
43 45
     GRMustacheErrorCodeTemplateNotFound AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER,
  46
+    
  47
+    /**
  48
+     * The error code for not rendering errors.
  49
+     *
  50
+     * @since v6.3
  51
+     */
  52
+    GRMustacheErrorCodeRenderingError AVAILABLE_GRMUSTACHE_VERSION_6_3_AND_LATER,
44 53
 
45  
-} GRMustacheErrorCode AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
  54
+} AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
46 55
 
47 56
 
48 57
 /**
@@ -50,19 +59,13 @@ typedef enum {
50 59
  *
51 60
  * @since v1.0
52 61
  */
53  
-extern NSString* const GRMustacheErrorDomain AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
  62
+extern NSString *const GRMustacheErrorDomain AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
54 63
 
55 64
 
56 65
 /**
57  
- * The name of exceptions raised by GRMustache when rendering a template,
58  
- * whenever:
59  
- *
60  
- * - a filter is missing.
61  
- * - an object expected to conform to the <GRMustacheFilter> protocol does not.
62  
- *
63  
- * @see GRMustacheFilter protocol
  66
+ * The name of exceptions raised by GRMustache when rendering a template.
64 67
  *
65 68
  * @since v5.1
66 69
  */
67  
-extern NSString * const GRMustacheRenderingException AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
  70
+extern NSString *const GRMustacheRenderingException AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
68 71
 
12  Classes/Headers/External Libraries/GRMustacheFilter.h 100755 → 100644
... ...
@@ -1,6 +1,6 @@
1 1
 // The MIT License
2 2
 // 
3  
-// Copyright (c) 2012 Gwendal Roué
  3
+// Copyright (c) 2013 Gwendal Roué
4 4
 // 
5 5
 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
 // of this software and associated documentation files (the "Software"), to deal
@@ -20,7 +20,9 @@
20 20
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 21
 // THE SOFTWARE.
22 22
 
23  
-#import "TextualApplication.h"
  23
+#import <Foundation/Foundation.h>
  24
+#import "GRMustacheAvailabilityMacros.h"
  25
+
24 26
 
25 27
 // =============================================================================
26 28
 #pragma mark - <GRMustacheFilter>
@@ -32,7 +34,7 @@
32 34
  * The responsability of a GRMustacheFilter is to transform a value into
33 35
  * another.
34 36
  *
35  
- * For instance, the tag `{{ uppercase(name) }}` uses a filter object that
  37
+ * For example, the tag `{{ uppercase(name) }}` uses a filter object that
36 38
  * returns the uppercase version of its input.
37 39
  *
38 40
  * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/runtime/filters.md
@@ -92,7 +94,7 @@
92 94
  *
93 95
  * @see variadicFilterWithBlock:
94 96
  */
95  
-+ (id)filterWithBlock:(id(^)(id value))block AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
  97
++ (id<GRMustacheFilter>)filterWithBlock:(id(^)(id value))block AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
96 98
 
97 99
 /**
98 100
  * Returns a GRMustacheFilter object that executes the provided block, given an
@@ -113,6 +115,6 @@
113 115
  *
114 116
  * @see filterWithBlock:
115 117
  */
116  
-+ (id)variadicFilterWithBlock:(id(^)(NSArray *arguments))block AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
  118
++ (id<GRMustacheFilter>)variadicFilterWithBlock:(id(^)(NSArray *arguments))block AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
117 119
 
118 120
 @end
107  Classes/Headers/External Libraries/GRMustacheLocalizer.h
... ...
@@ -0,0 +1,107 @@
  1
+// The MIT License
  2
+//
  3
+// Copyright (c) 2013 Gwendal Roué
  4
+//
  5
+// Permission is hereby granted, free of charge, to any person obtaining a copy
  6
+// of this software and associated documentation files (the "Software"), to deal
  7
+// in the Software without restriction, including without limitation the rights
  8
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9
+// copies of the Software, and to permit persons to whom the Software is
  10
+// furnished to do so, subject to the following conditions:
  11
+//
  12
+// The above copyright notice and this permission notice shall be included in
  13
+// all copies or substantial portions of the Software.
  14
+//
  15
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21
+// THE SOFTWARE.
  22
+
  23
+#import <Foundation/Foundation.h>
  24
+#import "GRMustacheAvailabilityMacros.h"
  25
+#import "GRMustacheRendering.h"
  26
+#import "GRMustacheFilter.h"
  27
+
  28
+/**
  29
+ * GRMustacheLocalizer can localize the content of a Mustache section.
  30
+ * It also has a filter facet that localizes your data.
  31
+ *
  32
+ * The GRMustache standard library has a `localize` key which returns a
  33
+ * GRMustacheLocalizer that localizes just like the NSLocalizableString macro
  34
+ * does: with the Localizable.strings table of the main bundle.
  35
+ *
  36
+ * ### Localizing data:
  37
+ *
  38
+ * `{{ localize(greeting) }}` renders `NSLocalizedString(@"Hello", nil)`,
  39
+ * assuming the `greeting` key resolves to the @"Hello" string.
  40
+ *
  41
+ * ### Localizing sections:
  42
+ *
  43
+ * `{{#localize}}Hello{{/localize}}` renders `NSLocalizedString(@"Hello", nil)`.
  44
+ *
  45
+ * ### Localizing sections with arguments:
  46
+ *
  47
+ * `{{#localize}}Hello {{name}}{{/localize}}` builds the format string
  48
+ * @"Hello %@", localizes it with NSLocalizedString, and finally
  49
+ * injects the name with `[NSString stringWithFormat:]`.
  50
+ *
  51
+ * ### Localize sections with arguments and conditions:
  52
+ *
  53
+ * `{{#localize}}Good morning {{#title}}{{title}}{{/title}} {{name}}{{/localize}}`
  54
+ * build the format string @"Good morning %@" or @"Good morning %@ %@",
  55
+ * depending on the presence of the `title` key. It then injects the name, or
  56
+ * both title and name, with `[NSString stringWithFormat:]`, to build the final
  57
+ * rendering.
  58
+ *
  59
+ * ### Custom GRMustacheLocalizer
  60
+ *
  61
+ * You can build your own localizing helper with the initWithBundle:tableName:
  62
+ * method. The helper would then localize using the specified table from the
  63
+ * specified bundle.
  64
+ *
  65
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/standard_library.md#localize
  66
+ *
  67
+ * @since v6.4
  68
+ */
  69
+@interface GRMustacheLocalizer : NSObject<GRMustacheRendering, GRMustacheFilter> {
  70
+@private
  71
+    NSBundle *_bundle;
  72
+    NSString *_tableName;
  73
+    NSMutableArray *_formatArguments;
  74
+}
  75
+
  76
+/**
  77
+ * Returns an initialized localizing helper.
  78
+ *
  79
+ * @param bundle     The bundle where to look for localized strings. If nil, the
  80
+ *                   main bundle is used.
  81
+ * @param tableName  The table where to look for localized strings. If nil, the
  82
+ *                   default Localizable.strings table would be searched.
  83
+ *
  84
+ * @return A newly initialized localizing helper.
  85
+ *
  86
+ * @since v6.4
  87
+ */
  88
+- (id)initWithBundle:(NSBundle *)bundle tableName:(NSString *)tableName AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  89
+
  90
+/**
  91
+ * The bundle where to look for localized strings.
  92
+ *
  93
+ * @since v6.4
  94
+ */
  95
+@property (nonatomic, retain, readonly) NSBundle *bundle AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  96
+
  97
+/**
  98
+ * The table where to look for localized strings.
  99
+ *
  100
+ * If nil, the default Localizable.strings table would be searched.
  101
+ *
  102
+ * @since v6.4
  103
+ */
  104
+@property (nonatomic, retain, readonly) NSString *tableName AVAILABLE_GRMUSTACHE_VERSION_6_4_AND_LATER;
  105
+
  106
+@end
  107
+
9  Classes/Headers/External Libraries/GRMustacheRendering.h 100755 → 100644
... ...
@@ -1,6 +1,6 @@
1 1
 // The MIT License
2 2
 //
3  
-// Copyright (c) 2012 Gwendal Roué
  3
+// Copyright (c) 2013 Gwendal Roué
4 4
 //
5 5
 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
 // of this software and associated documentation files (the "Software"), to deal
@@ -20,7 +20,8 @@
20 20
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 21
 // THE SOFTWARE.
22 22
 
23  
-#import "TextualApplication.h"
  23
+#import <Foundation/Foundation.h>
  24
+#import "GRMustacheAvailabilityMacros.h"
24 25
 
25 26
 @class GRMustacheContext;
26 27
 @class GRMustacheTag;
@@ -42,6 +43,9 @@
42 43
  * Input values are the tag that should be rendered, and the context object that
43 44
  * represents the current context stack.
44 45
  *
  46
+ * Depending on the content type of the currently rendered template, an output
  47
+ * parameter _HTMLSafe_ set to NO will have the returned string HTML-escaped.
  48
+ *
45 49
  * @param tag       The tag to be rendered
46 50
  * @param context   A context for rendering inner tags.
47 51
  * @param HTMLSafe  Upon return contains YES if the result is HTML-safe.
@@ -53,6 +57,7 @@
53 57
  *
54 58
  * @see GRMustacheTag
55 59
  * @see GRMustacheContext
  60
+ * @see GRMustacheContentType
56 61
  */
57 62
 - (NSString *)renderForMustacheTag:(GRMustacheTag *)tag
58 63
                            context:(GRMustacheContext *)context
28  Classes/Headers/External Libraries/GRMustacheTag.h 100755 → 100644
... ...
@@ -1,6 +1,6 @@
1 1
 // The MIT License
2 2
 //
3  
-// Copyright (c) 2012 Gwendal Roué
  3
+// Copyright (c) 2013 Gwendal Roué
4 4
 //
5 5
 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 6
 // of this software and associated documentation files (the "Software"), to deal
@@ -20,7 +20,9 @@
20 20
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 21
 // THE SOFTWARE.
22 22
 
23  
-#import "TextualApplication.h"
  23
+#import <Foundation/Foundation.h>
  24
+#import "GRMustacheAvailabilityMacros.h"
  25
+#import "GRMustacheConfiguration.h"
24 26
 
25 27
 @class GRMustacheTemplateRepository;
26 28
 
@@ -29,7 +31,7 @@
29 31
  *
30 32
  * @since v6.0
31 33
  */
32  
-typedef enum {
  34
+typedef NS_ENUM(NSUInteger, GRMustacheTagType) {
33 35
     /**
34 36
      * The type for variable tags such as {{ name }}
35 37
      *
@@ -57,17 +59,20 @@ typedef enum {
57 59
      * @since v6.0
58 60
      */
59 61
     GRMustacheTagTypeInvertedSection = 1 << 4 AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER,
60  
-} GRMustacheTagType AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
  62
+} AVAILABLE_GRMUSTACHE_VERSION_6_0_AND_LATER;
61 63
 
62 64
 
63 65
 /**
64 66
  * GRMustacheTag instances represent Mustache tags that render values, such as
65 67
  * a variable tag {{ name }}, or a section tag {{# name }}...{{/}).
  68
+ *
  69
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/rendering_objects.md
66 70
  */
67 71
 @interface GRMustacheTag: NSObject {
68 72
 @private
69 73
     id _expression;
70 74
     GRMustacheTemplateRepository *_templateRepository;
  75
+    GRMustacheContentType _contentType;
71 76
 }
72 77
 
73 78
 /**
@@ -77,7 +82,12 @@ typedef enum {
77 82
 
78 83
 /**
79 84
  * The template repository that did provide the template string from which the
80  
- * receiver has been extracted.
  85
+ * receiver tag has been extracted.
  86
+ *
  87
+ * Caveat: Make sure you own (retain) template repositories. Don't use templates
  88
+ * returned by methods like `[GRMustacheTemplate templateFrom...]`: they return
  89
+ * autoreleased templates with an implicit autoreleased repository that will
  90
+ * eventually be deallocated when your rendering object tries to access it.
81 91
  *
82 92
  * @see GRMustacheTemplateRepository
83 93