class Swarker::Cli

Public Instance Methods

convert() click to toggle source
# 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

Private Instance Methods

force?() click to toggle source
# File lib/swarker/cli.rb, line 38
def force?
  options[:force]
end
input() click to toggle source
# File lib/swarker/cli.rb, line 30
def input
  File.expand_path(options[:input])
end
output() click to toggle source
# File lib/swarker/cli.rb, line 34
def output
  File.expand_path(options[:output])
end
services() click to toggle source
# File lib/swarker/cli.rb, line 26
def services
  Swarker::Readers::ServiceReader.new(input, subtree).services
end
subtree() click to toggle source
# File lib/swarker/cli.rb, line 42
def subtree
  options[:subtree]
end