Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Prepare v5.4.0
  • Loading branch information
groue committed Sep 28, 2012
1 parent b6a39ab commit 3f5fcee
Show file tree
Hide file tree
Showing 13 changed files with 161 additions and 60 deletions.
4 changes: 2 additions & 2 deletions AppledocSettings.plist
Expand Up @@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>--project-name</key>
<string>GRMustache 5.3</string>
<string>GRMustache 5.4</string>
<key>--project-version</key>
<string>5.3</string>
<string>5.4</string>
<key>--project-company</key>
<string>Gwendal Roué</string>
<key>--create-html</key>
Expand Down
74 changes: 41 additions & 33 deletions src/GRMustache.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/bin/buildGRMustacheAvailabilityMacros
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby

MAJOR_VERSION = 5
MAX_MINOR_VERSION = 3
MAX_MINOR_VERSION = 4

puts <<-LICENSE
// The MIT License
Expand Down
94 changes: 92 additions & 2 deletions src/classes/GRMustacheAvailabilityMacros.h
Expand Up @@ -32,17 +32,18 @@
#define GRMUSTACHE_VERSION_5_1 5010
#define GRMUSTACHE_VERSION_5_2 5020
#define GRMUSTACHE_VERSION_5_3 5030
#define GRMUSTACHE_VERSION_5_4 5040






/*
* If max GRMustacheVersion not specified, assume 5.3
* If max GRMustacheVersion not specified, assume 5.4
*/
#ifndef GRMUSTACHE_VERSION_MAX_ALLOWED
#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_3
#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_4
#endif

/*
Expand Down Expand Up @@ -289,3 +290,92 @@



/*
* AVAILABLE_GRMUSTACHE_VERSION_5_4_AND_LATER
*
* Used on declarations introduced in GRMustache 5.4
*/
#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_5_4
#define AVAILABLE_GRMUSTACHE_VERSION_5_4_AND_LATER UNAVAILABLE_ATTRIBUTE
#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_5_4
#define AVAILABLE_GRMUSTACHE_VERSION_5_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
#else
#define AVAILABLE_GRMUSTACHE_VERSION_5_4_AND_LATER
#endif

/*
* AVAILABLE_GRMUSTACHE_VERSION_5_4_AND_LATER_BUT_DEPRECATED
*
* Used on declarations introduced in GRMustache 5.4,
* and deprecated in GRMustache 5.4
*/
#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_5_4
#define AVAILABLE_GRMUSTACHE_VERSION_5_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
#else
#define AVAILABLE_GRMUSTACHE_VERSION_5_4_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_5_4_AND_LATER
#endif

/*
* AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4
*
* Used on declarations introduced in GRMustache 5.0,
* but later deprecated in GRMustache 5.4
*/
#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_5_4
#define AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4 DEPRECATED_ATTRIBUTE
#else
#define AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4 AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER
#endif

/*
* AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4
*
* Used on declarations introduced in GRMustache 5.1,
* but later deprecated in GRMustache 5.4
*/
#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_5_4
#define AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4 DEPRECATED_ATTRIBUTE
#else
#define AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4 AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER
#endif

/*
* AVAILABLE_GRMUSTACHE_VERSION_5_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4
*
* Used on declarations introduced in GRMustache 5.2,
* but later deprecated in GRMustache 5.4
*/
#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_5_4
#define AVAILABLE_GRMUSTACHE_VERSION_5_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4 DEPRECATED_ATTRIBUTE
#else
#define AVAILABLE_GRMUSTACHE_VERSION_5_2_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4 AVAILABLE_GRMUSTACHE_VERSION_5_2_AND_LATER
#endif

/*
* AVAILABLE_GRMUSTACHE_VERSION_5_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4
*
* Used on declarations introduced in GRMustache 5.3,
* but later deprecated in GRMustache 5.4
*/
#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_5_4
#define AVAILABLE_GRMUSTACHE_VERSION_5_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4 DEPRECATED_ATTRIBUTE
#else
#define AVAILABLE_GRMUSTACHE_VERSION_5_3_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_4 AVAILABLE_GRMUSTACHE_VERSION_5_3_AND_LATER
#endif

/*
* DEPRECATED_IN_GRMUSTACHE_VERSION_5_4_AND_LATER
*
* Used on types deprecated in GRMustache 5.4
*/
#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_5_4
#define DEPRECATED_IN_GRMUSTACHE_VERSION_5_4_AND_LATER DEPRECATED_ATTRIBUTE
#else
#define DEPRECATED_IN_GRMUSTACHE_VERSION_5_4_AND_LATER
#endif






21 changes: 12 additions & 9 deletions src/classes/GRMustacheTemplateRepository.h
Expand Up @@ -58,11 +58,11 @@
* For instance, a file-based data source may use NSString objects containing
* paths to the templates.
*
* You should try to choose "human-readable" template IDs. That is because
* template IDs are embedded in the description of errors that may happen during
* a template processing, in order to help the library user locate, and fix, the
* faulting template.
*
* You should try to choose "human-readable" template IDs, because template IDs
* are embedded in the description of errors that may happen during a template
* processing, in order to help the library user locate, and fix, the faulting
* template.
*
* Whenever relevant, template and partial hierarchies are supported via the
* _baseTemplateID_ parameter: it contains the template ID of the enclosing
* template, or nil when the data source is asked for a template ID for a
Expand All @@ -71,11 +71,14 @@
*
* Not all data sources have to implement hierarchies: they can simply ignore
* this parameter.
*
* The returned value can be nil: the library user would then eventually get an
* NSError of domain GRMustacheErrorDomain and code
*
* Data sources that implement hierarchies have to implement their own support
* for absolute partial paths.
*
* The return value of this method can be nil: the library user would then
* eventually get an NSError of domain GRMustacheErrorDomain and code
* GRMustacheErrorCodeTemplateNotFound.
*
*
* @param templateRepository The GRMustacheTemplateRepository asking for a
* template ID.
* @param name The name of the template or template partial.
Expand Down
2 changes: 1 addition & 1 deletion src/classes/GRMustacheVersion.h
Expand Up @@ -33,7 +33,7 @@
*
* @since v1.0
*/
#define GRMUSTACHE_MINOR_VERSION 3
#define GRMUSTACHE_MINOR_VERSION 4

/**
* The patch-level component of GRMustache version
Expand Down
Expand Up @@ -23,10 +23,10 @@
#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_0
#import "GRMustachePublicAPITest.h"

@interface GRMustacheTemplateRepositoryWithBaseURLTest : GRMustachePublicAPITest
@interface GRMustacheTemplateRepositoryWithBaseURL_5_0_Test : GRMustachePublicAPITest
@end

@implementation GRMustacheTemplateRepositoryWithBaseURLTest
@implementation GRMustacheTemplateRepositoryWithBaseURL_5_0_Test

- (void)testTemplateRepositoryWithBaseURL
{
Expand Down
Expand Up @@ -23,10 +23,10 @@
#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_0
#import "GRMustachePublicAPITest.h"

@interface GRMustacheTemplateRepositoryWithDirectoryTest : GRMustachePublicAPITest
@interface GRMustacheTemplateRepositoryWithDirectory_5_0_Test : GRMustachePublicAPITest
@end

@implementation GRMustacheTemplateRepositoryWithDirectoryTest
@implementation GRMustacheTemplateRepositoryWithDirectory_5_0_Test

- (void)testTemplateRepositoryWithDirectory
{
Expand Down
Expand Up @@ -20,17 +20,17 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_3
#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_4
#import "GRMustachePublicAPITest.h"

@interface GRMustacheTemplateRepositoryWithBaseURL_future_Test : GRMustachePublicAPITest
@interface GRMustacheTemplateRepositoryWithBaseURLTest : GRMustachePublicAPITest
@end

@implementation GRMustacheTemplateRepositoryWithBaseURL_future_Test
@implementation GRMustacheTemplateRepositoryWithBaseURLTest

- (void)testAbsolutePartialName
{
NSURL *URL = [self.testBundle URLForResource:@"GRMustacheTemplateRepository_future_Test" withExtension:nil];
NSURL *URL = [self.testBundle URLForResource:@"GRMustacheTemplateRepositoryTest" withExtension:nil];
GRMustacheTemplateRepository *repository = [GRMustacheTemplateRepository templateRepositoryWithBaseURL:URL];
GRMustacheTemplate *template = [repository templateForName:@"base" error:NULL];
NSString *rendering = [template render];
Expand Down
Expand Up @@ -20,17 +20,17 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_3
#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_4
#import "GRMustachePublicAPITest.h"

@interface GRMustacheTemplateRepositoryWithDirectory_future_Test : GRMustachePublicAPITest
@interface GRMustacheTemplateRepositoryWithDirectoryTest : GRMustachePublicAPITest
@end

@implementation GRMustacheTemplateRepositoryWithDirectory_future_Test
@implementation GRMustacheTemplateRepositoryWithDirectoryTest

- (void)testAbsolutePartialName
{
NSString *directoryPath = [self.testBundle pathForResource:@"GRMustacheTemplateRepository_future_Test" ofType:nil];
NSString *directoryPath = [self.testBundle pathForResource:@"GRMustacheTemplateRepositoryTest" ofType:nil];
GRMustacheTemplateRepository *repository = [GRMustacheTemplateRepository templateRepositoryWithDirectory:directoryPath];
GRMustacheTemplate *template = [repository templateForName:@"base" error:NULL];
NSString *rendering = [template render];
Expand Down

0 comments on commit 3f5fcee

Please sign in to comment.