Class: Swarker::Cli

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/swarker/cli.rb

Instance Method Summary collapse

Instance Method Details

#convertObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/swarker/cli.rb', line 13

def convert
  say_status :input, input
  say_status :output, output

  services.each do |service|
    schema = Swarker::Serializers::ServiceSerializer.new(service).schema

    create_file(File.join(output, "#{service.json_filename}.json"), JSON.pretty_generate(schema), force: force?)
  end
end