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,13 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
#import "GHHasLocationProtocol.h"
|
3
|
-
|
4
|
-
@class GHLocation;
|
5
|
-
|
6
|
-
@interface GHTableCell : NSObject <GHHasLocationProtocol>
|
7
|
-
|
8
|
-
@property (nonatomic, readonly) GHLocation * location;
|
9
|
-
@property (nonatomic, readonly) NSString * value;
|
10
|
-
|
11
|
-
- (id)initWithLocation:(GHLocation *)theLocation value:(NSString *)theValue;
|
12
|
-
|
13
|
-
@end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
#import "GHTableCell.h"
|
2
|
-
|
3
|
-
#import "GHLocation.h"
|
4
|
-
|
5
|
-
@interface GHTableCell ()
|
6
|
-
|
7
|
-
@property (nonatomic, strong) GHLocation * location;
|
8
|
-
@property (nonatomic, strong) NSString * value;
|
9
|
-
|
10
|
-
@end
|
11
|
-
|
12
|
-
@implementation GHTableCell
|
13
|
-
|
14
|
-
@synthesize location;
|
15
|
-
@synthesize value;
|
16
|
-
|
17
|
-
- (id)initWithLocation:(GHLocation *)theLocation value:(NSString *)theValue
|
18
|
-
{
|
19
|
-
if (self = [super init])
|
20
|
-
{
|
21
|
-
location = theLocation;
|
22
|
-
value = theValue;
|
23
|
-
}
|
24
|
-
|
25
|
-
return self;
|
26
|
-
}
|
27
|
-
|
28
|
-
@end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
#import "GHHasLocationProtocol.h"
|
3
|
-
|
4
|
-
@class GHTableCell;
|
5
|
-
|
6
|
-
@interface GHTableRow : NSObject <GHHasLocationProtocol>
|
7
|
-
|
8
|
-
@property (nonatomic, readonly) GHLocation * location;
|
9
|
-
@property (nonatomic, readonly) NSArray<GHTableCell *> * cells;
|
10
|
-
|
11
|
-
- (id)initWithLocation:(GHLocation *)theLocation cells:(NSArray<GHTableCell *> *)theCells;
|
12
|
-
|
13
|
-
@end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
#import "GHTableRow.h"
|
2
|
-
|
3
|
-
#import "GHLocation.h"
|
4
|
-
#import "GHStepArgument.h"
|
5
|
-
|
6
|
-
@interface GHTableRow ()
|
7
|
-
|
8
|
-
@property (nonatomic, strong) GHLocation * location;
|
9
|
-
@property (nonatomic, strong) NSArray<GHTableCell *> * cells;
|
10
|
-
|
11
|
-
@end
|
12
|
-
|
13
|
-
@implementation GHTableRow
|
14
|
-
|
15
|
-
@synthesize location;
|
16
|
-
@synthesize cells;
|
17
|
-
|
18
|
-
- (id)initWithLocation:(GHLocation *)theLocation cells:(NSArray<GHTableCell *> *)theCells
|
19
|
-
{
|
20
|
-
if (self = [super init])
|
21
|
-
{
|
22
|
-
location = theLocation;
|
23
|
-
cells = theCells;
|
24
|
-
}
|
25
|
-
|
26
|
-
return self;
|
27
|
-
}
|
28
|
-
|
29
|
-
@end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
@class GHLocation;
|
3
|
-
|
4
|
-
#import "GHHasLocationProtocol.h"
|
5
|
-
|
6
|
-
@interface GHTag : NSObject <GHHasLocationProtocol>
|
7
|
-
|
8
|
-
@property (nonatomic, readonly) GHLocation * location;
|
9
|
-
@property (nonatomic, readonly) NSString * name;
|
10
|
-
|
11
|
-
- (id)initWithLocation:(GHLocation *)theLocation name:(NSString *)theName;
|
12
|
-
|
13
|
-
@end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
#import "GHTag.h"
|
2
|
-
|
3
|
-
#import "GHLocation.h"
|
4
|
-
|
5
|
-
@interface GHTag ()
|
6
|
-
|
7
|
-
@property (nonatomic, strong) GHLocation * location;
|
8
|
-
@property (nonatomic, strong) NSString * name;
|
9
|
-
|
10
|
-
@end
|
11
|
-
|
12
|
-
@implementation GHTag
|
13
|
-
|
14
|
-
@synthesize location;
|
15
|
-
@synthesize name;
|
16
|
-
|
17
|
-
- (id)initWithLocation:(GHLocation *)theLocation name:(NSString *)theName
|
18
|
-
{
|
19
|
-
if (self = [super init])
|
20
|
-
{
|
21
|
-
location = theLocation;
|
22
|
-
name = theName;
|
23
|
-
}
|
24
|
-
|
25
|
-
return self;
|
26
|
-
}
|
27
|
-
|
28
|
-
@end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
#import "GHGherkinLineProtocol.h"
|
3
|
-
|
4
|
-
@class GHGherkinLineSpan;
|
5
|
-
@class GHGherkinDialect;
|
6
|
-
@class GHLocation;
|
7
|
-
|
8
|
-
#import "GHAstNode.h"
|
9
|
-
|
10
|
-
@interface GHToken : NSObject
|
11
|
-
|
12
|
-
@property (nonatomic, readonly, getter=isEOF) BOOL eof;
|
13
|
-
@property (nonatomic, strong) id<GHGherkinLineProtocol> line;
|
14
|
-
@property (nonatomic, assign) GHTokenType matchedType;
|
15
|
-
@property (nonatomic, strong) NSString * matchedKeyword;
|
16
|
-
@property (nonatomic, strong) NSString * matchedText;
|
17
|
-
@property (nonatomic, strong) NSArray<GHGherkinLineSpan *> * matchedItems;
|
18
|
-
@property (nonatomic, assign) NSUInteger matchedIndent;
|
19
|
-
@property (nonatomic, strong) GHGherkinDialect * matchedGherkinDialect;
|
20
|
-
@property (nonatomic, strong) GHLocation * location;
|
21
|
-
|
22
|
-
- (id)initWithGherkinLine:(id<GHGherkinLineProtocol>)theGherkinLine location:(GHLocation *)theLocation;
|
23
|
-
- (void)detach;
|
24
|
-
- (NSString *)tokenValue;
|
25
|
-
|
26
|
-
@end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
#import "GHToken.h"
|
2
|
-
|
3
|
-
#import "GHGherkinLineProtocol.h"
|
4
|
-
|
5
|
-
#import "GHParser.h"
|
6
|
-
|
7
|
-
@implementation GHToken
|
8
|
-
|
9
|
-
@synthesize eof;
|
10
|
-
@synthesize line;
|
11
|
-
@synthesize matchedType;
|
12
|
-
@synthesize matchedKeyword;
|
13
|
-
@synthesize matchedText;
|
14
|
-
@synthesize matchedItems;
|
15
|
-
@synthesize matchedIndent;
|
16
|
-
@synthesize matchedGherkinDialect;
|
17
|
-
@synthesize location;
|
18
|
-
|
19
|
-
- (id)initWithGherkinLine:(id<GHGherkinLineProtocol>)theGherkinLine location:(GHLocation *)theLocation
|
20
|
-
{
|
21
|
-
if (self = [super init])
|
22
|
-
{
|
23
|
-
line = theGherkinLine;
|
24
|
-
location = theLocation;
|
25
|
-
}
|
26
|
-
|
27
|
-
return self;
|
28
|
-
}
|
29
|
-
|
30
|
-
- (void)detach
|
31
|
-
{
|
32
|
-
[line detach];
|
33
|
-
}
|
34
|
-
|
35
|
-
- (BOOL)isEOF
|
36
|
-
{
|
37
|
-
return line == nil;
|
38
|
-
}
|
39
|
-
|
40
|
-
- (NSString *)tokenValue
|
41
|
-
{
|
42
|
-
return [self isEOF] ? @"EOF" : [line lineTextByRemovingIndent: -1];
|
43
|
-
}
|
44
|
-
|
45
|
-
- (NSString *)description
|
46
|
-
{
|
47
|
-
return [NSString stringWithFormat: @"%d: %@/%@", matchedType, matchedKeyword, matchedText];
|
48
|
-
}
|
49
|
-
|
50
|
-
@end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
#import <Foundation/Foundation.h>
|
2
|
-
#import "GHParser.h"
|
3
|
-
|
4
|
-
@class GHToken;
|
5
|
-
@class GHGherkinDialect;
|
6
|
-
@class GHGherkinDialectProvider;
|
7
|
-
|
8
|
-
@interface GHTokenMatcher : NSObject <GHTokenMatcherProtocol>
|
9
|
-
|
10
|
-
- (GHGherkinDialect *)currentDialect;
|
11
|
-
- (id)initWithDialectProvider:(GHGherkinDialectProvider *)theDialectProvider;
|
12
|
-
- (id)initWithLanguage:(NSString *)theLanguage;
|
13
|
-
- (void)reset;
|
14
|
-
- (BOOL)matchEOFWithToken:(GHToken *)theToken;
|
15
|
-
- (BOOL)matchOtherWithToken:(GHToken *)theToken;
|
16
|
-
- (BOOL)matchEmptyWithToken:(GHToken *)theToken;
|
17
|
-
- (BOOL)matchCommentWithToken:(GHToken *)theToken;
|
18
|
-
- (BOOL)matchLanguageWithToken:(GHToken *)theToken;
|
19
|
-
- (BOOL)matchTagLineWithToken:(GHToken *)theToken;
|
20
|
-
- (BOOL)matchFeatureLineWithToken:(GHToken *)theToken;
|
21
|
-
- (BOOL)matchBackgroundLineWithToken:(GHToken *)theToken;
|
22
|
-
- (BOOL)matchScenarioLineWithToken:(GHToken *)theToken;
|
23
|
-
- (BOOL)matchScenarioOutlineLineWithToken:(GHToken *)theToken;
|
24
|
-
- (BOOL)matchExamplesLineWithToken:(GHToken *)theToken;
|
25
|
-
- (BOOL)matchDocStringSeparatorWithToken:(GHToken *)theToken;
|
26
|
-
- (BOOL)matchStepLineWithToken:(GHToken *)theToken;
|
27
|
-
- (BOOL)matchTableRowWithToken:(GHToken *)theToken;
|
28
|
-
|
29
|
-
@end
|
@@ -1,283 +0,0 @@
|
|
1
|
-
#import "GHTokenMatcher.h"
|
2
|
-
|
3
|
-
#import "GHGherkinDialectProvider.h"
|
4
|
-
#import "GHGherkinLineSpan.h"
|
5
|
-
#import "GHToken.h"
|
6
|
-
#import "GHAstNode.h"
|
7
|
-
#import "GHGherkinDialect.h"
|
8
|
-
#import "GHGherkinLanguageConstants.h"
|
9
|
-
#import "GHLocation.h"
|
10
|
-
|
11
|
-
#import "GHParser.h"
|
12
|
-
|
13
|
-
@interface GHTokenMatcher ()
|
14
|
-
|
15
|
-
- (NSString *)unescapeDocString:(NSString *)theText;
|
16
|
-
- (BOOL)matchDocStringSeparatorWithToken:(GHToken *)theToken separator:(NSString *)theSeparator open:(BOOL)isOpen;
|
17
|
-
- (BOOL)matchTitleLineWithToken:(GHToken *)theToken tokenType:(GHTokenType)theTokenType keywords:(NSArray<NSString *> *)theKeywords;
|
18
|
-
- (GHParserException *)matcherExceptionWithToken:(GHToken *)theToken message:(NSString *)theMessage;
|
19
|
-
|
20
|
-
- (void)setTokenMatched:(GHToken *)theToken tokenType:(GHTokenType)theMatchedType text:(NSString *)theText keyword:(NSString *)theKeyword indent:(NSNumber *)theIndent items:(NSArray<GHGherkinLineSpan *> *)theItems;
|
21
|
-
|
22
|
-
@end
|
23
|
-
|
24
|
-
@implementation GHTokenMatcher
|
25
|
-
{
|
26
|
-
id<GHGherkinDialectProviderProtocol> dialectProvider;
|
27
|
-
GHGherkinDialect * currentDialect;
|
28
|
-
NSString * activeDocStringSeparator;
|
29
|
-
NSInteger indentToRemove;
|
30
|
-
}
|
31
|
-
|
32
|
-
- (GHGherkinDialect *)currentDialect
|
33
|
-
{
|
34
|
-
if (!currentDialect)
|
35
|
-
currentDialect = [dialectProvider defaultDialect];
|
36
|
-
|
37
|
-
return currentDialect;
|
38
|
-
}
|
39
|
-
|
40
|
-
- (id)init
|
41
|
-
{
|
42
|
-
if (self = [super init])
|
43
|
-
{
|
44
|
-
dialectProvider = [[GHGherkinDialectProvider alloc] init];
|
45
|
-
}
|
46
|
-
|
47
|
-
return self;
|
48
|
-
}
|
49
|
-
|
50
|
-
- (id)initWithDialectProvider:(id<GHGherkinDialectProviderProtocol>)theDialectProvider
|
51
|
-
{
|
52
|
-
if (self = [super init])
|
53
|
-
{
|
54
|
-
dialectProvider = theDialectProvider;
|
55
|
-
}
|
56
|
-
|
57
|
-
return self;
|
58
|
-
}
|
59
|
-
|
60
|
-
- (id)initWithLanguage:(NSString *)theLanguage
|
61
|
-
{
|
62
|
-
return [self initWithDialectProvider: [[GHGherkinDialectProvider alloc] initWithLanguage: theLanguage]];
|
63
|
-
}
|
64
|
-
|
65
|
-
- (void)reset
|
66
|
-
{
|
67
|
-
activeDocStringSeparator = nil;
|
68
|
-
indentToRemove = 0;
|
69
|
-
if (currentDialect != [dialectProvider defaultDialect])
|
70
|
-
currentDialect = [dialectProvider defaultDialect];
|
71
|
-
}
|
72
|
-
|
73
|
-
- (void)setTokenMatched:(GHToken *)theToken tokenType:(GHTokenType)theMatchedType text:(NSString *)theText keyword:(NSString *)theKeyword indent:(NSNumber *)theIndent items:(NSArray<GHGherkinLineSpan *> *)theItems
|
74
|
-
{
|
75
|
-
[theToken setMatchedType: theMatchedType];
|
76
|
-
[theToken setMatchedKeyword: theKeyword];
|
77
|
-
[theToken setMatchedText: theText];
|
78
|
-
[theToken setMatchedItems: theItems];
|
79
|
-
[theToken setMatchedGherkinDialect: currentDialect];
|
80
|
-
[theToken setMatchedIndent: theIndent ? [theIndent integerValue] : [theToken line] ? [[theToken line] indent] : 0];
|
81
|
-
|
82
|
-
[theToken setLocation: [[GHLocation alloc] initWithLine: [[theToken location] line] column: [theToken matchedIndent] + 1]];
|
83
|
-
}
|
84
|
-
|
85
|
-
- (BOOL)matchEOFWithToken:(GHToken *)theToken
|
86
|
-
{
|
87
|
-
if ([theToken isEOF])
|
88
|
-
{
|
89
|
-
[self setTokenMatched: theToken tokenType: GHTokenTypeEOF text: nil keyword: nil indent: nil items: nil];
|
90
|
-
|
91
|
-
return YES;
|
92
|
-
}
|
93
|
-
|
94
|
-
return NO;
|
95
|
-
}
|
96
|
-
|
97
|
-
- (BOOL)matchOtherWithToken:(GHToken *)theToken
|
98
|
-
{
|
99
|
-
NSString * text = [[theToken line] lineTextByRemovingIndent: indentToRemove]; //take the entire line, except removing DocString indents
|
100
|
-
[self setTokenMatched: theToken tokenType: GHTokenTypeOther text: [self unescapeDocString: text] keyword: nil indent: @(0) items: nil];
|
101
|
-
|
102
|
-
return YES;
|
103
|
-
}
|
104
|
-
|
105
|
-
- (BOOL)matchEmptyWithToken:(GHToken *)theToken
|
106
|
-
{
|
107
|
-
if ([[theToken line] empty])
|
108
|
-
{
|
109
|
-
[self setTokenMatched: theToken tokenType: GHTokenTypeEmpty text: nil keyword: nil indent: nil items: nil];
|
110
|
-
|
111
|
-
return YES;
|
112
|
-
}
|
113
|
-
|
114
|
-
return NO;
|
115
|
-
}
|
116
|
-
|
117
|
-
- (BOOL)matchCommentWithToken:(GHToken *)theToken
|
118
|
-
{
|
119
|
-
if ([[theToken line] hasPrefix: GHCommentPrefix])
|
120
|
-
{
|
121
|
-
NSString * text = [[theToken line] lineTextByRemovingIndent: 0]; //take the entire line
|
122
|
-
[self setTokenMatched: theToken tokenType: GHTokenTypeComment text: text keyword: nil indent: @(0) items: nil];
|
123
|
-
|
124
|
-
return YES;
|
125
|
-
}
|
126
|
-
return NO;
|
127
|
-
}
|
128
|
-
|
129
|
-
- (GHParserException *)matcherExceptionWithToken:(GHToken *)theToken message:(NSString *)theMessage
|
130
|
-
{
|
131
|
-
GHLocation * exceptionLocation = [[GHLocation alloc] initWithLine: [[theToken location] line] column: [[theToken line] indent] + 1];
|
132
|
-
return [[GHAstBuilderException alloc] initWithMessage: theMessage location: exceptionLocation];
|
133
|
-
}
|
134
|
-
|
135
|
-
- (BOOL)matchLanguageWithToken:(GHToken *)theToken
|
136
|
-
{
|
137
|
-
NSRegularExpression * regularExpression = [NSRegularExpression regularExpressionWithPattern: @"^\\s*#\\s*language\\s*:\\s*([a-zA-Z\\-_]+)\\s*$" options: 0 error: nil];
|
138
|
-
NSString * lineText = [[theToken line] lineTextByRemovingIndent: 0];
|
139
|
-
NSArray<NSTextCheckingResult *> * matches = [regularExpression matchesInString: lineText options: 0 range: NSMakeRange(0, [lineText length])];
|
140
|
-
if ([matches count])
|
141
|
-
{
|
142
|
-
NSRange range = [[matches firstObject] rangeAtIndex: 1];
|
143
|
-
if (range.location != NSNotFound)
|
144
|
-
{
|
145
|
-
NSString * language = [lineText substringWithRange: range];
|
146
|
-
[self setTokenMatched: theToken tokenType: GHTokenTypeLanguage text: language keyword: nil indent: nil items: nil];
|
147
|
-
|
148
|
-
//@try
|
149
|
-
//{
|
150
|
-
currentDialect = [dialectProvider dialectWithLanguage: language location: [theToken location]];
|
151
|
-
//}
|
152
|
-
//@catch (NSException * exception)
|
153
|
-
//{
|
154
|
-
// @throw [self matcherExceptionWithToken: theToken message: [exception reason]];
|
155
|
-
//}
|
156
|
-
|
157
|
-
return YES;
|
158
|
-
}
|
159
|
-
}
|
160
|
-
return NO;
|
161
|
-
}
|
162
|
-
|
163
|
-
- (BOOL)matchTagLineWithToken:(GHToken *)theToken
|
164
|
-
{
|
165
|
-
if ([[theToken line] hasPrefix: GHTagPrefix])
|
166
|
-
{
|
167
|
-
[self setTokenMatched: theToken tokenType: GHTokenTypeTagLine text: nil keyword: nil indent: nil items: [[theToken line] tags]];
|
168
|
-
|
169
|
-
return YES;
|
170
|
-
}
|
171
|
-
return NO;
|
172
|
-
}
|
173
|
-
|
174
|
-
- (BOOL)matchFeatureLineWithToken:(GHToken *)theToken
|
175
|
-
{
|
176
|
-
return [self matchTitleLineWithToken: theToken tokenType: GHTokenTypeFeatureLine keywords: [currentDialect featureKeywords]];
|
177
|
-
}
|
178
|
-
|
179
|
-
- (BOOL)matchBackgroundLineWithToken:(GHToken *)theToken
|
180
|
-
{
|
181
|
-
return [self matchTitleLineWithToken: theToken tokenType: GHTokenTypeBackgroundLine keywords: [currentDialect backgroundKeywords]];
|
182
|
-
}
|
183
|
-
|
184
|
-
- (BOOL)matchScenarioLineWithToken:(GHToken *)theToken
|
185
|
-
{
|
186
|
-
return [self matchTitleLineWithToken: theToken tokenType: GHTokenTypeScenarioLine keywords: [currentDialect scenarioKeywords]];
|
187
|
-
}
|
188
|
-
|
189
|
-
- (BOOL)matchScenarioOutlineLineWithToken:(GHToken *)theToken
|
190
|
-
{
|
191
|
-
return [self matchTitleLineWithToken: theToken tokenType: GHTokenTypeScenarioOutlineLine keywords: [currentDialect scenarioOutlineKeywords]];
|
192
|
-
}
|
193
|
-
|
194
|
-
- (BOOL)matchExamplesLineWithToken:(GHToken *)theToken
|
195
|
-
{
|
196
|
-
return [self matchTitleLineWithToken: theToken tokenType: GHTokenTypeExamplesLine keywords: [currentDialect examplesKeywords]];
|
197
|
-
}
|
198
|
-
|
199
|
-
- (BOOL)matchTitleLineWithToken:(GHToken *)theToken tokenType:(GHTokenType)theTokenType keywords:(NSArray<NSString *> *)theKeywords
|
200
|
-
{
|
201
|
-
for (NSString * keyword in theKeywords)
|
202
|
-
{
|
203
|
-
if ([[theToken line] hasTitleKeywordPrefix: keyword])
|
204
|
-
{
|
205
|
-
NSString * title = [[theToken line] trimmedRest: ([keyword length] + [GHTitleKeywordSeparator length])];
|
206
|
-
[self setTokenMatched: theToken tokenType: theTokenType text: title keyword: keyword indent: nil items: nil];
|
207
|
-
|
208
|
-
return YES;
|
209
|
-
}
|
210
|
-
}
|
211
|
-
return NO;
|
212
|
-
}
|
213
|
-
|
214
|
-
- (BOOL)matchDocStringSeparatorWithToken:(GHToken *)theToken
|
215
|
-
{
|
216
|
-
return activeDocStringSeparator == nil
|
217
|
-
// open
|
218
|
-
? ([self matchDocStringSeparatorWithToken: theToken separator: GHDocStringSeparator open: YES] ||
|
219
|
-
[self matchDocStringSeparatorWithToken: theToken separator: GHDocStringAlternativeSeparator open: YES])
|
220
|
-
// close
|
221
|
-
: [self matchDocStringSeparatorWithToken: theToken separator: activeDocStringSeparator open: NO];
|
222
|
-
}
|
223
|
-
|
224
|
-
- (BOOL)matchDocStringSeparatorWithToken:(GHToken *)theToken separator:(NSString *)theSeparator open:(BOOL)isOpen
|
225
|
-
{
|
226
|
-
if ([[theToken line] hasPrefix: theSeparator])
|
227
|
-
{
|
228
|
-
NSString * contentType = nil;
|
229
|
-
if (isOpen)
|
230
|
-
{
|
231
|
-
contentType = [[theToken line] trimmedRest: [theSeparator length]];
|
232
|
-
activeDocStringSeparator = theSeparator;
|
233
|
-
indentToRemove = [[theToken line] indent];
|
234
|
-
}
|
235
|
-
else
|
236
|
-
{
|
237
|
-
activeDocStringSeparator = nil;
|
238
|
-
indentToRemove = 0;
|
239
|
-
}
|
240
|
-
|
241
|
-
[self setTokenMatched: theToken tokenType: GHTokenTypeDocStringSeparator text: contentType keyword: nil indent: nil items: nil];
|
242
|
-
|
243
|
-
return YES;
|
244
|
-
}
|
245
|
-
return NO;
|
246
|
-
}
|
247
|
-
|
248
|
-
|
249
|
-
- (BOOL)matchStepLineWithToken:(GHToken *)theToken
|
250
|
-
{
|
251
|
-
NSArray<NSString *> * keywords = [currentDialect stepKeywords];
|
252
|
-
for (NSString * keyword in keywords)
|
253
|
-
{
|
254
|
-
if ([[theToken line] hasPrefix: keyword])
|
255
|
-
{
|
256
|
-
NSString * stepText = [[theToken line] trimmedRest: [keyword length]];
|
257
|
-
[self setTokenMatched: theToken tokenType: GHTokenTypeStepLine text: stepText keyword: keyword indent: nil items: nil];
|
258
|
-
|
259
|
-
return YES;
|
260
|
-
}
|
261
|
-
}
|
262
|
-
|
263
|
-
return NO;
|
264
|
-
}
|
265
|
-
|
266
|
-
- (BOOL)matchTableRowWithToken:(GHToken *)theToken
|
267
|
-
{
|
268
|
-
if ([[theToken line] hasPrefix: GHTableCellSeparator])
|
269
|
-
{
|
270
|
-
[self setTokenMatched: theToken tokenType: GHTokenTypeTableRow text: nil keyword: nil indent: nil items: [[theToken line] tableCells]];
|
271
|
-
|
272
|
-
return YES;
|
273
|
-
}
|
274
|
-
|
275
|
-
return NO;
|
276
|
-
}
|
277
|
-
|
278
|
-
- (NSString *)unescapeDocString:(NSString *)theText
|
279
|
-
{
|
280
|
-
return activeDocStringSeparator != nil ? [theText stringByReplacingOccurrencesOfString: @"\\\"\\\"\\\"" withString: @"\"\"\""] : theText;
|
281
|
-
}
|
282
|
-
|
283
|
-
@end
|