swagger_autogenerate 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6f642d29cd299f7f2e7b32b7e87a89f6a6b0f037f11bd5c7bcabbfd56d34de1
4
- data.tar.gz: 624631c39528ce4d096325dc638e2031363424124cc9922032005a44e26a2fd8
3
+ metadata.gz: baeb0333fe686eb9c041d44e0a37f816ea1467b5eff9acb59189bf2c8ee1ca22
4
+ data.tar.gz: b4a9d7f8bcbacd061cc7f61058e81d3eebf31908ddb47058155ba45b8d6d0df9
5
5
  SHA512:
6
- metadata.gz: 2208abc4d89eac17e33f02f3c8a541ee9f68c6b1590ed93a7785ee941b9cc31e3b7fe3f74ad16689cf93639329fe85a30334651449ce7ace10699ef3ef4e1760
7
- data.tar.gz: 8ef10a7cd712aa5114ac38395b189d84f7ec83fa9b05b64ac5ce0c8b5f7632d4cb33dea35d4cc4211c66471dae5f7ee6e15810fe7394951d1afd07ef0cd17154
6
+ metadata.gz: 78da25f6d4ff424ecfe162016f2f5565c4ac1f9995767f45efa4030d95df9a15132a2ebaf692620fd5bc500916b69689dac5fd8aeac6ee53ea67ee64a2764779
7
+ data.tar.gz: 87d783020090efc560b3ae50dc21846a7e9b3f682119fbc4c61b8610450e165dc1b7fd6c9fd64b6648a809d6a7c14c3bdb7ff0e5c34b723ea8cea86f5e39fc1d
data/CHANGELOG.md CHANGED
@@ -14,5 +14,6 @@
14
14
  ## [1.1.2] - 2024-08-17
15
15
  ## [1.2.0] - 2024-09-08
16
16
  ## [1.2.1] - 2024-09-08
17
+ ## [1.2.2] - 2024-09-12
17
18
 
18
19
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- swagger_autogenerate (1.2.1)
4
+ swagger_autogenerate (1.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -82,9 +82,4 @@ module SwaggerAutogenerate
82
82
  def self.configure
83
83
  yield(configuration)
84
84
  end
85
-
86
- def self.extract_description(full_rspec_description)
87
- parts = full_rspec_description.split(' ')
88
- parts&.length > 1 ? parts[2..-1].join(" ") : full_rspec_description
89
- end
90
85
  end
@@ -528,9 +528,11 @@ module SwaggerAutogenerate
528
528
  end
529
529
 
530
530
  def handel_name_last_example(old_examples)
531
- last_example = old_examples.keys.last
532
- last_example += '-1' if json_example_plus_one(last_example) == last_example
533
- json_example_plus_one(last_example)
531
+ last_example = full_rspec_description || old_examples.keys.last
532
+ if old_examples.keys.include?(last_example)
533
+ last_example += '-1'
534
+ json_example_plus_one(last_example)
535
+ end
534
536
  end
535
537
 
536
538
  def add_properties_to_schema(last_example, main_path = yaml_file['paths'][current_path])
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SwaggerAutogenerate
4
- VERSION = "1.2.1"
4
+ VERSION = "1.2.2"
5
5
  end
@@ -25,7 +25,7 @@ if defined?(RSpec) && SwaggerAutogenerate.allow_swagger?
25
25
 
26
26
  RSpec.configure do |config|
27
27
  config.before(:each) do |example|
28
- SwaggerAutogenerate::SwaggerTrace.rspec_description = SwaggerAutogenerate.extract_description(example.metadata[:full_description])
28
+ SwaggerAutogenerate::SwaggerTrace.rspec_description = example&.metadata.dig(:example_group, :description)
29
29
  end
30
30
  end
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swagger_autogenerate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - MohammedBuraiah
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-10 00:00:00.000000000 Z
11
+ date: 2024-09-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Generating Swagger YAML Automatically Based on Existing Test Cases in
14
14
  Ruby on Rails