class AppMap::Swagger::RakeDiffTask
Constants
- Command
- DEFAULT_BASE
- DEFAULT_GIT
- DEFAULT_SWAGGER_FILE
Attributes
base[RW]
git_command[RW]
name[RW]
swagger_file[RW]
Public Class Methods
new(*args, &task_block)
click to toggle source
# File lib/appmap/swagger/rake_diff_task.rb, line 97 def initialize(*args, &task_block) @name = args.shift || :'swagger:diff' @git_command = DEFAULT_GIT @base = DEFAULT_BASE @swagger_file = DEFAULT_SWAGGER_FILE define(args, &task_block) end
Private Instance Methods
define(args, &task_block)
click to toggle source
This bit of black magic - github.com/rspec/rspec-core/blob/main/lib/rspec/core/rake_task.rb#L110
# File lib/appmap/swagger/rake_diff_task.rb, line 109 def define(args, &task_block) desc "Generate Swagger from AppMaps" unless ::Rake.application.last_description task(name, *args) do |_, task_args| RakeFileUtils.__send__(:verbose, Rake.verbose == true) do task_block.call(*[self, task_args].slice(0, task_block.arity)) if task_block Command.new(:git_command).tap do |cmd| cmd.base = task_args[:base] || self.base cmd.swagger_file = task_args[:swagger_file] || self.swagger_file end.perform end end end