[Ruby] Escape string interpolation notation of Ruby (#2261) (#2287)

* escape string interpolation notation of Ruby (#2261)

* update samples (#2261)
This commit is contained in:
Akira Tanimura
2019-03-04 23:22:45 +09:00
committed by William Cheng
parent 88abea1755
commit 1d02f0374b
12 changed files with 82 additions and 22 deletions

View File

@@ -33,10 +33,10 @@ import java.util.Locale;
import static org.openapitools.codegen.utils.StringUtils.underscore;
abstract class AbstractRubyCodegen extends DefaultCodegen implements CodegenConfig {
abstract public class AbstractRubyCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractRubyCodegen.class);
AbstractRubyCodegen() {
public AbstractRubyCodegen() {
super();
setReservedWordsLowerCase(
@@ -177,7 +177,7 @@ abstract class AbstractRubyCodegen extends DefaultCodegen implements CodegenConf
@Override
public String escapeUnsafeCharacters(String input) {
return input.replace("=end", "=_end").replace("=begin", "=_begin");
return input.replace("=end", "=_end").replace("=begin", "=_begin").replace("#{", "\\#{");
}
@Override