Skip to content

Commit e3467f9

Browse files
committed
Merge pull request #42 from qutheory/travis
travis
2 parents 73a155c + 9def489 commit e3467f9

File tree

5 files changed

+54
-34
lines changed

5 files changed

+54
-34
lines changed

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
os:
2+
- linux
3+
- osx
4+
language: generic
5+
sudo: required
6+
dist: trusty
7+
osx_image: xcode7.3
8+
install:
9+
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/02090c7ede5a637b76e6df1710e83cd0bbe7dcdf/swiftenv-install.sh)"
10+
script:
11+
# Build Fluent
12+
- swift build
13+
- swift build --configuration release
14+
# Test Fluent
15+
- swift test

Sources/Comparison.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,26 @@ extension Filter.Comparison: CustomStringConvertible {
3131
}
3232
}
3333
}
34+
35+
/// Temporarily not in SQL.swift file
36+
extension Filter.Comparison {
37+
/**
38+
Translates a `Comparison` to SQL.
39+
*/
40+
var sql: String {
41+
switch self {
42+
case .equals:
43+
return "="
44+
case .greaterThan:
45+
return ">"
46+
case .lessThan:
47+
return "<"
48+
case .greaterThanOrEquals:
49+
return ">="
50+
case .lessThanOrEquals:
51+
return "<="
52+
case .notEquals:
53+
return "!="
54+
}
55+
}
56+
}

Sources/SQL.swift

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,6 @@ extension Action {
164164
}
165165
}
166166

167-
extension Filter.Scope {
168-
/**
169-
Translates a scope to SQL.
170-
*/
171-
var sql: String {
172-
switch self {
173-
case .in:
174-
return "IN"
175-
case .notIn:
176-
return "NOT IN"
177-
}
178-
}
179-
}
180167

181168
/**
182169
Allows optionals to be targeted
@@ -231,24 +218,3 @@ extension Limit {
231218
}
232219
}
233220

234-
extension Filter.Comparison {
235-
/**
236-
Translates a `Comparison` to SQL.
237-
*/
238-
var sql: String {
239-
switch self {
240-
case .equals:
241-
return "="
242-
case .greaterThan:
243-
return ">"
244-
case .lessThan:
245-
return "<"
246-
case .greaterThanOrEquals:
247-
return ">="
248-
case .lessThanOrEquals:
249-
return "<="
250-
case .notEquals:
251-
return "!="
252-
}
253-
}
254-
}

Sources/Scope.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,18 @@ extension Filter.Scope: CustomStringConvertible {
1313
return self == .in ? "in" : "not in"
1414
}
1515
}
16+
17+
/// Temporarily not in SQL.swift file
18+
extension Filter.Scope {
19+
/**
20+
Translates a scope to SQL.
21+
*/
22+
var sql: String {
23+
switch self {
24+
case .in:
25+
return "IN"
26+
case .notIn:
27+
return "NOT IN"
28+
}
29+
}
30+
}

Tests/LinuxMain.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import XCTest
55

66
XCTMain([
77
testCase(ModelFindTests.allTests),
8+
testCase(QueryFiltersTests.allTests),
89
])
910

1011
#endif

0 commit comments

Comments
 (0)