Skip to content

Commit

Permalink
Renamed input to swaggerInput
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Winkler committed Apr 5, 2016
1 parent d7ee31a commit d4ebc8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Expand Up @@ -30,7 +30,7 @@ class Swagger2MarkupTask extends DefaultTask {

@Optional
@Input
def String input
def String swaggerInput

@Optional
@OutputDirectory
Expand All @@ -51,7 +51,7 @@ class Swagger2MarkupTask extends DefaultTask {
void convertSwagger2markup() {
if (logger.isDebugEnabled()) {
logger.debug("convertSwagger2markup task started")
logger.debug("Input: {}", input)
logger.debug("Input: {}", swaggerInput)
logger.debug("OutputDir: {}", outputDir)
logger.debug("OutputFile: {}", outputFile)
config.each { k, v ->
Expand All @@ -60,7 +60,7 @@ class Swagger2MarkupTask extends DefaultTask {
}
try{
Swagger2MarkupConfig swagger2MarkupConfig = new Swagger2MarkupConfigBuilder(config).build();
Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(URIUtils.create(input))
Swagger2MarkupConverter converter = Swagger2MarkupConverter.from(URIUtils.create(swaggerInput))
.withConfig(swagger2MarkupConfig).build();

if(outputFile != null){
Expand Down
Expand Up @@ -44,14 +44,14 @@ class Swagger2MarkupTaskSpec extends Specification{
given:
FileUtils.deleteQuietly(new File('build/asciidoc').absoluteFile);
Swagger2MarkupTask swagger2MarkupTask = (Swagger2MarkupTask) project.tasks.create(name: Swagger2MarkupPlugin.TASK_NAME, type: Swagger2MarkupTask) {
input new File(INPUT_DIR).absoluteFile.toString()
swaggerInput new File(INPUT_DIR).absoluteFile.toString()
outputDir new File('build/asciidoc').absoluteFile
}
when:
swagger2MarkupTask.convertSwagger2markup()
then:
swagger2MarkupTask != null
swagger2MarkupTask.input == new File(INPUT_DIR).absoluteFile
swagger2MarkupTask.swaggerInput == new File(INPUT_DIR).absoluteFile
def list = []
def dir = swagger2MarkupTask.outputDir
dir.eachFileRecurse(FileType.FILES) { file ->
Expand All @@ -65,7 +65,7 @@ class Swagger2MarkupTaskSpec extends Specification{
given:
FileUtils.deleteQuietly(new File(markdownOuputDir).absoluteFile);
Swagger2MarkupTask swagger2MarkupTask = (Swagger2MarkupTask) project.tasks.create(name: Swagger2MarkupPlugin.TASK_NAME, type: Swagger2MarkupTask) {
input new File(INPUT_DIR, "swagger_petstore.yaml").absolutePath
swaggerInput new File(INPUT_DIR, "swagger_petstore.yaml").absolutePath
outputDir new File(markdownOuputDir).absoluteFile
config = [(Swagger2MarkupProperties.MARKUP_LANGUAGE) : MarkupLanguage.MARKDOWN.toString()]
}
Expand All @@ -85,7 +85,7 @@ class Swagger2MarkupTaskSpec extends Specification{
given:
FileUtils.deleteQuietly(new File(markdownOuputDir).absoluteFile);
Swagger2MarkupTask swagger2MarkupTask = (Swagger2MarkupTask) project.tasks.create(name: Swagger2MarkupPlugin.TASK_NAME, type: Swagger2MarkupTask) {
input new File(INPUT_DIR, "swagger_petstore.yaml").absolutePath
swaggerInput new File(INPUT_DIR, "swagger_petstore.yaml").absolutePath
outputDir new File(markdownOuputDir).absoluteFile
config = [(Swagger2MarkupProperties.MARKUP_LANGUAGE) : MarkupLanguage.MARKDOWN.toString()]
}
Expand All @@ -105,7 +105,7 @@ class Swagger2MarkupTaskSpec extends Specification{
given:
FileUtils.deleteQuietly(new File(markdownOuputDir).absoluteFile);
Swagger2MarkupTask swagger2MarkupTask = (Swagger2MarkupTask) project.tasks.create(name: Swagger2MarkupPlugin.TASK_NAME, type: Swagger2MarkupTask) {
input new File(INPUT_DIR, "swagger_petstore.yaml").absolutePath
swaggerInput new File(INPUT_DIR, "swagger_petstore.yaml").absolutePath
outputFile new File(markdownOuputDir, "swagger").absoluteFile
config = [(Swagger2MarkupProperties.MARKUP_LANGUAGE) : MarkupLanguage.MARKDOWN.toString()]
}
Expand All @@ -125,7 +125,7 @@ class Swagger2MarkupTaskSpec extends Specification{
given:
FileUtils.deleteQuietly(new File(markdownOuputDir).absoluteFile);
Swagger2MarkupTask swagger2MarkupTask = (Swagger2MarkupTask) project.tasks.create(name: Swagger2MarkupPlugin.TASK_NAME, type: Swagger2MarkupTask) {
input "http://petstore.swagger.io/v2/swagger.json"
swaggerInput "http://petstore.swagger.io/v2/swagger.json"
outputFile new File(markdownOuputDir, "swagger").absoluteFile
config = [(Swagger2MarkupProperties.MARKUP_LANGUAGE) : MarkupLanguage.MARKDOWN.toString()]
}
Expand All @@ -146,7 +146,7 @@ class Swagger2MarkupTaskSpec extends Specification{
given:
FileUtils.deleteQuietly(new File(markdownOuputDir).absoluteFile);
Swagger2MarkupTask swagger2MarkupTask = (Swagger2MarkupTask) project.tasks.create(name: Swagger2MarkupPlugin.TASK_NAME, type: Swagger2MarkupTask) {
input new File(INPUT_DIR, "swagger_petstore.yaml").absolutePath
swaggerInput new File(INPUT_DIR, "swagger_petstore.yaml").absolutePath
outputDir new File(markdownOuputDir).absoluteFile
config = [(Swagger2MarkupProperties.MARKUP_LANGUAGE) : MarkupLanguage.MARKDOWN.toString(),
(Swagger2MarkupProperties.OUTPUT_LANGUAGE) : Language.RU.toString()]
Expand All @@ -162,7 +162,7 @@ class Swagger2MarkupTaskSpec extends Specification{
given:
FileUtils.deleteQuietly(new File(markdownOuputDir).absoluteFile);
Swagger2MarkupTask swagger2MarkupTask = (Swagger2MarkupTask) project.tasks.create(name: Swagger2MarkupPlugin.TASK_NAME, type: Swagger2MarkupTask) {
input new File(INPUT_DIR, "swagger_petstore.yaml").absolutePath
swaggerInput new File(INPUT_DIR, "swagger_petstore.yaml").absolutePath
outputDir new File(markdownOuputDir).absoluteFile
config = [(Swagger2MarkupProperties.MARKUP_LANGUAGE) : MarkupLanguage.MARKDOWN.toString(),
(Swagger2MarkupProperties.PATHS_GROUPED_BY) : GroupBy.TAGS.toString()]
Expand Down

0 comments on commit d4ebc8d

Please sign in to comment.