swagger_autogenerate 1.0.8 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/Gemfile.lock +1 -1
- data/lib/swagger_autogenerate/configuration.rb +3 -1
- data/lib/swagger_autogenerate/swagger_trace.rb +11 -5
- data/lib/swagger_autogenerate/version.rb +1 -1
- data/lib/swagger_autogenerate.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 131bed446c702ccaacd09c8e320b10775c1e5cea7dc9a0d894b675302b2b24d1
|
4
|
+
data.tar.gz: a3df01d6c6dc46d1f6e38a0fc8a592dafabba1f2bf52ecb85574284230ce9835
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fca6c316c35e49ebceecb69b0304a9d818ddf5d7b06b128cf02c339b88ebf17e003d5d4e08d7e1b712d699d12e8eb4d6c68fb3273ff35fefc978bdddeb56a7e3
|
7
|
+
data.tar.gz: b51b77a5ea1b37f800405396483d74d92ba5b5cab4e29e5597ae8f43b42df08982ca9c0c531c0d6caf52caded6a825e3c26f4df356e636deb9614eba0126a85f
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module SwaggerAutogenerate
|
2
2
|
class Configuration
|
3
3
|
attr_accessor :with_config, :with_multiple_examples, :with_example_description,
|
4
|
-
:with_response_description, :swagger_environment_variable
|
4
|
+
:with_response_description, :swagger_environment_variable,
|
5
|
+
:environment_name, :security, :swagger_config, :response_status
|
5
6
|
|
6
7
|
def initialize
|
7
8
|
@with_config = true
|
@@ -9,6 +10,7 @@ module SwaggerAutogenerate
|
|
9
10
|
@with_example_description = true
|
10
11
|
@with_response_description = true
|
11
12
|
@swagger_environment_variable = 'SWAGGER'
|
13
|
+
@environment_name = :test
|
12
14
|
@security = security
|
13
15
|
@swagger_config = swagger_config
|
14
16
|
@response_status = response_status
|
@@ -16,10 +16,8 @@ module SwaggerAutogenerate
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def call
|
19
|
-
|
20
|
-
|
21
|
-
write_swagger_trace
|
22
|
-
end
|
19
|
+
read_swagger_trace
|
20
|
+
write_swagger_trace
|
23
21
|
end
|
24
22
|
|
25
23
|
def self.swagger_environment_variable
|
@@ -30,11 +28,19 @@ module SwaggerAutogenerate
|
|
30
28
|
SwaggerTrace.swagger_environment_variable
|
31
29
|
end
|
32
30
|
|
31
|
+
def self.environment_name
|
32
|
+
::SwaggerAutogenerate.configuration.environment_name
|
33
|
+
end
|
34
|
+
|
35
|
+
def environment_name
|
36
|
+
SwaggerTrace.environment_name
|
37
|
+
end
|
38
|
+
|
33
39
|
private
|
34
40
|
|
35
41
|
attr_reader :request, :response, :current_path, :yaml_file, :configuration,
|
36
42
|
:with_config, :with_multiple_examples, :with_example_description,
|
37
|
-
:with_response_description, :security, :response_status
|
43
|
+
:with_response_description, :security, :response_status, :swagger_config
|
38
44
|
|
39
45
|
# main methods
|
40
46
|
|
data/lib/swagger_autogenerate.rb
CHANGED
@@ -5,10 +5,10 @@ module SwaggerAutogenerate
|
|
5
5
|
require_relative 'swagger_autogenerate/swagger_trace.rb'
|
6
6
|
|
7
7
|
included do
|
8
|
-
|
9
|
-
|
10
|
-
super
|
8
|
+
def process_action(*args)
|
9
|
+
super
|
11
10
|
|
11
|
+
if ENV[SwaggerTrace.swagger_environment_variable].present? && Rails.env.send("#{SwaggerTrace.environment_name.to_s}?")
|
12
12
|
SwaggerTrace.new(request, response).call
|
13
13
|
end
|
14
14
|
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.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MohammedBuraiah
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-23 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
|