Fix generate-api names_out usage (#787)

This commit is contained in:
Mike Moore 2019-05-10 13:57:46 -06:00 committed by Graham Paye
parent 812b374103
commit ea6fcbe5be
1 changed files with 4 additions and 2 deletions

View File

@ -37,7 +37,9 @@ module Google
generate_from_url(options[:url]) if options[:url] generate_from_url(options[:url]) if options[:url]
generate_from_file(options[:file]) if options[:file] generate_from_file(options[:file]) if options[:file]
generate_from_discovery(preferred_only: options[:preferred_only]) if options[:from_discovery] generate_from_discovery(preferred_only: options[:preferred_only]) if options[:from_discovery]
create_file(options[:names_out]) { |*| generator.dump_api_names } if options[:names_out] if options[:names_out]
create_file(options[:names_out]) { |*| generator.dump_api_names } unless File.exist? options[:names_out]
end
end end
desc 'list', 'List public APIs' desc 'list', 'List public APIs'
@ -104,7 +106,7 @@ module Google
end end
def generator def generator
@generator ||= Google::Apis::Generator.new(api_names: options[:names]) @generator ||= Google::Apis::Generator.new(api_names: options[:names], api_names_out: options[:names_out])
end end
def ensure_active_support def ensure_active_support