diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java index 28122ae70a4..390a06335c8 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java @@ -250,6 +250,8 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); + supportingFiles.add(new SupportingFile("Rakefile.mustache", "", "Rakefile")); + supportingFiles.add(new SupportingFile("Gemfile.mustache", "", "Gemfile")); // test files should not be overwritten writeOptional(outputFolder, new SupportingFile("rspec.mustache", "", ".rspec")); diff --git a/modules/swagger-codegen/src/main/resources/ruby/Gemfile.mustache b/modules/swagger-codegen/src/main/resources/ruby/Gemfile.mustache new file mode 100644 index 00000000000..d255a3ab238 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ruby/Gemfile.mustache @@ -0,0 +1,7 @@ +source 'https://rubygems.org' + +gemspec + +group :development, :test do + gem 'rake', '~> 12.0.0' +end diff --git a/modules/swagger-codegen/src/main/resources/ruby/Rakefile.mustache b/modules/swagger-codegen/src/main/resources/ruby/Rakefile.mustache new file mode 100644 index 00000000000..d52c3e31753 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ruby/Rakefile.mustache @@ -0,0 +1,8 @@ +begin + require 'rspec/core/rake_task' + + RSpec::Core::RakeTask.new(:spec) + task default: :spec +rescue LoadError + # no rspec available +end diff --git a/samples/client/petstore/ruby/Gemfile b/samples/client/petstore/ruby/Gemfile index 06d4a65272e..d255a3ab238 100644 --- a/samples/client/petstore/ruby/Gemfile +++ b/samples/client/petstore/ruby/Gemfile @@ -1,4 +1,7 @@ -source "http://rubygems.org" +source 'https://rubygems.org' -# Specify dependencies in swagger.gemspec gemspec + +group :development, :test do + gem 'rake', '~> 12.0.0' +end diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 090cbc360c9..2789989c589 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/ - API version: 1.0.0 - Package version: 1.0.0 -- Build package: class io.swagger.codegen.languages.RubyClientCodegen +- Build package: io.swagger.codegen.languages.RubyClientCodegen ## Installation diff --git a/samples/client/petstore/ruby/Rakefile b/samples/client/petstore/ruby/Rakefile index e62140b1677..d52c3e31753 100644 --- a/samples/client/petstore/ruby/Rakefile +++ b/samples/client/petstore/ruby/Rakefile @@ -1,7 +1,8 @@ -require 'bundler' -Bundler::GemHelper.install_tasks +begin + require 'rspec/core/rake_task' -require 'rspec/core/rake_task' -require 'swagger' - -RSpec::Core::RakeTask.new('spec') \ No newline at end of file + RSpec::Core::RakeTask.new(:spec) + task default: :spec +rescue LoadError + # no rspec available +end diff --git a/samples/client/petstore/ruby/docs/FakeApi.md b/samples/client/petstore/ruby/docs/FakeApi.md index aca0fbd10d6..6645e70f533 100644 --- a/samples/client/petstore/ruby/docs/FakeApi.md +++ b/samples/client/petstore/ruby/docs/FakeApi.md @@ -14,6 +14,8 @@ Method | HTTP request | Description To test \"client\" model +To test \"client\" model + ### Example ```ruby # load the gem @@ -142,6 +144,8 @@ nil (empty response body) To test enum parameters +To test enum parameters + ### Example ```ruby # load the gem diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index b869af1f445..403705d2746 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -20,7 +20,7 @@ module Petstore end # To test \"client\" model - # + # To test \"client\" model # @param body client model # @param [Hash] opts the optional parameters # @return [Client] @@ -30,7 +30,7 @@ module Petstore end # To test \"client\" model - # + # To test \"client\" model # @param body client model # @param [Hash] opts the optional parameters # @return [Array<(Client, Fixnum, Hash)>] Client data, response status code and response headers @@ -223,7 +223,7 @@ module Petstore end # To test enum parameters - # + # To test enum parameters # @param [Hash] opts the optional parameters # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) # @option opts [String] :enum_form_string Form parameter enum test (string) (default to -efg) @@ -240,7 +240,7 @@ module Petstore end # To test enum parameters - # + # To test enum parameters # @param [Hash] opts the optional parameters # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) # @option opts [String] :enum_form_string Form parameter enum test (string)