Skip to content

Commit 149a7fa

Browse files
committed
Revert "Merge branch 'develop'"
This reverts commit f3068f8, reversing changes made to 882c66a.
1 parent f3068f8 commit 149a7fa

File tree

11 files changed

+60
-145
lines changed

11 files changed

+60
-145
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ playground.xcworkspace
3535
# Swift Package Manager
3636
#
3737
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
38-
Packages/
38+
# Packages/
3939
.build/
4040

4141
# CocoaPods

.travis.yml

Lines changed: 31 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,34 @@
1+
language: objective-c
2+
osx_image: xcode7.2
13
env:
2-
global:
3-
- MODULE_NAME=PathToRegex
4-
matrix:
5-
include:
6-
- script:
7-
- xcodebuild test -project $MODULE_NAME.xcodeproj -scheme $MODULE_NAME
8-
os: osx
9-
osx_image: xcode7.2
10-
language: objective-c
11-
before_install:
12-
- brew update
13-
- brew unlink carthage
14-
- brew install carthage
15-
- brew link carthage
16-
before_script:
17-
# bootstrap the dependencies for the project
18-
# you can remove if you don't have dependencies
19-
- carthage bootstrap
20-
before_deploy:
21-
- carthage build --no-skip-current
22-
- carthage archive $MODULE_NAME
23-
deploy:
24-
provider: releases
25-
api_key:
26-
secure: 8Mxwjx8i5YytiW8s95AJ1CTi71WyPLhMd2RGMrR24oizic0zUwHG2rNBgGrnj/ONmd/sUg3XOvNgLXxLl4D5BgI6bsM/Vg+iOd+Gx4xbSmvZSBAt/aqbefSGL8Mpexpfe0vKlT+JXUy8C7WxLpKrlB3kFmaB7r0sq3bc3j/A5FkfI6uGCgEjcOr+emQ+nCr6YI3KcNfHVNquF5nXk1apJMbKJnkQK9D7iQV9wcKzXyIO8uGSMo1qrciWV8wsV6wJgBDXUspUuwa9+Je56doJb6z0kSiIc0cCZwGSkHIQEQY9v9LcB5q0YQ7UkzWM/O01VUnABzjYbKjzwQG1EZxB1PaXu4dH76QGOjg8bD2wh+P5ecYAGxc99GbscTGpEgMtSKqTXQdebsqU9xaQUBxRx5vt0HgLoCv3MTGo+CZ18XXp7Ie9Xkd5T1Nanb/i8MA4QCojNk9vCRpP3YSoGhQpfY7fZgQiRbE+L2+GxTX4jQBSIbLdPaX/ov58qLzbvpSH0nZSgXKJtk7lk4aOApCuzYlTqLs04Z5wgEgWlN3spFKuRqpK/PyAjwMVf1qctacKKZjKOA6HhZijlGtfXkYw3eVut1an/RJCSFagKhXVSvomcG3dnE+FqtLGXtLacP4jtVIkl4tdc1Y5nnTWQJbok/XofgwkNhMq0XXXmF9Lh5c=
27-
file: $MODULE_NAME.framework.zip
28-
skip_cleanup: true
29-
on:
30-
repo: crossroadlabs/PathToRegex
31-
tags: true
32-
- script:
33-
# build (yes for now swift-build should be like this)
34-
- export SBCMD=`which swift-build`
35-
- $SBCMD
36-
# test - temporary disabled because of bug in swift test
37-
# - swift test
38-
sudo: required
39-
dist: trusty
40-
language: generic
41-
before_install:
42-
# install original swift distribution
43-
- wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
44-
- cd ..
45-
- export SWIFT_VERSION=swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a
46-
- wget https://swift.org/builds/development/ubuntu1404/$SWIFT_VERSION/$SWIFT_VERSION-ubuntu14.04.tar.gz
47-
- tar xzf $SWIFT_VERSION-ubuntu14.04.tar.gz
48-
- export PATH="${PWD}/${SWIFT_VERSION}-ubuntu14.04/usr/bin:${PATH}"
49-
# install latest package manager with `swift-test`
50-
- git clone https://github.com/apple/swift-package-manager
51-
- cd swift-package-manager
52-
- Utilities/bootstrap
53-
- export SWIFT_BUILD_PATH=`pwd`
54-
- export PATH=$SWIFT_BUILD_PATH/.build/debug:$PATH
55-
- cd ..
56-
# get back home
57-
- cd $MODULE_NAME
4+
global:
5+
- FRAMEWORK_NAME=PathToRegex
6+
before_install:
7+
- brew update
8+
- brew unlink carthage
9+
- brew install carthage
10+
- brew link carthage
11+
before_script:
12+
# bootstrap the dependencies for the project
13+
# you can remove if you don't have dependencies
14+
- carthage bootstrap
15+
before_deploy:
16+
- carthage build --no-skip-current
17+
- carthage archive $FRAMEWORK_NAME
18+
# - pod trunk push PathToRegex.podspec
19+
script:
20+
- xcodebuild test -project PathToRegex.xcodeproj -scheme PathToRegex
21+
#- xcodebuild test -project Regex.xcodeproj -scheme Regex-iOS -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6'
22+
#- xcodebuild test -project Regex.xcodeproj -scheme Regex-tvOS -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV 1080p'
23+
#- xcodebuild build -project Regex.xcodeproj -scheme Regex-watchOS -sdk watchsimulator -destination 'platform=watchOS Simulator,name=Apple Watch - 42mm'
5824
notifications:
5925
email: false
26+
deploy:
27+
provider: releases
28+
api_key:
29+
secure: 8Mxwjx8i5YytiW8s95AJ1CTi71WyPLhMd2RGMrR24oizic0zUwHG2rNBgGrnj/ONmd/sUg3XOvNgLXxLl4D5BgI6bsM/Vg+iOd+Gx4xbSmvZSBAt/aqbefSGL8Mpexpfe0vKlT+JXUy8C7WxLpKrlB3kFmaB7r0sq3bc3j/A5FkfI6uGCgEjcOr+emQ+nCr6YI3KcNfHVNquF5nXk1apJMbKJnkQK9D7iQV9wcKzXyIO8uGSMo1qrciWV8wsV6wJgBDXUspUuwa9+Je56doJb6z0kSiIc0cCZwGSkHIQEQY9v9LcB5q0YQ7UkzWM/O01VUnABzjYbKjzwQG1EZxB1PaXu4dH76QGOjg8bD2wh+P5ecYAGxc99GbscTGpEgMtSKqTXQdebsqU9xaQUBxRx5vt0HgLoCv3MTGo+CZ18XXp7Ie9Xkd5T1Nanb/i8MA4QCojNk9vCRpP3YSoGhQpfY7fZgQiRbE+L2+GxTX4jQBSIbLdPaX/ov58qLzbvpSH0nZSgXKJtk7lk4aOApCuzYlTqLs04Z5wgEgWlN3spFKuRqpK/PyAjwMVf1qctacKKZjKOA6HhZijlGtfXkYw3eVut1an/RJCSFagKhXVSvomcG3dnE+FqtLGXtLacP4jtVIkl4tdc1Y5nnTWQJbok/XofgwkNhMq0XXXmF9Lh5c=
30+
file: $FRAMEWORK_NAME.framework.zip
31+
skip_cleanup: true
32+
on:
33+
repo: crossroadlabs/PathToRegex
34+
tags: true

Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "crossroadlabs/Regex" ~> 0.5
1+
github "crossroadlabs/Regex" ~> 0.4

Package.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

PathToRegex.xcodeproj/project.pbxproj

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
children = (
7777
65E7DAC91C690A4300C5D00A /* PathToRegex */,
7878
65E7DAD51C690A4300C5D00A /* PathToRegexTests */,
79-
962A8B391C74E5B8008E2BB3 /* Frameworks */,
8079
65E7DAC81C690A4300C5D00A /* Products */,
80+
65E7DAE31C690C5000C5D00A /* Regex.framework */,
8181
);
8282
sourceTree = "<group>";
8383
};
@@ -105,16 +105,7 @@
105105
65E7DAD61C690A4300C5D00A /* PathToRegexTests.swift */,
106106
65E7DAD81C690A4300C5D00A /* Info.plist */,
107107
);
108-
name = PathToRegexTests;
109-
path = Tests/PathToRegex;
110-
sourceTree = "<group>";
111-
};
112-
962A8B391C74E5B8008E2BB3 /* Frameworks */ = {
113-
isa = PBXGroup;
114-
children = (
115-
65E7DAE31C690C5000C5D00A /* Regex.framework */,
116-
);
117-
name = Frameworks;
108+
path = PathToRegexTests;
118109
sourceTree = "<group>";
119110
};
120111
/* End PBXGroup section */
@@ -389,7 +380,7 @@
389380
"$(inherited)",
390381
"$(PROJECT_DIR)/Carthage/Build/Mac",
391382
);
392-
INFOPLIST_FILE = Tests/PathToRegex/Info.plist;
383+
INFOPLIST_FILE = PathToRegexTests/Info.plist;
393384
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
394385
PRODUCT_BUNDLE_IDENTIFIER = xyz.crossroadlabs.PathToRegexTests;
395386
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -404,7 +395,7 @@
404395
"$(inherited)",
405396
"$(PROJECT_DIR)/Carthage/Build/Mac",
406397
);
407-
INFOPLIST_FILE = Tests/PathToRegex/Info.plist;
398+
INFOPLIST_FILE = PathToRegexTests/Info.plist;
408399
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
409400
PRODUCT_BUNDLE_IDENTIFIER = xyz.crossroadlabs.PathToRegexTests;
410401
PRODUCT_NAME = "$(TARGET_NAME)";

PathToRegex/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.2</string>
18+
<string>0.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

PathToRegex/PathToRegex.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ func tokensToRegex (tokens:[Token], options:Options = Options()) throws -> Regex
182182
var groups = [String]()
183183

184184
// Iterate over the tokens and create our regexp string.
185-
for token in tokens {
185+
for (var i = 0; i < tokens.count; i++) {
186+
let token = tokens[i]
187+
186188
switch token {
187189
case .Simple(token: let token): route += escapeString(token)
188190
case .Complex(name: let tokenName, prefix: let prefix, delimeter: _, optional: let optional, repeating: let repeating, pattern: let pattern):
File renamed without changes.

Tests/PathToRegex/PathToRegexTests.swift renamed to PathToRegexTests/PathToRegexTests.swift

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,17 @@ import Regex
2424
@testable import PathToRegex
2525

2626
class PathToRegexTests: XCTestCase {
27-
27+
28+
override func setUp() {
29+
super.setUp()
30+
// Put setup code here. This method is called before the invocation of each test method in the class.
31+
}
32+
33+
override func tearDown() {
34+
// Put teardown code here. This method is called after the invocation of each test method in the class.
35+
super.tearDown()
36+
}
37+
2838
func testPaths() {
2939
let digitOptionalVar = try! pathToRegex("/:test(\\d+)?")
3040
XCTAssert("/123" =~ digitOptionalVar)
@@ -57,15 +67,13 @@ class PathToRegexTests: XCTestCase {
5767
let methodFormat = try! pathToRegex("/api/user/:id.:format")
5868
XCTAssertEqual("123", methodFormat.findFirst("/api/user/123.json")!.group("id")!)
5969
XCTAssertEqual("json", methodFormat.findFirst("/api/user/123.json")!.group("format")!)
60-
}
61-
}
62-
63-
#if os(Linux)
64-
extension PathToRegexTests : XCTestCaseProvider {
65-
var allTests : [(String, () throws -> Void)] {
66-
return [
67-
("testPaths", testPaths)
68-
]
6970
}
71+
72+
func testPerformanceExample() {
73+
// This is an example of a performance test case.
74+
self.measureBlock {
75+
// Put the code you want to measure the time of here.
76+
}
77+
}
78+
7079
}
71-
#endif

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# PathToRegex
22

3-
![🐧 linux: ready](https://img.shields.io/badge/%F0%9F%90%A7%20linux-ready-red.svg)
43
[![GitHub license](https://img.shields.io/badge/license-LGPL v3-lightgrey.svg)](https://raw.githubusercontent.com/crossroadlabs/Express/master/LICENSE)
54
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
65
![Platform OS X | Linux](https://img.shields.io/badge/platform-OS%20X%20%7C%20Linux-orange.svg)

0 commit comments

Comments
 (0)