apipie-rails 1.1.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +12 -48
  3. data/.github/workflows/rubocop-challenger.yml +2 -2
  4. data/.github/workflows/rubocop.yml +2 -4
  5. data/.rubocop.yml +39 -38
  6. data/.rubocop_todo.yml +55 -65
  7. data/.vscode/settings.json +3 -0
  8. data/CHANGELOG.md +19 -2
  9. data/Gemfile +20 -0
  10. data/README.rst +12 -9
  11. data/app/controllers/apipie/apipies_controller.rb +3 -17
  12. data/gemfiles/Gemfile.tools +9 -0
  13. data/lib/apipie/application.rb +18 -7
  14. data/lib/apipie/dsl_definition.rb +6 -5
  15. data/lib/apipie/errors.rb +14 -0
  16. data/lib/apipie/extractor/collector.rb +1 -1
  17. data/lib/apipie/extractor/recorder.rb +1 -1
  18. data/lib/apipie/extractor.rb +6 -3
  19. data/lib/apipie/generator/swagger/config.rb +3 -1
  20. data/lib/apipie/generator/swagger/method_description/api_schema_service.rb +6 -3
  21. data/lib/apipie/generator/swagger/warning.rb +1 -1
  22. data/lib/apipie/resource_description.rb +28 -3
  23. data/lib/apipie/validator.rb +20 -6
  24. data/lib/apipie/version.rb +1 -1
  25. data/spec/controllers/api/v2/architectures_controller_spec.rb +10 -3
  26. data/spec/controllers/api/v2/empty_middle_controller_spec.rb +23 -0
  27. data/spec/controllers/api/v2/nested/resources_controller_spec.rb +16 -0
  28. data/spec/controllers/api/v2/sub/footguns_controller_spec.rb +19 -0
  29. data/spec/controllers/users_controller_spec.rb +10 -0
  30. data/spec/dummy/app/controllers/api/v2/base_controller.rb +6 -0
  31. data/spec/dummy/app/controllers/api/v2/empty_middle_controller.rb +14 -0
  32. data/spec/dummy/app/controllers/api/v2/nested/resources_controller.rb +2 -2
  33. data/spec/dummy/app/controllers/api/v2/sub/footguns_controller.rb +30 -0
  34. data/spec/dummy/app/controllers/users_controller.rb +6 -0
  35. data/spec/dummy/config/routes.rb +1 -0
  36. data/spec/lib/apipie/apipies_controller_spec.rb +63 -19
  37. data/spec/lib/apipie/extractor/collector_spec.rb +57 -0
  38. data/spec/lib/apipie/generator/swagger/method_description/api_schema_service_spec.rb +13 -0
  39. data/spec/test_engine/memes_controller_spec.rb +1 -1
  40. metadata +11 -9
  41. data/gemfiles/Gemfile.rails50 +0 -10
  42. data/gemfiles/Gemfile.rails51 +0 -10
  43. data/gemfiles/Gemfile.rails52 +0 -10
  44. data/gemfiles/Gemfile.rails60 +0 -17
  45. data/gemfiles/Gemfile.rails61 +0 -17
  46. data/gemfiles/Gemfile.rails70 +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5beee9e3a891140602d1c9a962c9229cbeb60d7e289a95d62a48bfea39b396a9
4
- data.tar.gz: 6f096bb6648692ceaa7a05fa095051a26c4bd176e062bf2ad794a9f3b5438261
3
+ metadata.gz: 555b019a70732e777c4f42b25dd62362be62674c55f31dba9106434969ff7f9f
4
+ data.tar.gz: e63cd96de5768bc21b4a86b755b883440a36ca8c8914ec5af4c89dfe525d94ab
5
5
  SHA512:
6
- metadata.gz: 27f57c84d3b692d40b84ee01740b960d10c9951bdf0e45d936079cd7dc0fac899a0ac90ccd229db6a164549c7238de6bb515f8102b7624342c406a775ee7cbfa
7
- data.tar.gz: 4ee73961d9417cfa623d9d84b5dbf7a8afdfcd19afa86f43b72b807dce374a79b456c3c041d953cb5a31d3b5bb5ba4926ccfd6b2d751ee61e36e21fd0ec83776
6
+ metadata.gz: 0d6aca2dea2281738587924ee7e3388b1b36beb25d9bac7e46f05044080535f52fb77a3523d9262344410f3d76683c0d33a7d0188d99a51d957a9f9392ba7a3e
7
+ data.tar.gz: 7f74cc96e3694406b579649cbd44b8a9ab7d7c273b57d93a7530e1b67a2e32dca27efa408b27a10d87f342abc5badde819e7f02e363ff3d924d3988db33501f2
@@ -1,10 +1,3 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
1
  name: build
9
2
 
10
3
  on: [push, pull_request]
@@ -15,49 +8,20 @@ jobs:
15
8
  strategy:
16
9
  fail-fast: false
17
10
  matrix:
18
- ruby:
19
- - 2.6
20
- - 2.7
21
- - '3.0'
22
- - 3.1
23
- - 3.2
24
- gemfile:
25
- - Gemfile.rails50
26
- - Gemfile.rails51
27
- - Gemfile.rails52 # Min ruby 2.2.2
28
- - Gemfile.rails60 # Min ruby 2.5.0
29
- - Gemfile.rails61 # Min ruby 2.5.0
30
- - Gemfile.rails70 # Min ruby 2.7.0
31
- exclude:
32
- - gemfile: Gemfile.rails50
33
- ruby: 2.7
34
- - gemfile: Gemfile.rails50
35
- ruby: '3.0'
36
- - gemfile: Gemfile.rails50
37
- ruby: 3.1
38
- - gemfile: Gemfile.rails50
39
- ruby: 3.2
40
- - gemfile: Gemfile.rails51
41
- ruby: 2.7
42
- - gemfile: Gemfile.rails51
43
- ruby: '3.0'
44
- - gemfile: Gemfile.rails51
45
- ruby: 3.1
46
- - gemfile: Gemfile.rails51
47
- ruby: 3.2
48
- - gemfile: Gemfile.rails52
49
- ruby: 2.7
50
- - gemfile: Gemfile.rails52
51
- ruby: '3.0'
52
- - gemfile: Gemfile.rails52
53
- ruby: 3.1
54
- - gemfile: Gemfile.rails52
55
- ruby: 3.2
56
- - gemfile: Gemfile.rails70
57
- ruby: 2.6
11
+ rails: ["7.0", "6.1", "6.0"]
12
+ ruby: ["3.2.2", "3.1.4", "3.0.6", "2.7.8"]
13
+ include:
14
+ - rails: "5.2"
15
+ ruby: "2.7.8"
16
+ - rails: "5.1"
17
+ ruby: "2.6.10"
18
+ - rails: "5.0"
19
+ ruby: "2.6.10"
58
20
 
59
21
  env:
60
- BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}
22
+ RUBY_VERSION: ${{ matrix.ruby }}
23
+ RAILS_VERSION: ${{ matrix.rails }}
24
+
61
25
  steps:
62
26
  - uses: actions/checkout@v2
63
27
  - uses: ruby/setup-ruby@v1
@@ -12,10 +12,10 @@ jobs:
12
12
  BUNDLE_GEMFILE: gemfiles/Gemfile.rails50
13
13
  steps:
14
14
  - uses: actions/checkout@v2
15
- - name: Set up Ruby 2.7
15
+ - name: Set up Ruby 3.2
16
16
  uses: ruby/setup-ruby@v1
17
17
  with:
18
- ruby-version: 2.7.6
18
+ ruby-version: 3.2
19
19
  - name: Install bundler
20
20
  run: gem install bundler
21
21
  - name: Install gems
@@ -5,15 +5,13 @@ on: [push, pull_request]
5
5
  jobs:
6
6
  build:
7
7
  runs-on: ubuntu-latest
8
- env:
9
- BUNDLE_GEMFILE: gemfiles/Gemfile.rails70
10
8
  steps:
11
9
  - uses: actions/checkout@v3
12
10
 
13
- - name: Set up Ruby 3.2.1
11
+ - name: Set up Ruby 3.2
14
12
  uses: ruby/setup-ruby@v1
15
13
  with:
16
- ruby-version: 3.2.1
14
+ ruby-version: 3.2
17
15
  bundler-cache: true
18
16
 
19
17
  - name: Run rubocop
data/.rubocop.yml CHANGED
@@ -10,6 +10,7 @@ Rails:
10
10
 
11
11
  AllCops:
12
12
  NewCops: enable
13
+ TargetRubyVersion: 2.6
13
14
 
14
15
  Layout/LineLength:
15
16
  Max: 140
@@ -45,7 +46,7 @@ Metrics/ClassLength:
45
46
  - spec/dummy/app/controllers/users_controller.rb
46
47
 
47
48
  Metrics/BlockLength:
48
- Max: 25 # default
49
+ Max: 26 # default
49
50
  Exclude:
50
51
  - app/controllers/apipie/apipies_controller.rb
51
52
  - lib/apipie/generator/swagger/param_description/composite.rb
@@ -69,43 +70,43 @@ Style/HashSyntax:
69
70
 
70
71
  Metrics/ParameterLists:
71
72
  Exclude:
72
- - 'lib/apipie/generator/swagger/context.rb'
73
+ - "lib/apipie/generator/swagger/context.rb"
73
74
 
74
75
  Style/Documentation:
75
76
  Exclude:
76
- - 'app/controllers/apipie/apipies_controller.rb'
77
- - 'app/helpers/apipie_helper.rb'
78
- - 'lib/apipie/apipie_module.rb'
79
- - 'lib/apipie/application.rb'
80
- - 'lib/apipie/configuration.rb'
81
- - 'lib/apipie/core_ext/route.rb'
82
- - 'lib/apipie/dsl_definition.rb'
83
- - 'lib/apipie/error_description.rb'
84
- - 'lib/apipie/errors.rb'
85
- - 'lib/apipie/extractor.rb'
86
- - 'lib/apipie/extractor/collector.rb'
87
- - 'lib/apipie/extractor/recorder.rb'
88
- - 'lib/apipie/extractor/writer.rb'
89
- - 'lib/apipie/generator/generator.rb'
90
- - 'lib/apipie/generator/swagger/**/*'
91
- - 'lib/apipie/helpers.rb'
92
- - 'lib/apipie/markup.rb'
93
- - 'lib/apipie/method_description.rb'
94
- - 'lib/apipie/method_description/api.rb'
95
- - 'lib/apipie/middleware/checksum_in_headers.rb'
96
- - 'lib/apipie/railtie.rb'
97
- - 'lib/apipie/response_description.rb'
98
- - 'lib/apipie/response_description_adapter.rb'
99
- - 'lib/apipie/routes_formatter.rb'
100
- - 'lib/apipie/routing.rb'
101
- - 'lib/apipie/rspec/response_validation_helper.rb'
102
- - 'lib/apipie/swagger_generator.rb'
103
- - 'lib/apipie/see_description.rb'
104
- - 'lib/apipie/static_dispatcher.rb'
105
- - 'lib/apipie/tag_list_description.rb'
106
- - 'lib/apipie/validator.rb'
107
- - 'lib/generators/apipie/install/install_generator.rb'
108
- - 'lib/generators/apipie/views_generator.rb'
77
+ - "app/controllers/apipie/apipies_controller.rb"
78
+ - "app/helpers/apipie_helper.rb"
79
+ - "lib/apipie/apipie_module.rb"
80
+ - "lib/apipie/application.rb"
81
+ - "lib/apipie/configuration.rb"
82
+ - "lib/apipie/core_ext/route.rb"
83
+ - "lib/apipie/dsl_definition.rb"
84
+ - "lib/apipie/error_description.rb"
85
+ - "lib/apipie/errors.rb"
86
+ - "lib/apipie/extractor.rb"
87
+ - "lib/apipie/extractor/collector.rb"
88
+ - "lib/apipie/extractor/recorder.rb"
89
+ - "lib/apipie/extractor/writer.rb"
90
+ - "lib/apipie/generator/generator.rb"
91
+ - "lib/apipie/generator/swagger/**/*"
92
+ - "lib/apipie/helpers.rb"
93
+ - "lib/apipie/markup.rb"
94
+ - "lib/apipie/method_description.rb"
95
+ - "lib/apipie/method_description/api.rb"
96
+ - "lib/apipie/middleware/checksum_in_headers.rb"
97
+ - "lib/apipie/railtie.rb"
98
+ - "lib/apipie/response_description.rb"
99
+ - "lib/apipie/response_description_adapter.rb"
100
+ - "lib/apipie/routes_formatter.rb"
101
+ - "lib/apipie/routing.rb"
102
+ - "lib/apipie/rspec/response_validation_helper.rb"
103
+ - "lib/apipie/swagger_generator.rb"
104
+ - "lib/apipie/see_description.rb"
105
+ - "lib/apipie/static_dispatcher.rb"
106
+ - "lib/apipie/tag_list_description.rb"
107
+ - "lib/apipie/validator.rb"
108
+ - "lib/generators/apipie/install/install_generator.rb"
109
+ - "lib/generators/apipie/views_generator.rb"
109
110
  - spec/support/custom_bool_validator.rb
110
111
  - spec/lib/validators/array_validator_spec.rb
111
112
  - spec/dummy/**/*.rb
@@ -122,6 +123,6 @@ Naming/BlockForwarding:
122
123
 
123
124
  Lint/MissingSuper:
124
125
  Exclude:
125
- - 'lib/apipie/errors.rb'
126
- - 'lib/apipie/response_description_adapter.rb'
127
- - 'lib/apipie/validator.rb'
126
+ - "lib/apipie/errors.rb"
127
+ - "lib/apipie/response_description_adapter.rb"
128
+ - "lib/apipie/validator.rb"