This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PR is a work in progress and shouldn't be merged yet | |
warn "PR is classed as Work in Progress" if github.pr_title.include? "[WIP]" | |
# Warn when there is a big PR | |
warn "Big PR, consider splitting into smaller" if git.lines_of_code > 500 | |
# Ensure a clean commits history | |
if git.commits.any? { |c| c.message =~ /^Merge branch '#{github.branch_for_base}'/ } | |
fail "Please rebase to get rid of the merge commits in this PR" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Path to swiftlint | |
SWIFT_LINT=/usr/local/bin/swiftlint | |
#if $SWIFT_LINT >/dev/null 2>&1; then | |
if [[ -e "${SWIFT_LINT}" ]]; then | |
count=0 | |
for file_path in $(git ls-files -m --exclude-from=.gitignore | grep ".swift$"); do | |
export SCRIPT_INPUT_FILE_$count=$file_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: [ | |
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1, minor: 5), | |
.Package(url: "https://github.com/vapor/mongo-provider.git", majorVersion: 1, minor: 1) | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies: [ | |
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2), | |
.Package(url: "https://github.com/vapor/mongo-provider.git", majorVersion: 2) | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class User: Model { | |
init(node: Node, in context: Context) throws { | |
id = try node.extract("_id") // Trick for MongoDB database | |
name = try node.extract("name") | |
score = try node.extract("score") | |
} | |
func makeNode(context: Context) throws -> Node { | |
return try Node(node: [ | |
"_id": id, // Trick for MongoDB database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class User: Model { | |
let storage = Storage() | |
var name: String | |
var score: Int | |
init(row: Row) throws { | |
name = try row.get("name") | |
score = try row.get("score") | |
} | |
func makeRow() throws -> Row { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension User: JSONRepresentable { | |
func makeJSON() throws -> JSON { | |
var json = JSON() | |
try json.set("id", id?.string) | |
try json.set("name", name) | |
try json.set("score", score) | |
return json | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OurCoolCollection: RouteCollection { | |
typealias Wrapped = HTTP.Responder | |
func build<Builder: RouteBuilder>(_ builder: Builder) where Builder.Value == Responder { ... } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OurCoolCollection: RouteCollection { | |
func build(_ builder: RouteBuilder) throws { ... } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default_platform(:android) | |
platform :android do | |
desc "Submit a new QA Build to Crashlytics Beta" | |
lane :qa do | |
crashlytics( | |
api_token: 'CRASHLYTICS_API_TOKEN', | |
build_secret: 'CRASHLYTICS_BUILD_SECRET', | |
notes_path: 'qa-change.log', |