Skip to content

Commit

Permalink
Merge pull request #179 from yukihirop/features/v0.5.0
Browse files Browse the repository at this point in the history
Merge from features/v0.5.0 into master
  • Loading branch information
yukihirop authored Jan 29, 2021
2 parents cc1ccb3 + 712eb2e commit 5b96f56
Show file tree
Hide file tree
Showing 54 changed files with 246 additions and 756 deletions.
8 changes: 0 additions & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ Lint/AmbiguousOperator:
- "lib/r2-oas/base.rb"
- "lib/r2-oas/routing/parser.rb"
- "lib/r2-oas/app_configuration.rb"
- "lib/r2-oas/pluggable_configuration.rb"

Metrics/MethodLength:
Exclude:
Expand Down Expand Up @@ -161,7 +160,6 @@ Naming/ConstantName:
Naming/PredicateName:
Exclude:
- "lib/r2-oas/hooks/hook.rb"
- "lib/r2-oas/dynamic/schema/v3/object/from_routes/hookable_base_object.rb"
- "lib/r2-oas/plugin/hookable.rb"

Style/DoubleNegation:
Expand All @@ -179,7 +177,6 @@ Naming/AccessorMethodName:
Exclude:
- "lib/r2-oas/configuration.rb"
- "lib/r2-oas/app_configuration.rb"
- "lib/r2-oas/pluggable_configuration.rb"
- "lib/r2-oas/schema/v3/object/from_files/base_object.rb"
- "spec/support/helpers/store_helper.rb"
- "spec/support/helpers/store_helper.rb"
Expand All @@ -196,17 +193,12 @@ Lint/UnderscorePrefixedVariableName:
- "lib/r2-oas/schema/v3/object/from_files/components/request_body_object.rb"
- "lib/r2-oas/schema/v3/object/from_files/components/schema_object.rb"

Lint/UselessAccessModifier:
Exclude:
- "lib/r2-oas/pluggable_configuration.rb"

Style/IdenticalConditionalBranches:
Exclude:
- "lib/r2-oas/schema/editor.rb"

Style/ClassVars:
Exclude:
- "lib/r2-oas/dynamic/schema/v3/object/from_routes/hookable_base_object.rb"
- "lib/r2-oas/plugin/hookable.rb"

Style/AccessModifierDeclarations:
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ language: ruby
cache: bundler

rvm:
- 2.3.3
- 2.4.2
- 2.5.7
- 2.6.5
Expand Down
4 changes: 1 addition & 3 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
appraise 'ruby-2.3.3' do
end
appraise 'ruby-2.4.2' do
appraise 'ruby-2.4.4' do
end
# stable
appraise 'ruby-2.5.8' do
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Change Log
# CHANGELOG

## v0.5.0

2020-01-29

- [`Breaking`] Remove `use_object_classes` option ([#171](https://github.com/yukihirop/r2-oas/pull/171))
- [`Feature`] Upgrade init command ([#176](https://github.com/yukihirop/r2-oas/pull/176))
- [`EOL`] EOL Ruby `2.3` and Support over Ruby `2.5.0` ([#170](https://github.com/yukihirop/r2-oas/pull/170))

Please see mileston [v0.5.0](https://github.com/yukihirop/r2-oas/milestone/5?closed=1)

## v0.4.1

Expand Down
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

# Specify your gem's dependencies in r2-oas.gemspec
gemspec

group :test do
gem 'sqlite3'
end
27 changes: 20 additions & 7 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,17 @@ $ brew cask install chromedriver
gemをrequire後、以下のrakeタスクを実行するだけです。

```bash
bundle exec routes:oas:docs
bundle exec routes:oas:editor
$ bundle exec rake routes:oas:init
create oas_docs
create oas_docs/.paths
create oas_docs/plugins/helpers
create oas_docs/tasks/helpers
create oas_docs/plugins/.gitkeep
create oas_docs/plugins/helpers/.gitkeep
create oas_docs/tasks/.gitkeep
create oas_docs/tasks/helpers/.gitkeep
$ bundle exec rake routes:oas:docs
$ bundle exec rake routes:oas:editor
```

#### Generate docs
Expand Down Expand Up @@ -79,6 +88,14 @@ railsプロジェクトのルートディレクトリで以下のコマンドが

```bash
$ bundle exec rake routes:oas:init
create oas_docs
create oas_docs/.paths
create oas_docs/plugins/helpers
create oas_docs/tasks/helpers
create oas_docs/plugins/.gitkeep
create oas_docs/plugins/helpers/.gitkeep
create oas_docs/tasks/.gitkeep
create oas_docs/tasks/helpers/.gitkeep
```

### Generate
Expand Down Expand Up @@ -141,7 +158,7 @@ $ OAS_FILE="~/Desktop/swagger.yml" bundle exec rake routes:oas:analyze

## ❤️ Support Ruby Version

- Ruby (>= 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin18])
- Ruby (>= 2.5.0)

## ❤️ Support Rouging

Expand Down Expand Up @@ -185,8 +202,6 @@ OpenAPIの3.0.0をサポートしてます。
.
.
===== Bundle install for All Support Ruby Result =====
ruby-2.3.3: 0
ruby-2.4.2: 0
ruby-2.5.8: 0
ruby-2.6.6: 0
ruby-2.7.1: 0
Expand Down Expand Up @@ -214,8 +229,6 @@ ruby-2.7.1: 0
.
.
===== Rspec for All Support Ruby Result =====
ruby-2.3.3: 0
ruby-2.4.2: 0
ruby-2.5.8: 0
ruby-2.6.6: 0
ruby-2.7.1: 0
Expand Down
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,17 @@ R2OAS.load_tasks
```

```bash
bundle exec routes:oas:docs
bundle exec routes:oas:editor
$ bundle exec rake routes:oas:init
create oas_docs
create oas_docs/.paths
create oas_docs/plugins/helpers
create oas_docs/tasks/helpers
create oas_docs/plugins/.gitkeep
create oas_docs/plugins/helpers/.gitkeep
create oas_docs/tasks/.gitkeep
create oas_docs/tasks/helpers/.gitkeep
$ bundle exec rake routes:oas:docs
$ bundle exec rake routes:oas:editor
```

#### Generate docs
Expand All @@ -90,6 +99,14 @@ Initialize r2-oas.

```bash
$ bundle exec rake routes:oas:init
create oas_docs
create oas_docs/.paths
create oas_docs/plugins/helpers
create oas_docs/tasks/helpers
create oas_docs/plugins/.gitkeep
create oas_docs/plugins/helpers/.gitkeep
create oas_docs/tasks/.gitkeep
create oas_docs/tasks/helpers/.gitkeep
```

### Generate
Expand Down Expand Up @@ -147,7 +164,7 @@ Full docs are available at https://yukihirop.github.io/r2-oas

## ❤️ Support Ruby Version

- Ruby (>= 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin18])
- Ruby (>= 2.5.0)

## ❤️ Support Rouging

Expand Down Expand Up @@ -189,8 +206,6 @@ Full docs are available at https://yukihirop.github.io/r2-oas/#/setting/configur
.
.
===== Bundle install for All Support Ruby Result =====
ruby-2.3.3: 0
ruby-2.4.2: 0
ruby-2.5.8: 0
ruby-2.6.6: 0
ruby-2.7.1: 0
Expand Down Expand Up @@ -218,8 +233,6 @@ ruby-2.7.1: 0
.
.
===== Rspec for All Support Ruby Result =====
ruby-2.3.3: 0
ruby-2.4.2: 0
ruby-2.5.8: 0
ruby-2.6.6: 0
ruby-2.7.1: 0
Expand Down
2 changes: 0 additions & 2 deletions devscript/all_support_ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ fi
which rbenv > /dev/null 2>&1 && if [ $? -ne 0 ]; then echo -e 'rbenv is need\nPlease install rbenv: https://github.com/rbenv/rbenv'; exit 1; fi

declare -a all_support_ruby=(
'2.3.3'
'2.4.2'
'2.5.8'
'2.6.6'
'2.7.1'
Expand Down
6 changes: 1 addition & 5 deletions devscript/bundle_for_all_support_ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ for version in $@; do
echo ${version} > ./.ruby-version && rbenv rehash

# Bundle install
if [[ $version == "2.3.3" ]]; then
BUNDLE_GEMFILE=./gemfiles/ruby_${version}.gemfile bundle _1.17.3_ install --path vendor/bundle && report+=("ruby-${version}: $?")
else
BUNDLE_GEMFILE=./gemfiles/ruby_${version}.gemfile bundle install --path vendor/bundle && report+=("ruby-${version}: $?")
fi
BUNDLE_GEMFILE=./gemfiles/ruby_${version}.gemfile bundle install --path vendor/bundle && report+=("ruby-${version}: $?")
if [ $? -ne 0 ]; then report+=("ruby-${version}: 1 (failed)");fi

echo "== End for Ruby Version: ${version} =="
Expand Down
6 changes: 1 addition & 5 deletions devscript/rspec_for_all_support_ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ for version in $@; do
echo ${version} > ./.ruby-version && rbenv rehash

# Rspec
if [[ $version == "2.3.3" ]];then
BUNDLE_GEMFILE=./gemfiles/ruby_${version}.gemfile bundle _1.17.3_ exec rspec --format progress && report+=("ruby-${version}: $?")
else
BUNDLE_GEMFILE=./gemfiles/ruby_${version}.gemfile bundle exec rspec --format progress && report+=("ruby-${version}: $?")
fi
BUNDLE_GEMFILE=./gemfiles/ruby_${version}.gemfile bundle exec rspec --format progress && report+=("ruby-${version}: $?")
if [ $? -ne 0 ]; then report+=("ruby-${version}: 1 (failed)");fi

echo "== End for Ruby Version: ${version} =="
Expand Down
4 changes: 2 additions & 2 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* **Usage**
* [🆕 __Use plugins__](/usage/use_plugins)
* [🆕 __Define tasks__](/usage/define_tasks)
* [__[Deprecated] Use hook methods__](/usage/use_hook_methods)
* [__[Deprecated] Use Hook to Generate Docs__](/usage/use_hook_to_generate_docs)
* [__[before v0.4.1] Use hook methods__](/usage/use_hook_methods)
* [__[before v0.4.1] Use Hook to Generate Docs__](/usage/use_hook_to_generate_docs)
* [Initialize](/usage/initialize)
* [Silent Log](/usage/silent_log)
* [Generate Docs](/usage/generate_docs)
Expand Down
16 changes: 0 additions & 16 deletions docs/setting/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ R2OAS.configure do |config|
swagger.editor.exposed_port = "8080/tcp"
end

config.use_object_classes = {
info_object: R2OAS::Schema::V3::InfoObject,
paths_object: R2OAS::Schema::V3::PathsObject,
path_item_object: R2OAS::Schema::V3::PathItemObject,
external_document_object: R2OAS::Schema::V3::ExternalDocumentObject,
components_object: R2OAS::Schema::V3::ComponentsObject,
components_schema_object: R2OAS::Schema::V3::Components::SchemaObject,
components_request_body_object: R2OAS::Schema::V3::Components::RequestBodyObject
}

config.http_statuses_when_http_method = {
get: {
default: %w(200 422),
Expand Down Expand Up @@ -125,12 +115,6 @@ we explain the options that can be set.
|swagger|editor|port|Swagger Editor Port|`"8080"`|
|swagger|editor|exposed_port|Swagger Editor Exposed Port|`"8080/tcp"`|

#### hook

|option|description|default|
|------|-----------|-------|
|use_object_classes|Object class(hook class) to generate Openapi document|{ info_object: `R2OAS::Schema::V3::InfoObject`,<br>paths_object: `R2OAS::Schema::V3::PathsObject`,<br>path_item_object: `R2OAS::Schema::V3::PathItemObject`, external_document_object: `R2OAS::Schema::V3::ExternalDocumentObject`,<br> components_object: `R2OAS::Schema::V3::ComponentsObject`,<br> components_schema_object: `R2OAS::Schema::V3::Components::SchemaObject`, <br> components_request_body_object:`R2OAS::Schema::V3::Components::RequestBodyObject` }|

#### deprecation

|option|children option|description|default|
Expand Down
8 changes: 8 additions & 0 deletions docs/usage/initialize.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ R2OAS.load_tasks

```bash
$ bundle exec rake routes:oas:init
create oas_docs
create oas_docs/.paths
create oas_docs/plugins/helpers
create oas_docs/tasks/helpers
create oas_docs/plugins/.gitkeep
create oas_docs/plugins/helpers/.gitkeep
create oas_docs/tasks/.gitkeep
create oas_docs/tasks/helpers/.gitkeep
```

By default, the directory is created as follows.
Expand Down
5 changes: 2 additions & 3 deletions docs/usage/use_hook_methods.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# [Deprecated] Use hook methods
# [before v0.4.1] Use hook methods

!> ・will be removed in `v0.4.2`
・Please use the `plugin` instead
!> This option is valid until `v0.4.1`. Please use `plugin` instead for `v0.5.0` and above

Supported hook(life cycle methods) is like this:

Expand Down
5 changes: 2 additions & 3 deletions docs/usage/use_hook_to_generate_docs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## [Deprecated] Use hook to generate docs
# [before v0.4.1] Use hook to generate docs

!> ・will be removed in `v0.4.2`
・Please use the `plugin` instead
!> This option is valid until `v0.4.1`. Please use `plugin` instead for `v0.5.0` and above

## Prepare

Expand Down
11 changes: 0 additions & 11 deletions gemfiles/ruby_2.3.3.gemfile

This file was deleted.

11 changes: 0 additions & 11 deletions gemfiles/ruby_2.4.2.gemfile

This file was deleted.

Loading

0 comments on commit 5b96f56

Please sign in to comment.