lib/r2-oas/tasks/tool.rake in r2-oas-0.3.4 vs lib/r2-oas/tasks/tool.rake in r2-oas-0.4.0

- old
+ new

@@ -6,31 +6,34 @@ require 'r2-oas/task_logging' load File.expand_path('common.rake', __dir__) namespace :routes do namespace :oas do - desc 'Deploy OAS Document' + desc '[R2-OAS] Deploy OAS Document' task deploy: [:common] do start do client_options = {} client = R2OAS::Deploy::Client.new(client_options) download_dist_th = Thread.new do puts 'Download swagger-api/swagger-ui/dist ... (async)' client.download_swagger_ui_dist end - builder_options = { unit_paths_file_path: unit_paths_file_path } + output_dir_path = File.expand_path(R2OAS.output_dir_path) + FileUtils.mkdir_p(output_dir_path) unless FileTest.exists?(output_dir_path) + + builder_options = { unit_paths_file_path: unit_paths_file_path, use_plugin: true, output: true } builder = R2OAS::Schema::Builder.new(builder_options) builder.build_docs download_dist_th.join client.deploy end end - desc 'Display paths list' + desc '[R2-OAS] Display paths list' task paths_ls: [:common] do fd = IO.sysopen('/dev/null', 'w+') $stdout = IO.new(fd) logger.level = :null @@ -45,10 +48,10 @@ result = $stdout.string $stdout = STDOUT puts result end - desc 'Display paths stats' + desc '[R2-OAS] Display paths stats' task paths_stats: [:common] do fd = IO.sysopen('/dev/null', 'w+') $stdout = IO.new(fd) logger.level = :null