forked from loafle/openapi-generator-original
[Ruby] Rename files/folders (#534)
* 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
This commit is contained in:
committed by
William Cheng
parent
6c14b4271f
commit
26e70fe642
@@ -0,0 +1,5 @@
|
||||
# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
|
||||
module ApplicationCable
|
||||
class Channel < ActionCable::Channel::Base
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
|
||||
module ApplicationCable
|
||||
class Connection < ActionCable::Connection::Base
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
class ApplicationController < ActionController::API
|
||||
end
|
||||
@@ -0,0 +1,59 @@
|
||||
=begin
|
||||
OpenAPI Petstore
|
||||
|
||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
|
||||
=end
|
||||
class PetController < ApplicationController
|
||||
|
||||
def create
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def destroy
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def find_pets_by_status
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def find_pets_by_tags
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def show
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def update_pet
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def update_pet_with_form
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def upload_file
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,35 @@
|
||||
=begin
|
||||
OpenAPI Petstore
|
||||
|
||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
|
||||
=end
|
||||
class StoreController < ApplicationController
|
||||
|
||||
def delete_order
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def get_inventory
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def get_order_by_id
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def place_order
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,59 @@
|
||||
=begin
|
||||
OpenAPI Petstore
|
||||
|
||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
|
||||
=end
|
||||
class UserController < ApplicationController
|
||||
|
||||
def create
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def create_users_with_array_input
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def create_users_with_list_input
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def destroy
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def show
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def login_user
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def logout_user
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
|
||||
def update
|
||||
# Your code here
|
||||
|
||||
render json: {"message" => "yes, it worked"}
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
class ApplicationJob < ActiveJob::Base
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
class ApplicationMailer < ActionMailer::Base
|
||||
default from: 'from@example.com'
|
||||
layout 'mailer'
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
=begin
|
||||
OpenAPI Petstore
|
||||
|
||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
|
||||
=end
|
||||
|
||||
|
||||
class ApiResponse < ApplicationRecord
|
||||
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
class ApplicationRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
end
|
||||
14
samples/server/petstore/ruby-on-rails/app/models/category.rb
Normal file
14
samples/server/petstore/ruby-on-rails/app/models/category.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
=begin
|
||||
OpenAPI Petstore
|
||||
|
||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
|
||||
=end
|
||||
|
||||
|
||||
class Category < ApplicationRecord
|
||||
|
||||
end
|
||||
14
samples/server/petstore/ruby-on-rails/app/models/order.rb
Normal file
14
samples/server/petstore/ruby-on-rails/app/models/order.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
=begin
|
||||
OpenAPI Petstore
|
||||
|
||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
|
||||
=end
|
||||
|
||||
|
||||
class Order < ApplicationRecord
|
||||
|
||||
end
|
||||
18
samples/server/petstore/ruby-on-rails/app/models/pet.rb
Normal file
18
samples/server/petstore/ruby-on-rails/app/models/pet.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
=begin
|
||||
OpenAPI Petstore
|
||||
|
||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
|
||||
=end
|
||||
|
||||
|
||||
class Pet < ApplicationRecord
|
||||
validates_presence_of :name
|
||||
validates_presence_of :photo_urls
|
||||
|
||||
serialize :photo_urls, Array
|
||||
serialize :tags, Array
|
||||
end
|
||||
14
samples/server/petstore/ruby-on-rails/app/models/tag.rb
Normal file
14
samples/server/petstore/ruby-on-rails/app/models/tag.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
=begin
|
||||
OpenAPI Petstore
|
||||
|
||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
|
||||
=end
|
||||
|
||||
|
||||
class Tag < ApplicationRecord
|
||||
|
||||
end
|
||||
14
samples/server/petstore/ruby-on-rails/app/models/user.rb
Normal file
14
samples/server/petstore/ruby-on-rails/app/models/user.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
=begin
|
||||
OpenAPI Petstore
|
||||
|
||||
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
|
||||
=end
|
||||
|
||||
|
||||
class User < ApplicationRecord
|
||||
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Email styles need to be inline */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
<%= yield %>
|
||||
Reference in New Issue
Block a user