Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactored settings handling by removing GBApplicationSettingsProvidi…

…ng protocol.

Instead, the GBApplicationSettingsProvider class is used. Objective-C can solve "program to interface" rule quite easily through anonymous type and we can as easily mock classes as we can protocols, so having a protocol only complicated development...
  • Loading branch information...
commit 1586e38821bb5746df5938f1ec6b1c7edbd56268 1 parent d8b7aa7
tomaz authored
1  Application/GBAppledocApplication.h
View
@@ -8,7 +8,6 @@
#import <Foundation/Foundation.h>
#import "DDCliApplication.h"
-#import "GBApplicationSettingsProviding.h"
/** The appledoc application handler.
305 Application/GBApplicationSettingsProvider.h
View
@@ -6,13 +6,16 @@
// Copyright (C) 2010, Gentle Bytes. All rights reserved.
//
-#import "GBApplicationSettingsProviding.h"
+#import "GBCommentComponentsProvider.h"
+#import "GBApplicationStringsProvider.h"
+
+@class GBModelBase;
/** Main application settings provider.
This object implements `GBApplicationStringsProviding` interface and is used by `GBAppledocApplication` to prepare application-wide settings including factory defaults, global and session values. The main purpose of the class is to simplify `GBAppledocApplication` class by decoupling it from the actual settings providing implementation.
*/
-@interface GBApplicationSettingsProvider : NSObject <NSCopying, GBApplicationSettingsProviding>
+@interface GBApplicationSettingsProvider : NSObject <NSCopying>
///---------------------------------------------------------------------------------------
/// @name Initialization & disposal
@@ -22,4 +25,302 @@
*/
+ (id)provider;
+
+///---------------------------------------------------------------------------------------
+/// @name Project values handling
+///---------------------------------------------------------------------------------------
+
+/** Human readable name of the project. */
+@property (copy) NSString *projectName;
+
+/** Human readable name of the project company. */
+@property (copy) NSString *projectCompany;
+
+/** Human readable version of the project. */
+@property (copy) NSString *projectVersion;
+
+/** Company unique identifier, ussualy in the form of reverse domain like _com.company_. */
+@property (copy) NSString *companyIdentifier;
+
+///---------------------------------------------------------------------------------------
+/// @name Documentation set handling
+///---------------------------------------------------------------------------------------
+
+/** Documentation set bundle identifier. */
+@property (copy) NSString *docsetBundleIdentifier;
+
+/** Documentation set bundle name. */
+@property (copy) NSString *docsetBundleName;
+
+/** Documentation set certificate issuer. */
+@property (copy) NSString *docsetCertificateIssuer;
+
+/** Documentation set certificate signer. */
+@property (copy) NSString *docsetCertificateSigner;
+
+/** Documentation set description. */
+@property (copy) NSString *docsetDescription;
+
+/** Documentation set fallback URL. */
+@property (copy) NSString *docsetFallbackURL;
+
+/** Documentation set feed name. */
+@property (copy) NSString *docsetFeedName;
+
+/** Documentation set feed URL. */
+@property (copy) NSString *docsetFeedURL;
+
+/** Documentation set minimum Xcode version. */
+@property (copy) NSString *docsetMinimumXcodeVersion;
+
+/** Documentation set platform family. */
+@property (copy) NSString *docsetPlatformFamily;
+
+/** Documentation set publisher identifier. */
+@property (copy) NSString *docsetPublisherIdentifier;
+
+/** Documentation set publisher name. */
+@property (copy) NSString *docsetPublisherName;
+
+/** Documentation set human readble copyright message. */
+@property (copy) NSString *docsetCopyrightMessage;
+
+///---------------------------------------------------------------------------------------
+/// @name Paths handling
+///---------------------------------------------------------------------------------------
+
+/** The base path to template files used for generating various output files. */
+@property (copy) NSString *templatesPath;
+
+/** The base path of the generated files. */
+@property (copy) NSString *outputPath;
+
+/** The path to which documentation set is to be installed. */
+@property (copy) NSString *docsetInstallPath;
+
+/** The path to `docsetutil` tool, including tool filename. */
+@property (copy) NSString *docsetUtilPath;
+
+/** The list of all full or partial paths to be ignored.
+
+ It's recommended to check if a path string ends with any of the given paths before processing it. This should catch directory and file names properly as directories are processed first.
+ */
+@property (retain) NSMutableArray *ignoredPaths;
+
+///---------------------------------------------------------------------------------------
+/// @name Behavior handling
+///---------------------------------------------------------------------------------------
+
+/* Indicates whether undocumented classes, categories or protocols should be kept or ignored when generating output.
+
+ If `YES` undocumented objects are kept and are used for output generation. If `NO`, these objects are ignored, but only if all their members are also not documented - as soon as a single member is documented, the object is included in output together with all of it's documented members.
+
+ @warning *Note:* Several properties define how undocumented objects are handled: `keepUndocumentedObjects`, `keepUndocumentedMembers` and `findUndocumentedMembersDocumentation`. To better understand how these work together, this is the workflow used when processing parsed objects, prior than passing them to output generators:
+
+ 1. If `findUndocumentedMembersDocumentation` is `YES`, all undocumented methods and properties documentation is searched for in known super class hierarchy. If documentation is found in any of the super classes, it is copied to inherited member as well. If `findUndocumentedMembersDocumentation` is `NO`, members are left undocumented and are handled that way in next steps.
+ 2. If `keepUndocumentedMembers` is `NO`, all parsed objects' members are iterated over. Any undocumented method or property is removed from class (of course any documentation copied over from super classes in previous step is considered valid too). If `keepUndocumentedMembers` is `NO`, all members are left and if `warnOnUndocumentedMembers` is `YES`, warnings are logged for all undocumented members.
+ 3. If `keepUndocumentedObjects` is `NO`, all undocumented classes, categories and protocols that have no documented method or property are also removed. If `keepUndocumentedObjects` is `NO`, all objects are left in the store and are used for output generation and if `warnOnUndocumentedObject` is `YES`, warnings are logged for all undocumented objects.
+
+ @see keepUndocumentedMembers
+ @see findUndocumentedMembersDocumentation;
+ @see warnOnUndocumentedObject
+ */
+@property (assign) BOOL keepUndocumentedObjects;
+
+/* Indicates whether undocumented methods or properties should be processed or not.
+
+ If `YES`, undocumented members are still used for output generation. If `NO`, these members are ignored, as if they are not part of the object. Note that this only affects documented objects: if an object is not documented and none of it's members is documented, the object is not processed for output, even if this value is `YES`!
+
+ @warning *Note:* This property works together with `keepUndocumentedObjects` and `findUndocumentedMembersDocumentation`. To understand how they are used, read documentation for `keepUndocumentedObjects`.
+
+ @see keepUndocumentedObjects
+ @see findUndocumentedMembersDocumentation
+ @see warnOnUndocumentedMember
+ */
+@property (assign) BOOL keepUndocumentedMembers;
+
+/** Specifies whether undocumented inherited methods or properties should be searched for in known places.
+
+ If `YES`, any undocumented overriden method or property is searched for in known super classes and adopted protocols and if documentation is found there, it is copied over. This works great for objects which would otherwise only show class documentation and no member. It's also how Apple documentation uses. Defaults to `YES`.
+
+ @warning *Note:* This property works together with `keepUndocumentedObjects` and `keepUndocumentedMembers`. To understand how they are used, read documentation for `keepUndocumentedObjects`.
+
+ @see keepUndocumentedObjects
+ @see keepUndocumentedMembers
+ */
+@property (assign) BOOL findUndocumentedMembersDocumentation;
+
+/** Indicates whether categories should be merges to classes they extend or not.
+
+ If `YES`, all methods from categories and extensions are merged to their classes. If `NO`, categories are left as independent objects in generated output. This is the main categories merging on/off switch, it merely enables or disables merging, other category merging settings define how exactly the methods from categories and extensions are merged into their classes.
+
+ Default value is `YES` and should be left so as this seems to be the way Apple has it's documentation generated.
+
+ @warning *Important:* Only categories for known project classes are merged. Categories to other framework classes, such as Foundation, AppKit or UIKit are not merged. In other words: only if the class source code is available on any of the given input paths, and is properly documented, it gets it's categories and extension methods merged! Also note that this option affects your documentation links - if any link is pointing to category that's going to be merged, it will be considered invalid link, so it's best to decide whther to merge categories of nor in advance and then consistently use properly formatted links.
+
+ @see keepMergedCategoriesSections
+ @see prefixMergedCategoriesSectionsWithCategoryName
+ */
+@property (assign) BOOL mergeCategoriesToClasses;
+
+/** Indicates whether category or extension sections should be preserved when merging into extended class.
+
+ If `YES`, all the sections from category or extension documentation are preserved. In such case, `prefixMergedCategoriesSectionsWithCategoryName` may optionally be used to prefix section name with category name or not. If `NO`, category or extension sections are ignored and a single section with category name is created in the class.
+
+ Default value is `NO`. If you use many sections within the categories, you should probably leave this option unchanged as preserving all category sections might yield fragmented class documentation. Experiment a bit to see what works best for you.
+
+ @warning *Note:* This option is ignored unless `mergeCategoriesToClasses` is used.
+
+ @see prefixMergedCategoriesSectionsWithCategoryName
+ @see mergeCategoriesToClasses
+ */
+@property (assign) BOOL keepMergedCategoriesSections;
+
+/** Indicates whether merged section names from categories should be prefixed with category name.
+
+ If `YES`, all merged section names from categories are prefixed with category name to make them more easily identifiable. If `NO`, section names are not changed. The first option is useful in case end users of your code are aware of different categories (if you're writting a framework for example). On the other hand, if you're using categories mostly as a way to split class definition to multiple files, you might want to keep this option off.
+
+ @warning *Note:* This option is ignored unless `mergeCategoriesToClasses` and `keepMergedCategoriesSections` is used. The option is also ignored for extensions; only section names are used for extensions!
+
+ @see keepMergedCategoriesSections
+ @see mergeCategoriesToClasses
+ */
+@property (assign) BOOL prefixMergedCategoriesSectionsWithCategoryName;
+
+/* Indicates whether HTML files should be generated or not.
+
+ If `YES`, HTML files are generated in `outputPath` from parsed and processed data. If `NO`, input files are parsed and processed, but nothing is generated.
+
+ @see createDocSet
+ */
+@property (assign) BOOL createHTML;
+
+/** Specifies whether documentation set should be created from the HTML files.
+
+ If `YES`, HTML files from html subdirectory in `outputPath` are moved to proper subdirectory within docset output files, then helper files are generated from parsed data. Documentation set files are also indexed. If `NO`, HTML files are left in the output path.
+
+ @see createHtml
+ @see installDocSet
+ */
+@property (assign) BOOL createDocSet;
+
+/** Specifies whether the documentation set should be installed or not.
+
+ If `YES`, temporary files used for indexing and removed, then documentation set bundle is created from the files from docset output path and is moved to `docsetInstallPath`. If `NO`, all documentation set files are left in output path.
+
+ @see createDocSet
+ */
+@property (assign) BOOL installDocSet;
+
+///---------------------------------------------------------------------------------------
+/// @name Warnings handling
+///---------------------------------------------------------------------------------------
+
+/** Indicates whether appledoc will warn if it encounters an undocumented class, category or protocol.
+
+ @see warnOnUndocumentedMember
+ */
+@property (assign) BOOL warnOnUndocumentedObject;
+
+/** Indicates whether appldoc will warn if it encounters an undocumented method or property.
+
+ @see warnOnUndocumentedObject
+ */
+@property (assign) BOOL warnOnUndocumentedMember;
+
+///---------------------------------------------------------------------------------------
+/// @name Application-wide HTML helpers
+///---------------------------------------------------------------------------------------
+
+/** Returns HTML reference name for the given object.
+
+ This should only be used for creating anchors that need to be referenced from other parts of the same HTML file. The method works for top-level objects as well as their members.
+
+ @param object The object for which to return reference name.
+ @return Returns the reference name of the object.
+ @exception NSException Thrown if the given object is `nil`.
+ @see htmlReferenceForObject:fromSource:
+ @see htmlReferenceForObjectFromIndex:
+ */
+- (NSString *)htmlReferenceNameForObject:(GBModelBase *)object;
+
+/** Returns relative HTML reference to the given object from the context of the given source object.
+
+ This is useful for generating hrefs from one object HTML file to another. This is the swiss army knife king of a method for all hrefs generation. It works for any kind of links:
+
+ - Index to top-level object (if source is `nil`).
+ - Index to a member of a top-level object (if source is `nil`).
+ - Top-level object to same top-level object.
+ - Top-level object to a different top-level object.
+ - Top-level object to one of it's members.
+ - Member object to it's top-level object.
+ - Member object to another top-level object.
+ - Member object to another member of the same top-level object.
+ - Member object to a member of another top-level object.
+
+ @param object The object for which to generate the reference to.
+ @param source The source object from which to generate the reference from or `nil` for index to object reference.
+ @return Returns the reference string.
+ @exception NSException Thrown if object is `nil`.
+ @see htmlReferenceForObjectFromIndex:
+ @see htmlReferenceNameForObject:
+ */
+- (NSString *)htmlReferenceForObject:(GBModelBase *)object fromSource:(GBModelBase *)source;
+
+/** Returns relative HTML reference to the given object from the context of index file.
+
+ This is simply a helper method for `htmlReferenceForObject:fromSource:`, passing the given object as object parameter and `nil` as source.
+
+ @pram object The object for which to generate the reference to.
+ @return Returns the reference string.
+ @exception NSException Thrown if object is `nil`.
+ @see htmlReferenceForObject:fromSource:
+ @see htmlReferenceNameForObject:
+ */
+- (NSString *)htmlReferenceForObjectFromIndex:(GBModelBase *)object;
+
+/** The file extension for html files.
+ */
+@property (readonly) NSString *htmlExtension;
+
+///---------------------------------------------------------------------------------------
+/// @name Helper methods
+///---------------------------------------------------------------------------------------
+
+/** Replaces all occurences of placeholder strings in all related values of the receiver.
+
+ This message should be sent once all the values have been set. It is a convenience method that prepares all values that can use placeholder strings. From this point on, the rest of the application can simply use properties to get final values instead of sending `stringByReplacingOccurencesOfPlaceholdersInString:` all the time.
+
+ Note that `stringByReplacingOccurencesOfPlaceholdersInString:` is still available for cases where placeholder strings may be used elsewhere (template files for example).
+
+ @see stringByReplacingOccurencesOfPlaceholdersInString:
+ */
+- (void)replaceAllOccurencesOfPlaceholderStringsInSettingsValues;
+
+/** Replaces all placeholders occurences in the given string.
+
+ This method provides application-wide string placeholders replacement functionality. It replaces all known placeholders with actual values from the receiver. Placeholders are identified by a dollar mark, followed by placeholder name. The following placeholders are supported (note that case is important!):
+
+ - `$PROJECT`: Replaced by `projectName` value.
+ - `$COMPANY`: Replaced by `projectCompany` value.
+ - `$VERSION`: Replaced by `projectVersion` value.
+ - `$YEAR`: Replaced by current year as four digit string.
+ - `$UPDATEDATE`: Replaced by current date in the form of year, month and day with format `YYYY-MM-DD`. For example `2010-11-30`.
+
+ @param string The string to replace placeholder occurences in.
+ @return Returns new string with all placeholder occurences replaced.
+ @see replaceAllOccurencesOfPlaceholderStringsInSettingsValues
+ */
+- (NSString *)stringByReplacingOccurencesOfPlaceholdersInString:(NSString *)string;
+
+///---------------------------------------------------------------------------------------
+/// @name Helper classes
+///---------------------------------------------------------------------------------------
+
+/** Returns the `GBCommentComponentsProvider` object that identifies comment components. */
+@property (retain) GBCommentComponentsProvider *commentComponents;
+
+/** Returns the `GBApplicationStringsProvider` object that specifies all string templates used for output generation. */
+@property (retain) GBApplicationStringsProvider *stringTemplates;
+
@end
318 Application/GBApplicationSettingsProviding.h
View
@@ -1,318 +0,0 @@
-//
-// GBApplicationSettingsProviding.h
-// appledoc
-//
-// Created by Tomaz Kragelj on 23.7.10.
-// Copyright 2010 Gentle Bytes. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "GBCommentComponentsProvider.h"
-#import "GBApplicationStringsProvider.h"
-
-@class GBModelBase;
-
-/** Defines the requirements for application-level settings providers.
-
- Application-level settings providers provide application-wide settings and properties that affect application handling.
- */
-@protocol GBApplicationSettingsProviding
-
-///---------------------------------------------------------------------------------------
-/// @name Project values handling
-///---------------------------------------------------------------------------------------
-
-/** Human readable name of the project. */
-@property (copy) NSString *projectName;
-
-/** Human readable name of the project company. */
-@property (copy) NSString *projectCompany;
-
-/** Human readable version of the project. */
-@property (copy) NSString *projectVersion;
-
-/** Company unique identifier, ussualy in the form of reverse domain like _com.company_. */
-@property (copy) NSString *companyIdentifier;
-
-///---------------------------------------------------------------------------------------
-/// @name Documentation set handling
-///---------------------------------------------------------------------------------------
-
-/** Documentation set bundle identifier. */
-@property (copy) NSString *docsetBundleIdentifier;
-
-/** Documentation set bundle name. */
-@property (copy) NSString *docsetBundleName;
-
-/** Documentation set certificate issuer. */
-@property (copy) NSString *docsetCertificateIssuer;
-
-/** Documentation set certificate signer. */
-@property (copy) NSString *docsetCertificateSigner;
-
-/** Documentation set description. */
-@property (copy) NSString *docsetDescription;
-
-/** Documentation set fallback URL. */
-@property (copy) NSString *docsetFallbackURL;
-
-/** Documentation set feed name. */
-@property (copy) NSString *docsetFeedName;
-
-/** Documentation set feed URL. */
-@property (copy) NSString *docsetFeedURL;
-
-/** Documentation set minimum Xcode version. */
-@property (copy) NSString *docsetMinimumXcodeVersion;
-
-/** Documentation set platform family. */
-@property (copy) NSString *docsetPlatformFamily;
-
-/** Documentation set publisher identifier. */
-@property (copy) NSString *docsetPublisherIdentifier;
-
-/** Documentation set publisher name. */
-@property (copy) NSString *docsetPublisherName;
-
-/** Documentation set human readble copyright message. */
-@property (copy) NSString *docsetCopyrightMessage;
-
-///---------------------------------------------------------------------------------------
-/// @name Paths handling
-///---------------------------------------------------------------------------------------
-
-/** The base path to template files used for generating various output files. */
-@property (copy) NSString *templatesPath;
-
-/** The base path of the generated files. */
-@property (copy) NSString *outputPath;
-
-/** The path to which documentation set is to be installed. */
-@property (copy) NSString *docsetInstallPath;
-
-/** The path to `docsetutil` tool, including tool filename. */
-@property (copy) NSString *docsetUtilPath;
-
-/** The list of all full or partial paths to be ignored.
-
- It's recommended to check if a path string ends with any of the given paths before processing it. This should catch directory and file names properly as directories are processed first.
- */
-@property (retain) NSMutableArray *ignoredPaths;
-
-///---------------------------------------------------------------------------------------
-/// @name Behavior handling
-///---------------------------------------------------------------------------------------
-
-/* Indicates whether undocumented classes, categories or protocols should be kept or ignored when generating output.
-
- If `YES` undocumented objects are kept and are used for output generation. If `NO`, these objects are ignored, but only if all their members are also not documented - as soon as a single member is documented, the object is included in output together with all of it's documented members.
-
- @warning *Note:* Several properties define how undocumented objects are handled: `keepUndocumentedObjects`, `keepUndocumentedMembers` and `findUndocumentedMembersDocumentation`. To better understand how these work together, this is the workflow used when processing parsed objects, prior than passing them to output generators:
-
- 1. If `findUndocumentedMembersDocumentation` is `YES`, all undocumented methods and properties documentation is searched for in known super class hierarchy. If documentation is found in any of the super classes, it is copied to inherited member as well. If `findUndocumentedMembersDocumentation` is `NO`, members are left undocumented and are handled that way in next steps.
- 2. If `keepUndocumentedMembers` is `NO`, all parsed objects' members are iterated over. Any undocumented method or property is removed from class (of course any documentation copied over from super classes in previous step is considered valid too). If `keepUndocumentedMembers` is `NO`, all members are left and if `warnOnUndocumentedMembers` is `YES`, warnings are logged for all undocumented members.
- 3. If `keepUndocumentedObjects` is `NO`, all undocumented classes, categories and protocols that have no documented method or property are also removed. If `keepUndocumentedObjects` is `NO`, all objects are left in the store and are used for output generation and if `warnOnUndocumentedObject` is `YES`, warnings are logged for all undocumented objects.
-
- @see keepUndocumentedMembers
- @see findUndocumentedMembersDocumentation;
- @see warnOnUndocumentedObject
- */
-@property (assign) BOOL keepUndocumentedObjects;
-
-/* Indicates whether undocumented methods or properties should be processed or not.
-
- If `YES`, undocumented members are still used for output generation. If `NO`, these members are ignored, as if they are not part of the object. Note that this only affects documented objects: if an object is not documented and none of it's members is documented, the object is not processed for output, even if this value is `YES`!
-
- @warning *Note:* This property works together with `keepUndocumentedObjects` and `findUndocumentedMembersDocumentation`. To understand how they are used, read documentation for `keepUndocumentedObjects`.
-
- @see keepUndocumentedObjects
- @see findUndocumentedMembersDocumentation
- @see warnOnUndocumentedMember
- */
-@property (assign) BOOL keepUndocumentedMembers;
-
-/** Specifies whether undocumented inherited methods or properties should be searched for in known places.
-
- If `YES`, any undocumented overriden method or property is searched for in known super classes and adopted protocols and if documentation is found there, it is copied over. This works great for objects which would otherwise only show class documentation and no member. It's also how Apple documentation uses. Defaults to `YES`.
-
- @warning *Note:* This property works together with `keepUndocumentedObjects` and `keepUndocumentedMembers`. To understand how they are used, read documentation for `keepUndocumentedObjects`.
-
- @see keepUndocumentedObjects
- @see keepUndocumentedMembers
- */
-@property (assign) BOOL findUndocumentedMembersDocumentation;
-
-/** Indicates whether categories should be merges to classes they extend or not.
-
- If `YES`, all methods from categories and extensions are merged to their classes. If `NO`, categories are left as independent objects in generated output. This is the main categories merging on/off switch, it merely enables or disables merging, other category merging settings define how exactly the methods from categories and extensions are merged into their classes.
-
- Default value is `YES` and should be left so as this seems to be the way Apple has it's documentation generated.
-
- @warning *Important:* Only categories for known project classes are merged. Categories to other framework classes, such as Foundation, AppKit or UIKit are not merged. In other words: only if the class source code is available on any of the given input paths, and is properly documented, it gets it's categories and extension methods merged! Also note that this option affects your documentation links - if any link is pointing to category that's going to be merged, it will be considered invalid link, so it's best to decide whther to merge categories of nor in advance and then consistently use properly formatted links.
-
- @see keepMergedCategoriesSections
- @see prefixMergedCategoriesSectionsWithCategoryName
- */
-@property (assign) BOOL mergeCategoriesToClasses;
-
-/** Indicates whether category or extension sections should be preserved when merging into extended class.
-
- If `YES`, all the sections from category or extension documentation are preserved. In such case, `prefixMergedCategoriesSectionsWithCategoryName` may optionally be used to prefix section name with category name or not. If `NO`, category or extension sections are ignored and a single section with category name is created in the class.
-
- Default value is `NO`. If you use many sections within the categories, you should probably leave this option unchanged as preserving all category sections might yield fragmented class documentation. Experiment a bit to see what works best for you.
-
- @warning *Note:* This option is ignored unless `mergeCategoriesToClasses` is used.
-
- @see prefixMergedCategoriesSectionsWithCategoryName
- @see mergeCategoriesToClasses
- */
-@property (assign) BOOL keepMergedCategoriesSections;
-
-/** Indicates whether merged section names from categories should be prefixed with category name.
-
- If `YES`, all merged section names from categories are prefixed with category name to make them more easily identifiable. If `NO`, section names are not changed. The first option is useful in case end users of your code are aware of different categories (if you're writting a framework for example). On the other hand, if you're using categories mostly as a way to split class definition to multiple files, you might want to keep this option off.
-
- @warning *Note:* This option is ignored unless `mergeCategoriesToClasses` and `keepMergedCategoriesSections` is used. The option is also ignored for extensions; only section names are used for extensions!
-
- @see keepMergedCategoriesSections
- @see mergeCategoriesToClasses
- */
-@property (assign) BOOL prefixMergedCategoriesSectionsWithCategoryName;
-
-/* Indicates whether HTML files should be generated or not.
-
- If `YES`, HTML files are generated in `outputPath` from parsed and processed data. If `NO`, input files are parsed and processed, but nothing is generated.
-
- @see createDocSet
- */
-@property (assign) BOOL createHTML;
-
-/** Specifies whether documentation set should be created from the HTML files.
-
- If `YES`, HTML files from html subdirectory in `outputPath` are moved to proper subdirectory within docset output files, then helper files are generated from parsed data. Documentation set files are also indexed. If `NO`, HTML files are left in the output path.
-
- @see createHtml
- @see installDocSet
- */
-@property (assign) BOOL createDocSet;
-
-/** Specifies whether the documentation set should be installed or not.
-
- If `YES`, temporary files used for indexing and removed, then documentation set bundle is created from the files from docset output path and is moved to `docsetInstallPath`. If `NO`, all documentation set files are left in output path.
-
- @see createDocSet
- */
-@property (assign) BOOL installDocSet;
-
-///---------------------------------------------------------------------------------------
-/// @name Warnings handling
-///---------------------------------------------------------------------------------------
-
-/** Indicates whether appledoc will warn if it encounters an undocumented class, category or protocol.
-
- @see warnOnUndocumentedMember
- */
-@property (assign) BOOL warnOnUndocumentedObject;
-
-/** Indicates whether appldoc will warn if it encounters an undocumented method or property.
-
- @see warnOnUndocumentedObject
- */
-@property (assign) BOOL warnOnUndocumentedMember;
-
-///---------------------------------------------------------------------------------------
-/// @name Application-wide HTML helpers
-///---------------------------------------------------------------------------------------
-
-/** Returns HTML reference name for the given object.
-
- This should only be used for creating anchors that need to be referenced from other parts of the same HTML file. The method works for top-level objects as well as their members.
-
- @param object The object for which to return reference name.
- @return Returns the reference name of the object.
- @exception NSException Thrown if the given object is `nil`.
- @see htmlReferenceForObject:fromSource:
- @see htmlReferenceForObjectFromIndex:
- */
-- (NSString *)htmlReferenceNameForObject:(GBModelBase *)object;
-
-/** Returns relative HTML reference to the given object from the context of the given source object.
-
- This is useful for generating hrefs from one object HTML file to another. This is the swiss army knife king of a method for all hrefs generation. It works for any kind of links:
-
- - Index to top-level object (if source is `nil`).
- - Index to a member of a top-level object (if source is `nil`).
- - Top-level object to same top-level object.
- - Top-level object to a different top-level object.
- - Top-level object to one of it's members.
- - Member object to it's top-level object.
- - Member object to another top-level object.
- - Member object to another member of the same top-level object.
- - Member object to a member of another top-level object.
-
- @param object The object for which to generate the reference to.
- @param source The source object from which to generate the reference from or `nil` for index to object reference.
- @return Returns the reference string.
- @exception NSException Thrown if object is `nil`.
- @see htmlReferenceForObjectFromIndex:
- @see htmlReferenceNameForObject:
- */
-- (NSString *)htmlReferenceForObject:(GBModelBase *)object fromSource:(GBModelBase *)source;
-
-/** Returns relative HTML reference to the given object from the context of index file.
-
- This is simply a helper method for `htmlReferenceForObject:fromSource:`, passing the given object as object parameter and `nil` as source.
-
- @pram object The object for which to generate the reference to.
- @return Returns the reference string.
- @exception NSException Thrown if object is `nil`.
- @see htmlReferenceForObject:fromSource:
- @see htmlReferenceNameForObject:
- */
-- (NSString *)htmlReferenceForObjectFromIndex:(GBModelBase *)object;
-
-/** The file extension for html files.
- */
-@property (readonly) NSString *htmlExtension;
-
-///---------------------------------------------------------------------------------------
-/// @name Helper methods
-///---------------------------------------------------------------------------------------
-
-/** Replaces all occurences of placeholder strings in all related values of the receiver.
-
- This message should be sent once all the values have been set. It is a convenience method that prepares all values that can use placeholder strings. From this point on, the rest of the application can simply use properties to get final values instead of sending `stringByReplacingOccurencesOfPlaceholdersInString:` all the time.
-
- Note that `stringByReplacingOccurencesOfPlaceholdersInString:` is still available for cases where placeholder strings may be used elsewhere (template files for example).
-
- @see stringByReplacingOccurencesOfPlaceholdersInString:
- */
-- (void)replaceAllOccurencesOfPlaceholderStringsInSettingsValues;
-
-/** Replaces all placeholders occurences in the given string.
-
- This method provides application-wide string placeholders replacement functionality. It replaces all known placeholders with actual values from the receiver. Placeholders are identified by a dollar mark, followed by placeholder name. The following placeholders are supported (note that case is important!):
-
- - `$PROJECT`: Replaced by `projectName` value.
- - `$COMPANY`: Replaced by `projectCompany` value.
- - `$VERSION`: Replaced by `projectVersion` value.
- - `$YEAR`: Replaced by current year as four digit string.
- - `$UPDATEDATE`: Replaced by current date in the form of year, month and day with format `YYYY-MM-DD`. For example `2010-11-30`.
-
- @param string The string to replace placeholder occurences in.
- @return Returns new string with all placeholder occurences replaced.
- @see replaceAllOccurencesOfPlaceholderStringsInSettingsValues
- */
-- (NSString *)stringByReplacingOccurencesOfPlaceholdersInString:(NSString *)string;
-
-///---------------------------------------------------------------------------------------
-/// @name Helper classes
-///---------------------------------------------------------------------------------------
-
-/** Returns the `GBCommentComponentsProvider` object that identifies comment components. */
-@property (retain) GBCommentComponentsProvider *commentComponents;
-
-/** Returns the `GBApplicationStringsProvider` object that specifies all string templates used for output generation. */
-@property (retain) GBApplicationStringsProvider *stringTemplates;
-
-@end
5 Generating/GBGenerator.m
View
@@ -6,7 +6,7 @@
// Copyright (C) 2010, Gentle Bytes. All rights reserved.
//
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBStoreProviding.h"
#import "GBHTMLOutputGenerator.h"
#import "GBDocSetOutputGenerator.h"
@@ -17,8 +17,8 @@ @interface GBGenerator ()
- (void)setupGeneratorStepsWithStore:(id<GBStoreProviding>)store;
- (void)runGeneratorStepsWithStore:(id<GBStoreProviding>)store;
@property (readonly) NSMutableArray *outputGenerators;
-@property (retain) id<GBApplicationSettingsProviding> settings;
@property (retain) id<GBStoreProviding> store;
+@property (retain) GBApplicationSettingsProvider *settings;
@end
@@ -34,7 +34,6 @@ + (id)generatorWithSettingsProvider:(id)settingsProvider {
- (id)initWithSettingsProvider:(id)settingsProvider {
NSParameterAssert(settingsProvider != nil);
- NSParameterAssert([settingsProvider conformsToProtocol:@protocol(GBApplicationSettingsProviding)]);
GBLogDebug(@"Initializing generator with settings provider %@...", settingsProvider);
self = [super init];
if (self) {
2  Generating/GBHTMLOutputGenerator.m
View
@@ -6,7 +6,7 @@
// Copyright 2010 Gentle Bytes. All rights reserved.
//
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBDataObjects.h"
#import "GBHTMLTemplateVariablesProvider.h"
#import "GBTemplateHandler.h"
5 Generating/GBHTMLTemplateVariablesProvider.m
View
@@ -7,7 +7,7 @@
//
#import "GRMustache.h"
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBObjectDataProviding.h"
#import "GBStoreProviding.h"
#import "GBDataObjects.h"
@@ -20,8 +20,8 @@ @interface GBHTMLTemplateVariablesProvider ()
- (NSString *)hrefForObject:(id)object fromObject:(id)source;
- (NSDictionary *)arrayDescriptorForArray:(NSArray *)array;
- (void)addFooterVarsToDictionary:(NSMutableDictionary *)dict;
-@property (retain) id<GBApplicationSettingsProviding> settings;
@property (retain) id<GBStoreProviding> store;
+@property (retain) GBApplicationSettingsProvider *settings;
@end
@@ -76,7 +76,6 @@ + (id)providerWithSettingsProvider:(id)settingsProvider {
- (id)initWithSettingsProvider:(id)settingsProvider {
NSParameterAssert(settingsProvider != nil);
- NSParameterAssert([settingsProvider conformsToProtocol:@protocol(GBApplicationSettingsProviding)]);
GBLogDebug(@"Initializing variables provider with settings provider %@...", settingsProvider);
self = [super init];
if (self) {
8 Generating/GBOutputGenerator.h
View
@@ -9,7 +9,7 @@
#import <Foundation/Foundation.h>
#import "GBStoreProviding.h"
-@protocol GBApplicationSettingsProviding;
+@class GBApplicationSettingsProvider;
/** The base class for all output generators.
@@ -45,7 +45,7 @@
/** Copies all files from the templates path to the output path as defined in assigned `settings`, replicating the directory structure and stores all detected template files to `templateFiles` dictionary.
- The method uses `[GBApplicationSettingsProviding templatesPath]` as the base path for templates and `[GBApplicationSettingsProviding outputPath]` as the base path for output. In both cases, `outputSubpath` is used to determine the source and destination subdirectories. It then copies all files from template path to the output path, including the whole directory structure. If any special template file is found at source path, it is not copied! Template files are identified by having a `-template` suffix followed by optional extension. For example `object-template.html`. As this message prepares the ground for actual generation, it should be sent before any other messages (i.e. before `generateOutput:`).
+ The method uses `[GBApplicationSettingsProvider templatesPath]` as the base path for templates and `[GBApplicationSettingsProvider outputPath]` as the base path for output. In both cases, `outputSubpath` is used to determine the source and destination subdirectories. It then copies all files from template path to the output path, including the whole directory structure. If any special template file is found at source path, it is not copied! Template files are identified by having a `-template` suffix followed by optional extension. For example `object-template.html`. As this message prepares the ground for actual generation, it should be sent before any other messages (i.e. before `generateOutput:`).
To further aid subclasses, the method reads out all template files in templates path and stores them to `templateFiles` dictionary. Each template file is stored with a key correspoding to it's filename, including the subdirectory within the base template path and extension.
@@ -147,8 +147,8 @@
*/
@property (readonly) NSString *outputSubpath;
-/** The `GBApplicationSettingsProviding` object that provides application-wide settings for this session.
+/** The `GBApplicationSettingsProvider` object that provides application-wide settings for this session.
*/
-@property (retain) id<GBApplicationSettingsProviding> settings;
+@property (retain) GBApplicationSettingsProvider *settings;
@end
3  Generating/GBOutputGenerator.m
View
@@ -6,7 +6,7 @@
// Copyright 2010 Gentle Bytes. All rights reserved.
//
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBTemplateHandler.h"
#import "GBOutputGenerator.h"
@@ -31,7 +31,6 @@ + (id)generatorWithSettingsProvider:(id)settingsProvider {
- (id)initWithSettingsProvider:(id)settingsProvider {
NSParameterAssert(settingsProvider != nil);
- NSParameterAssert([settingsProvider conformsToProtocol:@protocol(GBApplicationSettingsProviding)]);
GBLogDebug(@"Initializing output generator with settings provider %@...", settingsProvider);
self = [super init];
if (self) {
4 Model/GBModelBase.h
View
@@ -104,7 +104,7 @@
/** Returns the HTML reference for the object that can be used within the same HTML file.
- This is simply a wrapper over `[GBApplicationSettingsProviding htmlReferenceForObject:fromSource:]`, passing the given object as both method arguments. The major reason for introducing this method is the ability to reference it from the output templates! In this way all knowledge about references is handled in a single point and doesn't have to be repeated in various places.
+ This is simply a wrapper over `[GBApplicationSettingsProvider htmlReferenceForObject:fromSource:]`, passing the given object as both method arguments. The major reason for introducing this method is the ability to reference it from the output templates! In this way all knowledge about references is handled in a single point and doesn't have to be repeated in various places.
@see htmlReferenceName
*/
@@ -112,7 +112,7 @@
/** Returns the HTML reference name of the object that can be used as an anchor to link against.
- This is simply a wrapper over `[GBApplicationSettingsProviding htmlReferenceNameForObject:]`, passing the given object as the method argument. The major reason for introducing this method is the ability to reference it from the output templates! In this way all knowledge about references is handled in a single point and doesn't have to be repeated in various places.
+ This is simply a wrapper over `[GBApplicationSettingsProvider htmlReferenceNameForObject:]`, passing the given object as the method argument. The major reason for introducing this method is the ability to reference it from the output templates! In this way all knowledge about references is handled in a single point and doesn't have to be repeated in various places.
@see htmlLocalReference
*/
3  Parsing/GBObjectiveCParser.h
View
@@ -8,9 +8,6 @@
#import <Foundation/Foundation.h>
-@protocol GBApplicationSettingsProviding;
-@protocol GBStoreProviding;
-
/** Implements Objective-C source code parser.
The main responsibility of this class is encapsulation of Objective-C source code parsing into in-memory representation. As we're only parsing a small subset of Objective-C and even then we don't need to handle much specifics beyond recognizing different classes, variables, methods etc., overall the parsing process is quite simple. Basically we use ParseKit's `PKTokenizer` to split given input string into tokens and then traverse the list of tokens to get the data we need.
5 Parsing/GBObjectiveCParser.m
View
@@ -10,7 +10,7 @@
#import "ParseKit.h"
#import "PKToken+GBToken.h"
#import "GBTokenizer.h"
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBStoreProviding.h"
#import "GBDataObjects.h"
#import "GBObjectiveCParser.h"
@@ -19,8 +19,8 @@ @interface GBObjectiveCParser ()
- (PKTokenizer *)tokenizerWithInputString:(NSString *)input;
@property (retain) GBTokenizer *tokenizer;
-@property (retain) id<GBApplicationSettingsProviding> settings;
@property (retain) id<GBStoreProviding> store;
+@property (retain) GBApplicationSettingsProvider *settings;
@end
@@ -73,7 +73,6 @@ + (id)parserWithSettingsProvider:(id)settingsProvider {
- (id)initWithSettingsProvider:(id)settingsProvider {
NSParameterAssert(settingsProvider != nil);
- NSParameterAssert([settingsProvider conformsToProtocol:@protocol(GBApplicationSettingsProviding)]);
GBLogDebug(@"Initializing objective-c parser with settings provider %@...", settingsProvider);
self = [super init];
if (self) {
5 Parsing/GBParser.m
View
@@ -6,7 +6,7 @@
// Copyright (C) 2010, Gentle Bytes. All rights reserved.
//
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBStoreProviding.h"
#import "GBObjectiveCParser.h"
#import "GBParser.h"
@@ -21,8 +21,8 @@ - (BOOL)isDirectoryIgnored:(NSString *)filename;
- (BOOL)isSourceCodeFile:(NSString *)path;
@property (assign) NSUInteger numberOfParsedFiles;
@property (retain) GBObjectiveCParser *objectiveCParser;
-@property (retain) id<GBApplicationSettingsProviding> settings;
@property (retain) id<GBStoreProviding> store;
+@property (retain) GBApplicationSettingsProvider *settings;
@end
@@ -38,7 +38,6 @@ + (id)parserWithSettingsProvider:(id)settingsProvider {
- (id)initWithSettingsProvider:(id)settingsProvider {
NSParameterAssert(settingsProvider != nil);
- NSParameterAssert([settingsProvider conformsToProtocol:@protocol(GBApplicationSettingsProviding)]);
GBLogDebug(@"Initializing parser with settings provider %@...", settingsProvider);
self = [super init];
if (self) {
5 Processing/GBCommentsProcessor.m
View
@@ -7,7 +7,7 @@
//
#import "RegexKitLite.h"
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBStoreProviding.h"
#import "GBDataObjects.h"
#import "GBCommentsProcessor.h"
@@ -45,8 +45,8 @@ - (NSArray *)componentsSeparatedByNewLinesFromString:(NSString *)string;
@property (retain) NSString *newLinesRegexSymbols;
@property (retain) GBComment *currentComment;
@property (retain) id<GBObjectDataProviding> currentContext;
-@property (retain) id<GBApplicationSettingsProviding> settings;
@property (retain) id<GBStoreProviding> store;
+@property (retain) GBApplicationSettingsProvider *settings;
@end
@@ -62,7 +62,6 @@ + (id)processorWithSettingsProvider:(id)settingsProvider {
- (id)initWithSettingsProvider:(id)settingsProvider {
NSParameterAssert(settingsProvider != nil);
- NSParameterAssert([settingsProvider conformsToProtocol:@protocol(GBApplicationSettingsProviding)]);
GBLogDebug(@"Initializing comments processor with settings provider %@...", settingsProvider);
self = [super init];
if (self) {
5 Processing/GBProcessor.h
View
@@ -8,9 +8,6 @@
#import <Foundation/Foundation.h>
-@protocol GBApplicationSettingsProviding;
-@protocol GBStoreProviding;
-
/** Handles processing of parsed data from any given `GBStore`.
Processing phase is where parsed raw data is prepared for output. The most prominent part is processing comment raw values by validating and preparing links, formatting etc.
@@ -52,6 +49,6 @@
@param store The store that contains all parsed objects.
@exception NSException Thrown if a serious problem is detected which prevents us from processing.
*/
-- (void)processObjectsFromStore:(id<GBStoreProviding>)store;
+- (void)processObjectsFromStore:(id)store;
@end
7 Processing/GBProcessor.m
View
@@ -6,7 +6,7 @@
// Copyright (C) 2010, Gentle Bytes. All rights reserved.
//
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBStoreProviding.h"
#import "GBDataObjects.h"
#import "GBCommentsProcessor.h"
@@ -34,8 +34,8 @@ - (BOOL)isCommentValid:(GBComment *)comment;
@property (retain) GBCommentsProcessor *commentsProcessor;
@property (retain) id<GBObjectDataProviding> currentContext;
-@property (retain) id<GBApplicationSettingsProviding> settings;
@property (retain) id<GBStoreProviding> store;
+@property (retain) GBApplicationSettingsProvider *settings;
@end
@@ -51,7 +51,6 @@ + (id)processorWithSettingsProvider:(id)settingsProvider {
- (id)initWithSettingsProvider:(id)settingsProvider {
NSParameterAssert(settingsProvider != nil);
- NSParameterAssert([settingsProvider conformsToProtocol:@protocol(GBApplicationSettingsProviding)]);
GBLogDebug(@"Initializing processor with settings provider %@...", settingsProvider);
self = [super init];
if (self) {
@@ -63,7 +62,7 @@ - (id)initWithSettingsProvider:(id)settingsProvider {
#pragma mark Processing handling
-- (void)processObjectsFromStore:(id<GBStoreProviding>)store {
+- (void)processObjectsFromStore:(id)store {
NSParameterAssert(store != nil);
GBLogVerbose(@"Processing parsed objects...");
self.currentContext = nil;
2  Testing/GBProcessor-CategoriesMergingTesting.m
View
@@ -6,7 +6,7 @@
// Copyright (C) 2010 Gentle Bytes. All rights reserved.
//
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBDataObjects.h"
#import "GBStore.h"
#import "GBProcessor.h"
2  Testing/GBProcessor-KnownObjectsTesting.m
View
@@ -6,7 +6,7 @@
// Copyright (C) 2010 Gentle Bytes. All rights reserved.
//
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBDataObjects.h"
#import "GBStore.h"
#import "GBProcessor.h"
2  Testing/GBProcessor-MemberDocCopyingTesting.m
View
@@ -6,7 +6,7 @@
// Copyright (C) 2010 Gentle Bytes. All rights reserved.
//
-#import "GBApplicationSettingsProviding.h"
+#import "GBApplicationSettingsProvider.h"
#import "GBDataObjects.h"
#import "GBProcessor.h"
3  Testing/GBTestObjectsRegistry.m
View
@@ -6,7 +6,6 @@
// Copyright (C) 2010, Gentle Bytes. All rights reserved.
//
-#import "GBApplicationSettingsProviding.h"
#import "GBApplicationSettingsProvider.h"
#import "GBDataObjects.h"
#import "GBTestObjectsRegistry.h"
@@ -25,7 +24,7 @@ + (id)realSettingsProvider {
}
+ (OCMockObject *)mockSettingsProvider {
- OCMockObject *result = [OCMockObject niceMockForProtocol:@protocol(GBApplicationSettingsProviding)];
+ OCMockObject *result = [OCMockObject niceMockForClass:[GBApplicationSettingsProvider class]];
[[[result stub] andReturn:@"project"] projectName];
[[[result stub] andReturn:@"company"] projectCompany];
[[[result stub] andReturn:[GBCommentComponentsProvider provider]] commentComponents];
2  appledoc.xcodeproj/project.pbxproj
View
@@ -399,7 +399,6 @@
73FC6D8D11FCCB7000AAD0B9 /* AppledocTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "AppledocTests-Info.plist"; path = "../AppledocTests-Info.plist"; sourceTree = "<group>"; };
73FC6DB311FCCCC600AAD0B9 /* GBParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GBParser.h; sourceTree = "<group>"; };
73FC6DB411FCCCC600AAD0B9 /* GBParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GBParser.m; sourceTree = "<group>"; };
- 73FC6DB911FCCD0400AAD0B9 /* GBApplicationSettingsProviding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = GBApplicationSettingsProviding.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
73FC6DC511FCCD7B00AAD0B9 /* AppledocTests_prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppledocTests_prefix.pch; sourceTree = SOURCE_ROOT; };
73FC6DD911FCCE6B00AAD0B9 /* GBObjectiveCParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GBObjectiveCParser.h; sourceTree = "<group>"; };
73FC6DDA11FCCE6B00AAD0B9 /* GBObjectiveCParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GBObjectiveCParser.m; sourceTree = "<group>"; };
@@ -787,7 +786,6 @@
children = (
73D54D2711F8D59200CCDDB0 /* GBAppledocApplication.h */,
73D54D2811F8D59200CCDDB0 /* GBAppledocApplication.m */,
- 73FC6DB911FCCD0400AAD0B9 /* GBApplicationSettingsProviding.h */,
736A275D125845000078F4FE /* GBApplicationSettingsProvider.h */,
736A275E125845000078F4FE /* GBApplicationSettingsProvider.m */,
733E9FD9122BA9B00060CBDE /* GBCommentComponentsProvider.h */,
Please sign in to comment.
Something went wrong with that request. Please try again.