forked from loafle/openapi-generator-original
skip overwriting ruby spec files
This commit is contained in:
parent
6b3735e58d
commit
90442db86d
@ -264,6 +264,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
String suffix = config.modelTemplateFiles().get(templateName);
|
String suffix = config.modelTemplateFiles().get(templateName);
|
||||||
String filename = config.modelFileFolder() + File.separator + config.toModelFilename(name) + suffix;
|
String filename = config.modelFileFolder() + File.separator + config.toModelFilename(name) + suffix;
|
||||||
if (!config.shouldOverwrite(filename)) {
|
if (!config.shouldOverwrite(filename)) {
|
||||||
|
LOGGER.info("Skipped overwriting " + filename);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String templateFile = getFullTemplateFile(config, templateName);
|
String templateFile = getFullTemplateFile(config, templateName);
|
||||||
@ -286,6 +287,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
String suffix = config.modelTestTemplateFiles().get(templateName);
|
String suffix = config.modelTestTemplateFiles().get(templateName);
|
||||||
String filename = config.modelTestFileFolder() + File.separator + config.toModelTestFilename(name) + suffix;
|
String filename = config.modelTestFileFolder() + File.separator + config.toModelTestFilename(name) + suffix;
|
||||||
if (!config.shouldOverwrite(filename)) {
|
if (!config.shouldOverwrite(filename)) {
|
||||||
|
LOGGER.info("Skipped overwriting " + filename);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String templateFile = getFullTemplateFile(config, templateName);
|
String templateFile = getFullTemplateFile(config, templateName);
|
||||||
@ -308,6 +310,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
String suffix = config.modelDocTemplateFiles().get(templateName);
|
String suffix = config.modelDocTemplateFiles().get(templateName);
|
||||||
String filename = config.modelDocFileFolder() + File.separator + config.toModelDocFilename(name) + suffix;
|
String filename = config.modelDocFileFolder() + File.separator + config.toModelDocFilename(name) + suffix;
|
||||||
if (!config.shouldOverwrite(filename)) {
|
if (!config.shouldOverwrite(filename)) {
|
||||||
|
LOGGER.info("Skipped overwriting " + filename);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String templateFile = getFullTemplateFile(config, templateName);
|
String templateFile = getFullTemplateFile(config, templateName);
|
||||||
@ -393,6 +396,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
for (String templateName : config.apiTemplateFiles().keySet()) {
|
for (String templateName : config.apiTemplateFiles().keySet()) {
|
||||||
String filename = config.apiFilename(templateName, tag);
|
String filename = config.apiFilename(templateName, tag);
|
||||||
if (!config.shouldOverwrite(filename) && new File(filename).exists()) {
|
if (!config.shouldOverwrite(filename) && new File(filename).exists()) {
|
||||||
|
LOGGER.info("Skipped overwriting " + filename);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,6 +420,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
for (String templateName : config.apiTestTemplateFiles().keySet()) {
|
for (String templateName : config.apiTestTemplateFiles().keySet()) {
|
||||||
String filename = config.apiTestFilename(templateName, tag);
|
String filename = config.apiTestFilename(templateName, tag);
|
||||||
if (!config.shouldOverwrite(filename) && new File(filename).exists()) {
|
if (!config.shouldOverwrite(filename) && new File(filename).exists()) {
|
||||||
|
LOGGER.info("Skipped overwriting " + filename);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,6 +444,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
for (String templateName : config.apiDocTemplateFiles().keySet()) {
|
for (String templateName : config.apiDocTemplateFiles().keySet()) {
|
||||||
String filename = config.apiDocFilename(templateName, tag);
|
String filename = config.apiDocFilename(templateName, tag);
|
||||||
if (!config.shouldOverwrite(filename) && new File(filename).exists()) {
|
if (!config.shouldOverwrite(filename) && new File(filename).exists()) {
|
||||||
|
LOGGER.info("Skipped overwriting " + filename);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -521,6 +527,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
|||||||
}
|
}
|
||||||
String outputFilename = outputFolder + File.separator + support.destinationFilename;
|
String outputFilename = outputFolder + File.separator + support.destinationFilename;
|
||||||
if (!config.shouldOverwrite(outputFilename)) {
|
if (!config.shouldOverwrite(outputFilename)) {
|
||||||
|
LOGGER.info("Skipped overwriting " + outputFilename);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -642,4 +642,11 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
|
|||||||
public void setGemAuthorEmail(String gemAuthorEmail) {
|
public void setGemAuthorEmail(String gemAuthorEmail) {
|
||||||
this.gemAuthorEmail = gemAuthorEmail;
|
this.gemAuthorEmail = gemAuthorEmail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldOverwrite(String filename) {
|
||||||
|
// skip spec file as the file might have been updated with new test cases
|
||||||
|
return super.shouldOverwrite(filename) && !filename.endsWith("_spec.rb");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build date: 2016-04-26T10:05:22.048-07:00
|
- Build date: 2016-04-29T11:03:36.514+08:00
|
||||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
@ -57,7 +57,7 @@ require 'petstore'
|
|||||||
|
|
||||||
api_instance = Petstore::FakeApi.new
|
api_instance = Petstore::FakeApi.new
|
||||||
|
|
||||||
number = "number_example" # String | None
|
number = 3.4 # Float | None
|
||||||
|
|
||||||
double = 1.2 # Float | None
|
double = 1.2 # Float | None
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ require 'petstore'
|
|||||||
|
|
||||||
api_instance = Petstore::FakeApi.new
|
api_instance = Petstore::FakeApi.new
|
||||||
|
|
||||||
number = "number_example" # String | None
|
number = 3.4 # Float | None
|
||||||
|
|
||||||
double = 1.2 # Float | None
|
double = 1.2 # Float | None
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ end
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**number** | **String**| None |
|
**number** | **Float**| None |
|
||||||
**double** | **Float**| None |
|
**double** | **Float**| None |
|
||||||
**string** | **String**| None |
|
**string** | **String**| None |
|
||||||
**byte** | **String**| None |
|
**byte** | **String**| None |
|
||||||
|
@ -14,6 +14,7 @@ Name | Type | Description | Notes
|
|||||||
**binary** | **String** | | [optional]
|
**binary** | **String** | | [optional]
|
||||||
**date** | **Date** | |
|
**date** | **Date** | |
|
||||||
**date_time** | **DateTime** | | [optional]
|
**date_time** | **DateTime** | | [optional]
|
||||||
|
**uuid** | [**UUID**](UUID.md) | | [optional]
|
||||||
**password** | **String** | |
|
**password** | **String** | |
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ module Petstore
|
|||||||
|
|
||||||
attr_accessor :date_time
|
attr_accessor :date_time
|
||||||
|
|
||||||
|
attr_accessor :uuid
|
||||||
|
|
||||||
attr_accessor :password
|
attr_accessor :password
|
||||||
|
|
||||||
# Attribute mapping from ruby-style variable name to JSON key.
|
# Attribute mapping from ruby-style variable name to JSON key.
|
||||||
@ -56,6 +58,7 @@ module Petstore
|
|||||||
:'binary' => :'binary',
|
:'binary' => :'binary',
|
||||||
:'date' => :'date',
|
:'date' => :'date',
|
||||||
:'date_time' => :'dateTime',
|
:'date_time' => :'dateTime',
|
||||||
|
:'uuid' => :'uuid',
|
||||||
:'password' => :'password'
|
:'password' => :'password'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -74,6 +77,7 @@ module Petstore
|
|||||||
:'binary' => :'String',
|
:'binary' => :'String',
|
||||||
:'date' => :'Date',
|
:'date' => :'Date',
|
||||||
:'date_time' => :'DateTime',
|
:'date_time' => :'DateTime',
|
||||||
|
:'uuid' => :'UUID',
|
||||||
:'password' => :'String'
|
:'password' => :'String'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -130,6 +134,10 @@ module Petstore
|
|||||||
self.date_time = attributes[:'dateTime']
|
self.date_time = attributes[:'dateTime']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if attributes.has_key?(:'uuid')
|
||||||
|
self.uuid = attributes[:'uuid']
|
||||||
|
end
|
||||||
|
|
||||||
if attributes.has_key?(:'password')
|
if attributes.has_key?(:'password')
|
||||||
self.password = attributes[:'password']
|
self.password = attributes[:'password']
|
||||||
end
|
end
|
||||||
@ -354,6 +362,7 @@ module Petstore
|
|||||||
binary == o.binary &&
|
binary == o.binary &&
|
||||||
date == o.date &&
|
date == o.date &&
|
||||||
date_time == o.date_time &&
|
date_time == o.date_time &&
|
||||||
|
uuid == o.uuid &&
|
||||||
password == o.password
|
password == o.password
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -366,7 +375,7 @@ module Petstore
|
|||||||
# Calculates hash code according to all attributes.
|
# Calculates hash code according to all attributes.
|
||||||
# @return [Fixnum] Hash code
|
# @return [Fixnum] Hash code
|
||||||
def hash
|
def hash
|
||||||
[integer, int32, int64, number, float, double, string, byte, binary, date, date_time, password].hash
|
[integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password].hash
|
||||||
end
|
end
|
||||||
|
|
||||||
# Builds the object from hash
|
# Builds the object from hash
|
||||||
|
Loading…
x
Reference in New Issue
Block a user