-
Notifications
You must be signed in to change notification settings - Fork 130
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 #21 from kailuowang/master
Fix issue #20
- Loading branch information
Showing
13 changed files
with
183 additions
and
64 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,19 @@ | ||
import sbt._ | ||
import com.typesafe.sbt.SbtScalariform | ||
import com.typesafe.sbt.SbtScalariform.ScalariformKeys | ||
|
||
object Format { | ||
lazy val settings = SbtScalariform.scalariformSettings ++ Seq( | ||
ScalariformKeys.preferences in Compile := formattingPreferences, | ||
ScalariformKeys.preferences in Test := formattingPreferences | ||
) | ||
|
||
def formattingPreferences = { | ||
import scalariform.formatter.preferences._ | ||
FormattingPreferences() | ||
.setPreference(RewriteArrowSymbols, true) | ||
.setPreference(AlignParameters, true) | ||
.setPreference(AlignSingleLineCaseStatements, true) | ||
} | ||
|
||
} |
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,23 @@ | ||
import sbt._, Keys._ | ||
import bintray.BintrayKeys._ | ||
|
||
|
||
object Publish { | ||
|
||
val bintraySettings = Seq( | ||
bintrayOrganization := Some("iheartradio"), | ||
bintrayPackageLabels := Seq("play-framework", "swagger", "rest-api", "API", "documentation") | ||
) | ||
|
||
val publishingSettings = Seq( | ||
publishMavenStyle := true, | ||
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")), | ||
homepage := Some(url("http://iheartradio.github.io/play-swagger")), | ||
scmInfo := Some(ScmInfo(url("https://github.com/iheartradio/play-swagger"), | ||
"git@github.com:iheartradio/play-swagger.git")), | ||
pomIncludeRepository := { _ => false }, | ||
publishArtifact in Test := false | ||
) | ||
|
||
val settings = bintraySettings ++ publishingSettings | ||
} |
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") | ||
|
||
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.1") | ||
|
||
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.0.4") | ||
|
||
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.4.0") | ||
|
||
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.0.0") | ||
|
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
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,15 @@ | ||
### | ||
# summary: get player | ||
### | ||
GET /player/:pid/context/:bid controllers.Player.getPlayer(pid, bid) | ||
|
||
GET /player/:pid/tracks/search controllers.Player.searchTrack(pid, keyword) | ||
|
||
### | ||
# parameters: | ||
# - name: body | ||
# description: track information | ||
# schema: | ||
# $ref: '#/definitions/com.iheart.playSwagger.Track' | ||
### | ||
POST /player/:pid/playedTracks controllers.Player.addPlayedTracks(pid) |
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 @@ | ||
GET /api/resource/ controllers.Resource.get() | ||
PUT /api/resource/ controllers.Resource.put() | ||
POST /api/resource/ controllers.Resource.post() | ||
DELETE /api/resource/ controllers.Resource.delete() |
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,2 @@ | ||
-> /api api.Routes | ||
-> /doc doc.Routes |
17 changes: 17 additions & 0 deletions
17
src/test/scala/com/iheart/playSwagger/RoutesFileReaderSpec.scala
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,17 @@ | ||
package com.iheart.playSwagger | ||
|
||
import org.specs2.mutable.Specification | ||
|
||
class RoutesFileReaderSpec extends Specification { | ||
|
||
"Reads" should { | ||
"read all files" in { | ||
implicit val cl = getClass.getClassLoader | ||
val results = RoutesFileReader().readAll() | ||
results.keys must contain(allOf("api", "doc")) | ||
results("api").size must be_>(2) | ||
results("doc") must contain("POST /api/resource/ controllers.Resource.post()") | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.