Skip to content

Commit

Permalink
Merge pull request #42 from qutheory/travis
Browse files Browse the repository at this point in the history
travis
  • Loading branch information
tanner0101 committed May 24, 2016
2 parents 73a155c + 9def489 commit e3467f9
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 34 deletions.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
os:
- linux
- osx
language: generic
sudo: required
dist: trusty
osx_image: xcode7.3
install:
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/02090c7ede5a637b76e6df1710e83cd0bbe7dcdf/swiftenv-install.sh)"
script:
# Build Fluent
- swift build
- swift build --configuration release
# Test Fluent
- swift test
23 changes: 23 additions & 0 deletions Sources/Comparison.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,26 @@ extension Filter.Comparison: CustomStringConvertible {
}
}
}

/// Temporarily not in SQL.swift file
extension Filter.Comparison {
/**
Translates a `Comparison` to SQL.
*/
var sql: String {
switch self {
case .equals:
return "="
case .greaterThan:
return ">"
case .lessThan:
return "<"
case .greaterThanOrEquals:
return ">="
case .lessThanOrEquals:
return "<="
case .notEquals:
return "!="
}
}
}
34 changes: 0 additions & 34 deletions Sources/SQL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,6 @@ extension Action {
}
}

extension Filter.Scope {
/**
Translates a scope to SQL.
*/
var sql: String {
switch self {
case .in:
return "IN"
case .notIn:
return "NOT IN"
}
}
}

/**
Allows optionals to be targeted
Expand Down Expand Up @@ -231,24 +218,3 @@ extension Limit {
}
}

extension Filter.Comparison {
/**
Translates a `Comparison` to SQL.
*/
var sql: String {
switch self {
case .equals:
return "="
case .greaterThan:
return ">"
case .lessThan:
return "<"
case .greaterThanOrEquals:
return ">="
case .lessThanOrEquals:
return "<="
case .notEquals:
return "!="
}
}
}
15 changes: 15 additions & 0 deletions Sources/Scope.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,18 @@ extension Filter.Scope: CustomStringConvertible {
return self == .in ? "in" : "not in"
}
}

/// Temporarily not in SQL.swift file
extension Filter.Scope {
/**
Translates a scope to SQL.
*/
var sql: String {
switch self {
case .in:
return "IN"
case .notIn:
return "NOT IN"
}
}
}
1 change: 1 addition & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import XCTest

XCTMain([
testCase(ModelFindTests.allTests),
testCase(QueryFiltersTests.allTests),
])

#endif

0 comments on commit e3467f9

Please sign in to comment.