Skip to content

Commit

Permalink
[Ruby] Rename files/folders (#534)
Browse files Browse the repository at this point in the history
* Rename templateDir: rails5 -> ruby-on-rails-server

* Rename script: rails5-petstore-server.sh -> ruby-on-rails-server-petstore.sh

* Rename sample folder: rails5 -> ruby-on-rails

* Rename script(openapi3): rails5-petstore-server.sh -> ruby-on-rails-server-petstore.sh

* Update ruby-on-rails-server-petstore.sh

* Rename templateDir: sinatra -> ruby-sinatra-server

* Rename script: sinatra-petstore-server.sh -> ruby-sinatra-server-petstore.sh

* Rename sample folder: sinatra -> ruby-sinatra

* Update script

* Rename templateDir: ruby -> ruby-client

* Rename script: ruby-petstore.sh -> ruby-client-petstore.sh

* Update scripts

* Update samples

- bin/ruby-sinatra-server-petstore.sh
- bin/ruby-on-rails-server-petstore.sh
- bin/ruby-client-petstore.sh
- bin/security/ruby-client-petstore.sh
  • Loading branch information
ackintosh authored and wing328 committed Jul 13, 2018
1 parent 6c14b42 commit 26e70fe
Show file tree
Hide file tree
Showing 200 changed files with 379 additions and 375 deletions.
32 changes: 0 additions & 32 deletions bin/openapi3/rails5-petstore-server.sh

This file was deleted.

32 changes: 32 additions & 0 deletions bin/openapi3/ruby-client-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/ruby -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore-security-test/ruby $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/ruby -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@"

java $JAVA_OPTS -jar $executable $ags
32 changes: 32 additions & 0 deletions bin/ruby-client-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn -B clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/ruby -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/rails5 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/rails5 $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@"

java $JAVA_OPTS -jar $executable $ags
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/sinatra -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/sinatra $@"
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore-security-test/ruby $@"

java $JAVA_OPTS -jar $executable $ags
32 changes: 0 additions & 32 deletions bin/sinatra-petstore-server.sh

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public RubyClientCodegen() {
apiTemplateFiles.put("api.mustache", ".rb");
modelDocTemplateFiles.put("model_doc.mustache", ".md");
apiDocTemplateFiles.put("api_doc.mustache", ".md");
embeddedTemplateDir = templateDir = "ruby";
embeddedTemplateDir = templateDir = "ruby-client";

modelTestTemplateFiles.put("model_test.mustache", ".rb");
apiTestTemplateFiles.put("api_test.mustache", ".rb");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public RubyOnRailsServerCodegen() {
modelPackage = "app/models";
modelTemplateFiles.put("model.mustache", ".rb");

embeddedTemplateDir = templateDir = "rails5";
embeddedTemplateDir = templateDir = "ruby-on-rails-server";

typeMapping.clear();
languageSpecificPrimitives.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public RubySinatraServerCodegen() {
// no model
modelTemplateFiles.clear();
apiTemplateFiles.put("api.mustache", ".rb");
embeddedTemplateDir = templateDir = "sinatra";
embeddedTemplateDir = templateDir = "ruby-sinatra-server";

typeMapping.clear();
languageSpecificPrimitives.clear();
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0-SNAPSHOT
3.1.1-SNAPSHOT
6 changes: 4 additions & 2 deletions samples/client/petstore-security-test/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

Petstore - the Ruby gem for the OpenAPI Petstore */ ' \" =_end -- \\r\\n \\n \\r

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --



This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

Expand Down Expand Up @@ -70,7 +72,7 @@ end

## Documentation for API Endpoints

All URIs are relative to *petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r*
All URIs are relative to *http://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore-security-test/ruby/docs/FakeApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore::FakeApi

All URIs are relative to *petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r*
All URIs are relative to *http://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore-security-test/ruby/lib/petstore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down Expand Up @@ -129,8 +129,8 @@ class Configuration

def initialize
@scheme = 'http'
@host = 'localhost'
@base_path = ''
@host = 'petstore.swagger.io *'
@base_path = '/ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r'
@api_key = {}
@api_key_prefix = {}
@timeout = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
Contact: something@something.abc */ ' \" =_end -- \\r\\n \\n \\r
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.0-SNAPSHOT
OpenAPI Generator version: 3.1.1-SNAPSHOT
=end

Expand Down
1 change: 0 additions & 1 deletion samples/server/petstore/rails5/.openapi-generator/VERSION

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.1-SNAPSHOT
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.1-SNAPSHOT
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 26e70fe

Please sign in to comment.