This repository has been archived by the owner on Oct 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from rb-de0/unittests
Unit Tests
- Loading branch information
Showing
76 changed files
with
4,061 additions
and
104 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
os: | ||
- linux | ||
- osx | ||
language: generic | ||
sudo: required | ||
dist: trusty | ||
|
||
services: | ||
- mysql | ||
|
||
env: | ||
global: | ||
- MYSQL_PASSWORD='' | ||
- MYSQL_PORT=3306 | ||
|
||
osx_image: xcode9.2 | ||
before_install: | ||
- if [ $TRAVIS_OS_NAME == "osx" ]; then | ||
brew update; | ||
brew tap vapor/tap; | ||
brew update; | ||
bundle install --path vendor/bundle; | ||
brew install vapor; | ||
brew install cmysql; | ||
mysql.server start; | ||
else | ||
eval "$(curl -sL https://apt.vapor.sh)"; | ||
sudo apt-get install vapor; | ||
sudo apt-get install cmysql; | ||
sudo chmod -R a+rx /usr/; | ||
fi | ||
- mysql -u root -e "set global max_connections = 1000"; | ||
|
||
script: | ||
- if [ $TRAVIS_OS_NAME == "osx" ]; then | ||
swift build; | ||
swift test; | ||
else | ||
swift build -Xswiftc -DNOJSON; | ||
swift test -Xswiftc -DNOJSON; | ||
fi | ||
|
||
after_success: | ||
- if [ $TRAVIS_OS_NAME == "osx" ]; then | ||
swift package generate-xcodeproj; | ||
bundle exec fastlane send_coverage; | ||
fi |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "fastlane", '2.81.0' | ||
gem "slather" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
CFPropertyList (2.3.6) | ||
activesupport (5.1.5) | ||
concurrent-ruby (~> 1.0, >= 1.0.2) | ||
i18n (~> 0.7) | ||
minitest (~> 5.1) | ||
tzinfo (~> 1.1) | ||
addressable (2.5.2) | ||
public_suffix (>= 2.0.2, < 4.0) | ||
atomos (0.1.2) | ||
babosa (1.0.2) | ||
claide (1.0.2) | ||
clamp (0.6.5) | ||
colored (1.2) | ||
colored2 (3.1.2) | ||
commander-fastlane (4.4.6) | ||
highline (~> 1.7.2) | ||
concurrent-ruby (1.0.5) | ||
declarative (0.0.10) | ||
declarative-option (0.1.0) | ||
domain_name (0.5.20170404) | ||
unf (>= 0.0.5, < 1.0.0) | ||
dotenv (2.2.1) | ||
excon (0.60.0) | ||
faraday (0.14.0) | ||
multipart-post (>= 1.2, < 3) | ||
faraday-cookie_jar (0.0.6) | ||
faraday (>= 0.7.4) | ||
http-cookie (~> 1.0.0) | ||
faraday_middleware (0.12.2) | ||
faraday (>= 0.7.4, < 1.0) | ||
fastimage (2.1.1) | ||
fastlane (2.81.0) | ||
CFPropertyList (>= 2.3, < 4.0.0) | ||
addressable (>= 2.3, < 3.0.0) | ||
babosa (>= 1.0.2, < 2.0.0) | ||
bundler (>= 1.12.0, < 2.0.0) | ||
colored | ||
commander-fastlane (>= 4.4.5, < 5.0.0) | ||
dotenv (>= 2.1.1, < 3.0.0) | ||
excon (>= 0.45.0, < 1.0.0) | ||
faraday (~> 0.9) | ||
faraday-cookie_jar (~> 0.0.6) | ||
faraday_middleware (~> 0.9) | ||
fastimage (>= 2.1.0, < 3.0.0) | ||
gh_inspector (>= 1.1.2, < 2.0.0) | ||
google-api-client (>= 0.13.1, < 0.14.0) | ||
highline (>= 1.7.2, < 2.0.0) | ||
json (< 3.0.0) | ||
mini_magick (~> 4.5.1) | ||
multi_json | ||
multi_xml (~> 0.5) | ||
multipart-post (~> 2.0.0) | ||
plist (>= 3.1.0, < 4.0.0) | ||
public_suffix (~> 2.0.0) | ||
rubyzip (>= 1.1.0, < 2.0.0) | ||
security (= 0.1.3) | ||
slack-notifier (>= 2.0.0, < 3.0.0) | ||
terminal-notifier (>= 1.6.2, < 2.0.0) | ||
terminal-table (>= 1.4.5, < 2.0.0) | ||
tty-screen (>= 0.6.3, < 1.0.0) | ||
tty-spinner (>= 0.8.0, < 1.0.0) | ||
word_wrap (~> 1.0.0) | ||
xcodeproj (>= 1.5.2, < 2.0.0) | ||
xcpretty (>= 0.2.4, < 1.0.0) | ||
xcpretty-travis-formatter (>= 0.0.3) | ||
gh_inspector (1.1.2) | ||
google-api-client (0.13.6) | ||
addressable (~> 2.5, >= 2.5.1) | ||
googleauth (~> 0.5) | ||
httpclient (>= 2.8.1, < 3.0) | ||
mime-types (~> 3.0) | ||
representable (~> 3.0) | ||
retriable (>= 2.0, < 4.0) | ||
googleauth (0.6.2) | ||
faraday (~> 0.12) | ||
jwt (>= 1.4, < 3.0) | ||
logging (~> 2.0) | ||
memoist (~> 0.12) | ||
multi_json (~> 1.11) | ||
os (~> 0.9) | ||
signet (~> 0.7) | ||
highline (1.7.10) | ||
http-cookie (1.0.3) | ||
domain_name (~> 0.5) | ||
httpclient (2.8.3) | ||
i18n (0.9.5) | ||
concurrent-ruby (~> 1.0) | ||
json (2.1.0) | ||
jwt (2.1.0) | ||
little-plugger (1.1.4) | ||
logging (2.2.2) | ||
little-plugger (~> 1.1) | ||
multi_json (~> 1.10) | ||
memoist (0.16.0) | ||
mime-types (3.1) | ||
mime-types-data (~> 3.2015) | ||
mime-types-data (3.2016.0521) | ||
mini_magick (4.5.1) | ||
mini_portile2 (2.3.0) | ||
minitest (5.11.3) | ||
multi_json (1.13.1) | ||
multi_xml (0.6.0) | ||
multipart-post (2.0.0) | ||
nanaimo (0.2.3) | ||
nokogiri (1.8.2) | ||
mini_portile2 (~> 2.3.0) | ||
os (0.9.6) | ||
plist (3.4.0) | ||
public_suffix (2.0.5) | ||
representable (3.0.4) | ||
declarative (< 0.1.0) | ||
declarative-option (< 0.2.0) | ||
uber (< 0.2.0) | ||
retriable (3.1.1) | ||
rouge (2.0.7) | ||
rubyzip (1.2.1) | ||
security (0.1.3) | ||
signet (0.8.1) | ||
addressable (~> 2.3) | ||
faraday (~> 0.9) | ||
jwt (>= 1.5, < 3.0) | ||
multi_json (~> 1.10) | ||
slack-notifier (2.3.2) | ||
slather (2.4.5) | ||
CFPropertyList (~> 2.2) | ||
activesupport (>= 4.0.2) | ||
clamp (~> 0.6) | ||
nokogiri (~> 1.8.2) | ||
xcodeproj (~> 1.4) | ||
terminal-notifier (1.8.0) | ||
terminal-table (1.8.0) | ||
unicode-display_width (~> 1.1, >= 1.1.1) | ||
thread_safe (0.3.6) | ||
tty-cursor (0.5.0) | ||
tty-screen (0.6.4) | ||
tty-spinner (0.8.0) | ||
tty-cursor (>= 0.5.0) | ||
tzinfo (1.2.5) | ||
thread_safe (~> 0.1) | ||
uber (0.1.0) | ||
unf (0.1.4) | ||
unf_ext | ||
unf_ext (0.0.7.5) | ||
unicode-display_width (1.3.0) | ||
word_wrap (1.0.0) | ||
xcodeproj (1.5.6) | ||
CFPropertyList (~> 2.3.3) | ||
atomos (~> 0.1.2) | ||
claide (>= 1.0.2, < 2.0) | ||
colored2 (~> 3.1) | ||
nanaimo (~> 0.2.3) | ||
xcpretty (0.2.8) | ||
rouge (~> 2.0.7) | ||
xcpretty-travis-formatter (1.0.0) | ||
xcpretty (~> 0.2, >= 0.0.7) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
fastlane (= 2.81.0) | ||
slather | ||
|
||
BUNDLED WITH | ||
1.16.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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Swinject | ||
import Vapor | ||
|
||
class ViewAssembly: Assembly { | ||
|
||
private let viewCreator: DefaultViewCreator | ||
|
||
init(drop: Droplet) { | ||
viewCreator = DefaultViewCreator(renderer: drop.view) | ||
viewCreator.set(drop.config.viewDecorators) | ||
} | ||
|
||
func assemble(container: Container) { | ||
|
||
container.register(ViewCreator.self) { [viewCreator] _ in | ||
return viewCreator | ||
}.inObjectScope(.container) | ||
} | ||
} | ||
|
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
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import Vapor | ||
import HTTP | ||
|
||
protocol ViewCreator { | ||
func make(_ path: String, _ context: NodeRepresentable, for request: Request) throws -> View | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Vapor | ||
import HTTP | ||
|
||
protocol ViewDecorator { | ||
func decorate(node: inout Node, with request: Request) throws | ||
} | ||
|
||
extension Config { | ||
|
||
var viewDecorators: [ViewDecorator] { | ||
get { | ||
return (storage["view-decorators"] as? [ViewDecorator]) ?? [] | ||
} | ||
set { | ||
storage["view-decorators"] = newValue | ||
} | ||
} | ||
|
||
func addViewDecorator(_ viewDecorator: ViewDecorator) { | ||
viewDecorators = viewDecorators + [viewDecorator] | ||
} | ||
} |
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
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
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
Oops, something went wrong.