xcfit 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.swift-version +1 -0
- data/.travis.yml +13 -13
- data/README.md +57 -35
- data/XCFit.podspec +6 -16
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift +14 -12
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift +16 -15
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift +11 -11
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift +5 -5
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift +9 -8
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift +7 -6
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +7 -5
- data/XCFit_Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +10 -8
- data/homebrew/xcfit +155 -0
- data/lib/XCFit/version.rb +1 -1
- metadata +15 -177
- data/XCFit/Classes/.gitkeep +0 -0
- data/XCFit/Classes/CliSwift.swift +0 -87
- data/XCFit/Classes/CopyDir.swift +0 -26
- data/XCFit/Classes/Cucumberish/Core/CCIBlockDefinitions.h +0 -400
- data/XCFit/Classes/Cucumberish/Core/Managers/CCIFeaturesManager.h +0 -72
- data/XCFit/Classes/Cucumberish/Core/Managers/CCIFeaturesManager.m +0 -141
- data/XCFit/Classes/Cucumberish/Core/Managers/CCIStepsManager.h +0 -51
- data/XCFit/Classes/Cucumberish/Core/Managers/CCIStepsManager.m +0 -245
- data/XCFit/Classes/Cucumberish/Core/Models/CCIArgument.h +0 -62
- data/XCFit/Classes/Cucumberish/Core/Models/CCIArgument.m +0 -117
- data/XCFit/Classes/Cucumberish/Core/Models/CCIAroundHock.h +0 -37
- data/XCFit/Classes/Cucumberish/Core/Models/CCIAroundHock.m +0 -37
- data/XCFit/Classes/Cucumberish/Core/Models/CCIBackground.h +0 -46
- data/XCFit/Classes/Cucumberish/Core/Models/CCIBackground.m +0 -117
- data/XCFit/Classes/Cucumberish/Core/Models/CCIExample.h +0 -89
- data/XCFit/Classes/Cucumberish/Core/Models/CCIExample.m +0 -128
- data/XCFit/Classes/Cucumberish/Core/Models/CCIFeature.h +0 -49
- data/XCFit/Classes/Cucumberish/Core/Models/CCIFeature.m +0 -174
- data/XCFit/Classes/Cucumberish/Core/Models/CCIHock.h +0 -36
- data/XCFit/Classes/Cucumberish/Core/Models/CCIHock.m +0 -34
- data/XCFit/Classes/Cucumberish/Core/Models/CCILocation.h +0 -61
- data/XCFit/Classes/Cucumberish/Core/Models/CCILocation.m +0 -91
- data/XCFit/Classes/Cucumberish/Core/Models/CCIScenarioDefinition.h +0 -97
- data/XCFit/Classes/Cucumberish/Core/Models/CCIScenarioDefinition.m +0 -224
- data/XCFit/Classes/Cucumberish/Core/Models/CCIStep.h +0 -85
- data/XCFit/Classes/Cucumberish/Core/Models/CCIStep.m +0 -98
- data/XCFit/Classes/Cucumberish/Core/Models/CCIStepDefinition.h +0 -43
- data/XCFit/Classes/Cucumberish/Core/Models/CCIStepDefinition.m +0 -65
- data/XCFit/Classes/Cucumberish/Cucumberish.h +0 -133
- data/XCFit/Classes/Cucumberish/Cucumberish.m +0 -604
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstBuilder.h +0 -15
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstBuilder.m +0 -312
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstNode.h +0 -20
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHAstNode.m +0 -79
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHBackground.h +0 -12
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHBackground.m +0 -18
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHComment.h +0 -11
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHComment.m +0 -27
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDataTable.h +0 -14
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDataTable.m +0 -30
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDocString.h +0 -14
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHDocString.m +0 -29
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHExamples.h +0 -24
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHExamples.m +0 -49
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHFeature.h +0 -24
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHFeature.m +0 -50
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialect.h +0 -25
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialect.m +0 -64
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProvider.h +0 -9
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProvider.m +0 -124
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinDialectProviderProtocol.h +0 -10
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageConstants.h +0 -9
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageConstants.m +0 -10
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageSetting.h +0 -17
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLanguageSetting.m +0 -18
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLine.h +0 -12
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLine.m +0 -179
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineProtocol.h +0 -64
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineSpan.h +0 -9
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHGherkinLineSpan.m +0 -26
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasDescriptionProtocol.h +0 -8
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasLocationProtocol.h +0 -8
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasRowsProtocol.h +0 -8
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasStepsProtocol.h +0 -8
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHHasTagsProtocol.h +0 -8
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHLocation.h +0 -12
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHLocation.m +0 -41
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHNode.h +0 -4
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHNode.m +0 -5
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser+Extensions.h +0 -10
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser+Extensions.m +0 -18
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser.h +0 -132
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParser.m +0 -2735
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParserException.h +0 -55
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHParserException.m +0 -192
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenario.h +0 -14
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenario.m +0 -18
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition.h +0 -23
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition.m +0 -41
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioDefinition_Private.h +0 -6
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioOutline.h +0 -15
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHScenarioOutline.m +0 -26
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStep.h +0 -16
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStep.m +0 -35
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStepArgument.h +0 -4
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHStepArgument.m +0 -5
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableCell.h +0 -13
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableCell.m +0 -28
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableRow.h +0 -13
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTableRow.m +0 -29
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTag.h +0 -13
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTag.m +0 -28
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHToken.h +0 -26
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHToken.m +0 -50
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenMatcher.h +0 -29
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenMatcher.m +0 -283
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenScanner.h +0 -12
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/GHTokenScanner.m +0 -59
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/NSString+Trim.h +0 -7
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/NSString+Trim.m +0 -28
- data/XCFit/Classes/Cucumberish/Dependencies/Gherkin/gherkin-languages.json +0 -2969
- data/XCFit/Classes/Cucumberish/Utils/NSArray+Hashes.h +0 -24
- data/XCFit/Classes/Cucumberish/Utils/NSArray+Hashes.m +0 -44
- data/XCFit/Classes/Cucumberish/Utils/NSObject+Dictionary.h +0 -7
- data/XCFit/Classes/Cucumberish/Utils/NSObject+Dictionary.m +0 -83
- data/XCFit/Classes/Cucumberish/Utils/NSString+Formatter.h +0 -32
- data/XCFit/Classes/Cucumberish/Utils/NSString+Formatter.m +0 -70
- data/XCFit_Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
- data/XCFit_Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -40
- data/XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/Empty.xib +0 -12
- data/XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateIcon.icns +0 -0
- data/XCFit_Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist +0 -61
- data/XCFit_Templates/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -134
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -17
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +0 -13
- data/Xcode7-Templates/XCFit/Base Acceptance Testing Bundle.xctemplate/___POD_NAME___.m +0 -25
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/AcceptanceTests-Bridging-Header.h +0 -1
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/FixtureExample.swift +0 -35
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/SlimTables.h +0 -28
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/TemplateInfo.plist +0 -155
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +0 -12
- data/Xcode7-Templates/XCFit/Base Acceptance Tests.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -33
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/BaseScreen.swift +0 -41
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/CommonStepDefinitions.swift +0 -92
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Extensions.swift +0 -58
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreen.swift +0 -24
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/HomeScreenSteps.swift +0 -28
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/Hooks.swift +0 -26
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/TemplateInfo.plist +0 -159
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___-Bridging-Header.h +0 -15
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.h +0 -23
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.m +0 -28
- data/Xcode7-Templates/XCFit/Cucumberish UI Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___.swift +0 -37
- data/Xcode7-Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateIcon.icns +0 -0
- data/Xcode7-Templates/XCFit/Mac Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -40
- data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/Empty.xib +0 -12
- data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateIcon.icns +0 -0
- data/Xcode7-Templates/XCFit/Mac Acceptance Tests.xctemplate/TemplateInfo.plist +0 -61
- data/Xcode7-Templates/XCFit/MacOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/BaseScreen.swift +0 -42
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/Extensions.swift +0 -60
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeElements.swift +0 -31
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeProtocol.swift +0 -25
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreen.swift +0 -24
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/HomeScreenTest.swift +0 -30
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/ProtocolOrientedTest.swift +0 -45
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/TemplateInfo.plist +0 -141
- data/Xcode7-Templates/XCFit/XCUI POM Test Bundle Base.xctemplate/___PACKAGENAMEASIDENTIFIER___TestBase.swift +0 -30
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon-old.icns +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Testing Bundle.xctemplate/TemplateInfo.plist +0 -40
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon-old.icns +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateIcon@2x.png +0 -0
- data/Xcode7-Templates/XCFit/iOS Acceptance Tests.xctemplate/TemplateInfo.plist +0 -59
- data/Xcode7-Templates/XCFit/iOS UI Cucumberish Testing Bundle.xctemplate/TemplateInfo.plist +0 -39
- data/Xcode7-Templates/XCFit/iOS XCUI POM Test Bundle.xctemplate/TemplateInfo.plist +0 -39
@@ -1,10 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
@class GHGherkinDialect;
|
3
|
-
@class GHLocation;
|
4
|
-
|
5
|
-
@protocol GHGherkinDialectProviderProtocol <NSObject>
|
6
|
-
|
7
|
-
@property (nonatomic, readonly) GHGherkinDialect * defaultDialect;
|
8
|
-
- (GHGherkinDialect *)dialectWithLanguage:(NSString *)theLanguage location:(GHLocation *)theLocation;
|
9
|
-
|
10
|
-
@end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
extern NSString * const GHTagPrefix;
|
3
|
-
extern NSString * const GHCommentPrefix;
|
4
|
-
extern NSString * const GHTitleKeywordSeparator;
|
5
|
-
extern NSString * const GHTableCellSeparator;
|
6
|
-
extern NSString * const GHTableCellEscape;
|
7
|
-
extern NSString * const GHTableCellNewlineEscape;
|
8
|
-
extern NSString * const GHDocStringSeparator;
|
9
|
-
extern NSString * const GHDocStringAlternativeSeparator;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
#import "GHGherkinLanguageConstants.h"
|
2
|
-
|
3
|
-
NSString * const GHTagPrefix = @"@";
|
4
|
-
NSString * const GHCommentPrefix = @"#";
|
5
|
-
NSString * const GHTitleKeywordSeparator = @":";
|
6
|
-
NSString * const GHTableCellSeparator = @"|";
|
7
|
-
NSString * const GHTableCellEscape = @"\\";
|
8
|
-
NSString * const GHTableCellNewlineEscape = @"n";
|
9
|
-
NSString * const GHDocStringSeparator = @"\"\"\"";
|
10
|
-
NSString * const GHDocStringAlternativeSeparator = @"```";
|
@@ -1,17 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
@interface GHGherkinLanguageSetting : NSObject
|
3
|
-
|
4
|
-
@property (nonatomic, strong) NSString * name;
|
5
|
-
@property (nonatomic, strong) NSString * native;
|
6
|
-
@property (nonatomic, strong) NSArray<NSString *> * feature;
|
7
|
-
@property (nonatomic, strong) NSArray<NSString *> * background;
|
8
|
-
@property (nonatomic, strong) NSArray<NSString *> * scenario;
|
9
|
-
@property (nonatomic, strong) NSArray<NSString *> * scenarioOutline;
|
10
|
-
@property (nonatomic, strong) NSArray<NSString *> * examples;
|
11
|
-
@property (nonatomic, strong) NSArray<NSString *> * given;
|
12
|
-
@property (nonatomic, strong) NSArray<NSString *> * when;
|
13
|
-
@property (nonatomic, strong) NSArray<NSString *> * then;
|
14
|
-
@property (nonatomic, strong) NSArray<NSString *> * and;
|
15
|
-
@property (nonatomic, strong) NSArray<NSString *> * but;
|
16
|
-
|
17
|
-
@end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
#import "GHGherkinLanguageSetting.h"
|
2
|
-
|
3
|
-
@implementation GHGherkinLanguageSetting
|
4
|
-
|
5
|
-
@synthesize name;
|
6
|
-
@synthesize native;
|
7
|
-
@synthesize feature;
|
8
|
-
@synthesize background;
|
9
|
-
@synthesize scenario;
|
10
|
-
@synthesize scenarioOutline;
|
11
|
-
@synthesize examples;
|
12
|
-
@synthesize given;
|
13
|
-
@synthesize when;
|
14
|
-
@synthesize then;
|
15
|
-
@synthesize and;
|
16
|
-
@synthesize but;
|
17
|
-
|
18
|
-
@end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
|
3
|
-
#import "GHGherkinLineProtocol.h"
|
4
|
-
|
5
|
-
@interface GHGherkinLine : NSObject <GHGherkinLineProtocol>
|
6
|
-
|
7
|
-
@property (nonatomic, readonly) NSString * lineText;
|
8
|
-
@property (nonatomic, readonly) NSUInteger lineNumber;
|
9
|
-
|
10
|
-
- (id)initWithLine:(NSString *)theLine lineNumber:(NSUInteger)theLineNumber;
|
11
|
-
|
12
|
-
@end
|
@@ -1,179 +0,0 @@
|
|
1
|
-
#import "GHGherkinLine.h"
|
2
|
-
|
3
|
-
#import "GHGherkinLanguageConstants.h"
|
4
|
-
#import "GHGherkinLineSpan.h"
|
5
|
-
|
6
|
-
#import "NSString+Trim.h"
|
7
|
-
|
8
|
-
@interface GHGherkinLine ()
|
9
|
-
|
10
|
-
@property (nonatomic, strong) NSString * lineText;
|
11
|
-
@property (nonatomic, assign) NSUInteger lineNumber;
|
12
|
-
|
13
|
-
- (NSMutableArray<NSArray<NSObject *> *> *)splitCellsFromRow:(NSString *)theRow;
|
14
|
-
- (NSString *)trim:(NSString *)theString trimmedCharsCount:(NSUInteger *)theTrimmedCharsCount;
|
15
|
-
+ (BOOL)startsWithFrom:(NSString *)theText index:(NSInteger)theTextIndex value:(NSString *)theValue;
|
16
|
-
|
17
|
-
@end
|
18
|
-
|
19
|
-
@implementation GHGherkinLine
|
20
|
-
{
|
21
|
-
NSString * trimmedLineText;
|
22
|
-
}
|
23
|
-
|
24
|
-
@synthesize lineText;
|
25
|
-
@synthesize lineNumber;
|
26
|
-
|
27
|
-
- (id)initWithLine:(NSString *)theLine lineNumber:(NSUInteger)theLineNumber
|
28
|
-
{
|
29
|
-
if (self = [super init])
|
30
|
-
{
|
31
|
-
lineNumber = theLineNumber;
|
32
|
-
lineText = theLine;
|
33
|
-
trimmedLineText = [theLine stringByTrimmingStartWithCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
34
|
-
}
|
35
|
-
|
36
|
-
return self;
|
37
|
-
}
|
38
|
-
|
39
|
-
- (void)detach
|
40
|
-
{
|
41
|
-
//nop
|
42
|
-
}
|
43
|
-
|
44
|
-
- (NSUInteger)indent
|
45
|
-
{
|
46
|
-
return [lineText length] - [trimmedLineText length];
|
47
|
-
}
|
48
|
-
|
49
|
-
- (BOOL)empty
|
50
|
-
{
|
51
|
-
return trimmedLineText && ![trimmedLineText length];
|
52
|
-
}
|
53
|
-
|
54
|
-
- (BOOL)hasPrefix:(NSString *)theText
|
55
|
-
{
|
56
|
-
return [trimmedLineText hasPrefix: theText];
|
57
|
-
}
|
58
|
-
|
59
|
-
- (BOOL)hasTitleKeywordPrefix:(NSString *)theText
|
60
|
-
{
|
61
|
-
NSUInteger textLength = [theText length];
|
62
|
-
return [trimmedLineText length] > textLength && [trimmedLineText hasPrefix: theText] &&
|
63
|
-
[GHGherkinLine startsWithFrom: trimmedLineText index: textLength value: GHTitleKeywordSeparator];
|
64
|
-
}
|
65
|
-
|
66
|
-
+ (BOOL)startsWithFrom:(NSString *)theText index:(NSInteger)theTextIndex value:(NSString *)theValue
|
67
|
-
{
|
68
|
-
NSUInteger valueLength = [theValue length];
|
69
|
-
NSString * textSubstring = [theText substringWithRange: NSMakeRange(theTextIndex, valueLength)];
|
70
|
-
NSString * valueSubstring = [theValue substringWithRange: NSMakeRange(0, valueLength)];
|
71
|
-
|
72
|
-
return [textSubstring compare: valueSubstring options: NSLiteralSearch] == NSOrderedSame;
|
73
|
-
}
|
74
|
-
|
75
|
-
- (NSString *)lineTextByRemovingIndent:(NSInteger)theIndentToRemove
|
76
|
-
{
|
77
|
-
if (theIndentToRemove < 0 || theIndentToRemove > [self indent])
|
78
|
-
return trimmedLineText;
|
79
|
-
|
80
|
-
return [lineText substringFromIndex: theIndentToRemove];
|
81
|
-
}
|
82
|
-
|
83
|
-
- (NSString *)trimmedRest:(NSUInteger)theLength
|
84
|
-
{
|
85
|
-
return [[trimmedLineText substringFromIndex: theLength] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
86
|
-
}
|
87
|
-
|
88
|
-
- (NSArray<GHGherkinLineSpan *> *)tags
|
89
|
-
{
|
90
|
-
NSInteger position = [self indent];
|
91
|
-
NSMutableArray * tags = [[NSMutableArray alloc] init];
|
92
|
-
|
93
|
-
for (NSString * item in [trimmedLineText componentsSeparatedByCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]])
|
94
|
-
{
|
95
|
-
if ([item length])
|
96
|
-
{
|
97
|
-
[tags addObject: [[GHGherkinLineSpan alloc] initWithColumn: position + 1 text: item]];
|
98
|
-
position += [item length];
|
99
|
-
}
|
100
|
-
position++; // separator
|
101
|
-
}
|
102
|
-
|
103
|
-
return [[NSArray alloc] initWithArray: tags];
|
104
|
-
}
|
105
|
-
|
106
|
-
- (NSArray<GHGherkinLineSpan *> *)tableCells
|
107
|
-
{
|
108
|
-
NSMutableArray<NSArray<NSObject *> *> * items = [self splitCellsFromRow: trimmedLineText];
|
109
|
-
[items removeLastObject];
|
110
|
-
|
111
|
-
NSMutableArray * tableCells = [[NSMutableArray alloc] init];
|
112
|
-
BOOL isBeforeFirst = YES;
|
113
|
-
for (NSArray * item in items)
|
114
|
-
{
|
115
|
-
if (!isBeforeFirst)
|
116
|
-
{
|
117
|
-
NSUInteger trimmedStart = 0;
|
118
|
-
NSString * cellText = [self trim: [item firstObject] trimmedCharsCount: &trimmedStart];
|
119
|
-
NSUInteger cellPosition = [[item lastObject] integerValue] + trimmedStart;
|
120
|
-
|
121
|
-
if (![cellText length])
|
122
|
-
cellPosition = [[item lastObject] integerValue];
|
123
|
-
|
124
|
-
[tableCells addObject: [[GHGherkinLineSpan alloc] initWithColumn: [self indent] + cellPosition + 1 text: cellText]];
|
125
|
-
}
|
126
|
-
|
127
|
-
isBeforeFirst = NO;
|
128
|
-
}
|
129
|
-
|
130
|
-
return tableCells;
|
131
|
-
}
|
132
|
-
|
133
|
-
- (NSMutableArray<NSArray<NSObject *> *> *)splitCellsFromRow:(NSString *)theRow
|
134
|
-
{
|
135
|
-
NSMutableString * cell = [[NSMutableString alloc] init];
|
136
|
-
NSInteger startPos = 0;
|
137
|
-
NSMutableArray<NSArray<NSObject *> *> * items = [[NSMutableArray alloc] init];
|
138
|
-
NSUInteger rowLength = [theRow length];
|
139
|
-
for (NSUInteger i = 0; i < rowLength; i++)
|
140
|
-
{
|
141
|
-
NSString * stringCharacter = [theRow substringWithRange: NSMakeRange(i, 1)];
|
142
|
-
if ([stringCharacter isEqualToString: GHTableCellSeparator])
|
143
|
-
{
|
144
|
-
[items addObject: @[ cell, @(startPos)]];
|
145
|
-
cell = [[NSMutableString alloc] init];
|
146
|
-
startPos = i + 1;
|
147
|
-
}
|
148
|
-
else if ([stringCharacter isEqualToString: GHTableCellEscape])
|
149
|
-
{
|
150
|
-
stringCharacter = i + 1 < rowLength ? [theRow substringWithRange: NSMakeRange(++i, 1)] : nil;
|
151
|
-
if ([stringCharacter isEqualToString: GHTableCellNewlineEscape])
|
152
|
-
[cell appendString: @"\n"];
|
153
|
-
else
|
154
|
-
{
|
155
|
-
if (![stringCharacter isEqualToString: GHTableCellSeparator] && ![stringCharacter isEqualToString: GHTableCellEscape])
|
156
|
-
[cell appendString: GHTableCellEscape];
|
157
|
-
[cell appendString: stringCharacter];
|
158
|
-
}
|
159
|
-
}
|
160
|
-
else
|
161
|
-
[cell appendString: stringCharacter];
|
162
|
-
}
|
163
|
-
[items addObject: @[ cell, @(startPos)]];
|
164
|
-
|
165
|
-
return items;
|
166
|
-
}
|
167
|
-
|
168
|
-
- (NSString *)trim:(NSString *)theString trimmedCharsCount:(NSUInteger *)theTrimmedCharsCount
|
169
|
-
{
|
170
|
-
NSUInteger trimmedCharsCount = 0;
|
171
|
-
NSCharacterSet * whitespaceAndNewLineCharacterSet = [NSCharacterSet whitespaceAndNewlineCharacterSet];
|
172
|
-
while (trimmedCharsCount < [theString length] && [whitespaceAndNewLineCharacterSet characterIsMember: [theString characterAtIndex: trimmedCharsCount]])
|
173
|
-
trimmedCharsCount++;
|
174
|
-
|
175
|
-
*theTrimmedCharsCount = trimmedCharsCount;
|
176
|
-
return [theString stringByTrimmingCharactersInSet: whitespaceAndNewLineCharacterSet];
|
177
|
-
}
|
178
|
-
|
179
|
-
@end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
@class GHGherkinLineSpan;
|
3
|
-
|
4
|
-
@protocol GHGherkinLineProtocol <NSObject>
|
5
|
-
|
6
|
-
@property (nonatomic, readonly) NSString * lineText;
|
7
|
-
@property (nonatomic, readonly) NSUInteger lineNumber;
|
8
|
-
@property (nonatomic, readonly) NSUInteger indent;
|
9
|
-
|
10
|
-
/// <summary>
|
11
|
-
/// Called by the parser to indicate non-streamed reading (e.g. during look-ahead).
|
12
|
-
/// </summary>
|
13
|
-
/// <remarks>
|
14
|
-
/// If the implementation depends on streamed reading behavior, with this method, it can clone itself, so that it will be detached.
|
15
|
-
/// </remarks>
|
16
|
-
- (void)detach;
|
17
|
-
|
18
|
-
/// <summary>
|
19
|
-
/// Gets if the line is empty or contains whitespaces only.
|
20
|
-
/// </summary>
|
21
|
-
/// <returns>YES, if empty or contains whitespaces only; otherwise, NO.</returns>
|
22
|
-
- (BOOL)empty;
|
23
|
-
|
24
|
-
/// <summary>
|
25
|
-
/// Determines whether the beginning of the line (wihtout whitespaces) matches a specified string.
|
26
|
-
/// </summary>
|
27
|
-
/// <param name="theText">The string to compare. </param>
|
28
|
-
/// <returns>YES if text matches the beginning of this line; otherwise, NO.</returns>
|
29
|
-
- (BOOL)hasPrefix:(NSString *)theText;
|
30
|
-
|
31
|
-
/// <summary>
|
32
|
-
/// Determines whether the beginning of the line (wihtout whitespaces) matches a specified title keyword (ie. a keyword followed by a ':' character).
|
33
|
-
/// </summary>
|
34
|
-
/// <param name="theKeyword">The keyword to compare. </param>
|
35
|
-
/// <returns>YES if keyword matches the beginning of this line and followed by a ':' character; otherwise, NO.</returns>
|
36
|
-
- (BOOL)hasTitleKeywordPrefix:(NSString *)theKeyword;
|
37
|
-
|
38
|
-
/// <summary>
|
39
|
-
/// Returns the line text
|
40
|
-
/// </summary>
|
41
|
-
/// <param name="theIndentToRemove">The maximum number of whitespace characters to remove. -1 removes all leading whitespaces.</param>
|
42
|
-
/// <returns>The line text.</returns>
|
43
|
-
- (NSString *)lineTextByRemovingIndent:(NSInteger)theIndentToRemove;
|
44
|
-
|
45
|
-
/// <summary>
|
46
|
-
/// Returns the remaining part of the line.
|
47
|
-
/// </summary>
|
48
|
-
/// <param name="theLength"></param>
|
49
|
-
/// <returns></returns>
|
50
|
-
- (NSString *)trimmedRest:(NSUInteger)theLength;
|
51
|
-
|
52
|
-
/// <summary>
|
53
|
-
/// Tries parsing the line as a tag list, and returns the tags wihtout the leading '@' characters.
|
54
|
-
/// </summary>
|
55
|
-
/// <returns>(position,text) pairs, position is 0-based index</returns>
|
56
|
-
- (NSArray<GHGherkinLineSpan *> *)tags;
|
57
|
-
|
58
|
-
/// <summary>
|
59
|
-
/// Tries parsing the line as table row and returns the trimmed cell values.
|
60
|
-
/// </summary>
|
61
|
-
/// <returns>(position,text) pairs, position is 0-based index</returns>
|
62
|
-
- (NSArray<GHGherkinLineSpan *> *)tableCells;
|
63
|
-
|
64
|
-
@end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
@interface GHGherkinLineSpan : NSObject
|
3
|
-
|
4
|
-
@property (nonatomic, readonly) NSUInteger column;
|
5
|
-
@property (nonatomic, readonly) NSString * text;
|
6
|
-
|
7
|
-
- (id)initWithColumn:(NSUInteger)theColumn text:(NSString *)theText;
|
8
|
-
|
9
|
-
@end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
|
2
|
-
#import "GHGherkinLineSpan.h"
|
3
|
-
|
4
|
-
@interface GHGherkinLineSpan ()
|
5
|
-
|
6
|
-
@property (nonatomic, assign) NSUInteger column;
|
7
|
-
@property (nonatomic, strong) NSString * text;
|
8
|
-
|
9
|
-
@end
|
10
|
-
|
11
|
-
@implementation GHGherkinLineSpan
|
12
|
-
|
13
|
-
@synthesize column;
|
14
|
-
@synthesize text;
|
15
|
-
|
16
|
-
- (id)initWithColumn:(NSUInteger)theColumn text:(NSString *)theText
|
17
|
-
{
|
18
|
-
if (self = [super init])
|
19
|
-
{
|
20
|
-
column = theColumn;
|
21
|
-
text = theText;
|
22
|
-
}
|
23
|
-
return self;
|
24
|
-
}
|
25
|
-
|
26
|
-
@end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
@interface GHLocation : NSObject
|
3
|
-
|
4
|
-
@property (nonatomic, readonly) NSUInteger line;
|
5
|
-
@property (nonatomic, readonly) NSUInteger column;
|
6
|
-
|
7
|
-
- (id)init;
|
8
|
-
- (id)initWithLine:(NSUInteger)theLine;
|
9
|
-
- (id)initWithColumn:(NSUInteger)theColumn;
|
10
|
-
- (id)initWithLine:(NSUInteger)theLine column:(NSUInteger)theColumn;
|
11
|
-
|
12
|
-
@end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
#import "GHLocation.h"
|
2
|
-
|
3
|
-
@interface GHLocation ()
|
4
|
-
|
5
|
-
@property (nonatomic, assign) NSUInteger line;
|
6
|
-
@property (nonatomic, assign) NSUInteger column;
|
7
|
-
|
8
|
-
@end
|
9
|
-
|
10
|
-
@implementation GHLocation
|
11
|
-
|
12
|
-
@synthesize line;
|
13
|
-
@synthesize column;
|
14
|
-
|
15
|
-
- (id)init
|
16
|
-
{
|
17
|
-
return [self initWithLine: 0 column: 0];
|
18
|
-
}
|
19
|
-
|
20
|
-
- (id)initWithLine:(NSUInteger)theLine
|
21
|
-
{
|
22
|
-
return [self initWithLine: theLine column: 0];
|
23
|
-
}
|
24
|
-
|
25
|
-
- (id)initWithColumn:(NSUInteger)theColumn
|
26
|
-
{
|
27
|
-
return [self initWithLine: 0 column: theColumn];
|
28
|
-
}
|
29
|
-
|
30
|
-
- (id)initWithLine:(NSUInteger)theLine column:(NSUInteger)theColumn
|
31
|
-
{
|
32
|
-
if (self = [super init])
|
33
|
-
{
|
34
|
-
line = theLine;
|
35
|
-
column = theColumn;
|
36
|
-
}
|
37
|
-
|
38
|
-
return self;
|
39
|
-
}
|
40
|
-
|
41
|
-
@end
|