oas_contrib 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec_status +10 -10
- data/lib/oas_contrib/command.rb +28 -29
- data/lib/oas_contrib/interface/resolver.rb +4 -24
- data/lib/oas_contrib/interface/spec.rb +0 -4
- data/lib/oas_contrib/openapi/base.rb +0 -6
- data/lib/oas_contrib/openapi/v2/spec.rb +1 -16
- data/lib/oas_contrib/openapi/v3/spec.rb +1 -16
- data/lib/oas_contrib/resolver/base.rb +14 -35
- data/lib/oas_contrib/resolver/divide.rb +1 -35
- data/lib/oas_contrib/resolver/merge.rb +3 -62
- data/lib/oas_contrib/resolver/preview.rb +3 -25
- data/lib/oas_contrib/version.rb +1 -2
- data/lib/oas_contrib.rb +0 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b1a48c2b71fbc69225a8d565450bd2478ce8e5f2710196a06c05a3d60c93e68
|
4
|
+
data.tar.gz: 4bb4aea54a90ebdd8edc03252da09122625e411c17a31076fdd93c8457df76ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 723585fa66b02f6ff7201026234ea318f9f26e798a2ddf6fdc232c6b32505a7a3d9a6653c07820cd12f32fb38f74009727a34a8425073b9692e9ba14ed13d03a
|
7
|
+
data.tar.gz: a7d852a298beafaf2fbefec3c84278610d680f438ca3d21d9a02d36fd005e73e707709e165593fea66920696be8ccbbd5132512edaa4a1a3ec4313adf2bc561b
|
data/.rspec_status
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
------------------------------------ | ------ | --------------- |
|
3
|
-
./spec/divide_command_spec.rb[1:1:1] | passed | 0.
|
4
|
-
./spec/divide_command_spec.rb[1:2:1] | passed | 0.
|
5
|
-
./spec/divide_command_spec.rb[1:3:1] | passed | 0.
|
6
|
-
./spec/divide_command_spec.rb[1:4:1] | passed | 0.
|
7
|
-
./spec/divide_command_spec.rb[1:5:1] | passed | 0.
|
8
|
-
./spec/merge_command_spec.rb[1:1:1] | passed | 0.
|
9
|
-
./spec/merge_command_spec.rb[1:2:1] | passed | 0.
|
10
|
-
./spec/merge_command_spec.rb[1:3:1] | passed | 0.
|
11
|
-
./spec/merge_command_spec.rb[1:4:1] | passed | 0.
|
12
|
-
./spec/merge_command_spec.rb[1:5:1] | passed | 0.
|
3
|
+
./spec/divide_command_spec.rb[1:1:1] | passed | 0.34731 seconds |
|
4
|
+
./spec/divide_command_spec.rb[1:2:1] | passed | 0.35834 seconds |
|
5
|
+
./spec/divide_command_spec.rb[1:3:1] | passed | 0.50581 seconds |
|
6
|
+
./spec/divide_command_spec.rb[1:4:1] | passed | 0.41085 seconds |
|
7
|
+
./spec/divide_command_spec.rb[1:5:1] | passed | 0.52116 seconds |
|
8
|
+
./spec/merge_command_spec.rb[1:1:1] | passed | 0.80512 seconds |
|
9
|
+
./spec/merge_command_spec.rb[1:2:1] | passed | 0.54957 seconds |
|
10
|
+
./spec/merge_command_spec.rb[1:3:1] | passed | 0.45048 seconds |
|
11
|
+
./spec/merge_command_spec.rb[1:4:1] | passed | 0.53336 seconds |
|
12
|
+
./spec/merge_command_spec.rb[1:5:1] | passed | 0.60615 seconds |
|
data/lib/oas_contrib/command.rb
CHANGED
@@ -4,42 +4,41 @@ require 'oas_contrib/resolver/merge'
|
|
4
4
|
require 'oas_contrib/resolver/preview'
|
5
5
|
|
6
6
|
module OasContrib
|
7
|
-
# Commands
|
8
7
|
class Command < Thor
|
8
|
+
include Thor::Actions
|
9
|
+
|
9
10
|
option :out_type, type: :string, default: 'yaml', desc: 'output file type (yaml or json)'
|
10
|
-
desc 'divide <
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
desc 'divide <spec_file> <output_dir> (<options>)', 'Divide the spec_file into path units and schema units.'
|
12
|
+
|
13
|
+
def divide(spec_file, outdir)
|
14
|
+
resolver = OasContrib::Resolver::Divide.new(spec_file, outdir, options)
|
15
|
+
resolver.setup
|
16
|
+
resolver.load
|
17
|
+
resolver.resolve
|
18
|
+
resolver.distribute
|
19
|
+
say 'complete!', :green
|
17
20
|
end
|
18
21
|
|
19
22
|
option :in_type, type: :string, default: 'yaml', desc: 'input file type (yaml or json)'
|
20
|
-
desc 'merge <input_dir> <
|
21
|
-
# Command (Merge multiple divided files into an OAS file)
|
22
|
-
# @param [String] indir input directory path
|
23
|
-
# @param [String] outfile output file path
|
24
|
-
# @return [Integer]
|
25
|
-
def merge(indir, outfile)
|
26
|
-
OasContrib::Resolver::Merge.new(indir, outfile, options).run
|
27
|
-
end
|
23
|
+
desc 'merge <input_dir> <spec_file> (<options>)', 'Merge multiple divided files into an spec_file.'
|
28
24
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
25
|
+
def merge(indir, spec_file)
|
26
|
+
resolver = OasContrib::Resolver::Merge.new(indir, spec_file, options)
|
27
|
+
resolver.setup
|
28
|
+
resolver.load
|
29
|
+
resolver.resolve
|
30
|
+
resolver.distribute
|
31
|
+
say 'complete!', :green
|
36
32
|
end
|
37
33
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
34
|
+
option :port, type: :numeric, default: 50010, desc: 'Swagger UI listen port'
|
35
|
+
desc 'preview <spec_file> (<options>)', 'Preview the spec_file using Swagger-UI official Docker image.'
|
36
|
+
|
37
|
+
def preview(spec_file)
|
38
|
+
resolver = OasContrib::Resolver::Preview.new(spec_file, options)
|
39
|
+
resolver.setup
|
40
|
+
resolver.distribute
|
41
|
+
say 'complete!', :green
|
42
|
+
end
|
44
43
|
end
|
45
44
|
end
|
@@ -1,41 +1,21 @@
|
|
1
1
|
module OasContrib
|
2
2
|
module Interface
|
3
|
-
# Resolver Interface
|
4
3
|
module Resolver
|
5
|
-
# Run
|
6
|
-
# @raise [NotImplementedError]
|
7
|
-
# @return [nil]
|
8
|
-
def run
|
9
|
-
raise NotImplementedError, 'You must be implement "run" method.'
|
10
|
-
end
|
11
|
-
|
12
|
-
# Run
|
13
|
-
# @raise [NotImplementedError]
|
14
|
-
# @return [nil]
|
15
4
|
def setup
|
16
5
|
raise NotImplementedError, 'You must be implement "setup" method.'
|
17
6
|
end
|
18
7
|
|
19
|
-
# Load
|
20
|
-
# @raise [NotImplementedError]
|
21
|
-
# @return [nil]
|
22
8
|
def load
|
23
9
|
raise NotImplementedError, 'You must be implement "load" method.'
|
24
10
|
end
|
25
11
|
|
26
|
-
# Distribute
|
27
|
-
# @raise [NotImplementedError]
|
28
|
-
# @return [nil]
|
29
|
-
def dist
|
30
|
-
raise NotImplementedError, 'You must be implement"dist" method.'
|
31
|
-
end
|
32
|
-
|
33
|
-
# Resolve
|
34
|
-
# @raise [NotImplementedError]
|
35
|
-
# @return [nil]
|
36
12
|
def resolve
|
37
13
|
raise NotImplementedError, 'You must be implement "resolve" method.'
|
38
14
|
end
|
15
|
+
|
16
|
+
def distribute
|
17
|
+
raise NotImplementedError, 'You must be implement"dist" method.'
|
18
|
+
end
|
39
19
|
end
|
40
20
|
end
|
41
21
|
end
|
@@ -1,18 +1,12 @@
|
|
1
1
|
require 'oas_contrib/interface/spec'
|
2
2
|
|
3
3
|
module OasContrib
|
4
|
-
# OpenAPI module
|
5
4
|
module OpenAPI
|
6
|
-
# Spec Base
|
7
5
|
class Base
|
8
|
-
# @!attribute data
|
9
|
-
# @return [<Type>] <description>
|
10
6
|
attr_reader :data
|
11
7
|
|
12
8
|
include OasContrib::Interface::Spec
|
13
9
|
|
14
|
-
# Initialize
|
15
|
-
# @param [Hash] data mapping data
|
16
10
|
def initialize(data)
|
17
11
|
@data = data
|
18
12
|
end
|
@@ -1,30 +1,15 @@
|
|
1
1
|
require 'oas_contrib/openapi/base'
|
2
2
|
|
3
3
|
module OasContrib
|
4
|
-
# OpenAPI module
|
5
4
|
module OpenAPI
|
6
|
-
# Version 2 module
|
7
5
|
module V2
|
8
|
-
# Spec
|
9
6
|
class Spec < OasContrib::OpenAPI::Base
|
10
|
-
|
11
|
-
# @return [<Type>] <description>
|
12
|
-
attr_reader :meta
|
13
|
-
# @!attribute [r] path
|
14
|
-
# @return [<Type>] <description>
|
15
|
-
attr_reader :path
|
16
|
-
# @!attribute [r] model
|
17
|
-
# @return [<Type>] <description>
|
18
|
-
attr_reader :model
|
7
|
+
attr_reader :meta, :path, :model
|
19
8
|
|
20
|
-
# Initialize
|
21
|
-
# @param [Hash] data mapping data
|
22
9
|
def initialize(data)
|
23
10
|
super
|
24
11
|
end
|
25
12
|
|
26
|
-
# Mapping
|
27
|
-
# @return [OpenAPI::V2::Spec]
|
28
13
|
def mapping
|
29
14
|
@meta = data.select { |v| v != 'paths' && v != 'definitions' } || nil
|
30
15
|
@path = data['paths'] || nil
|
@@ -1,30 +1,15 @@
|
|
1
1
|
require 'oas_contrib/openapi/base'
|
2
2
|
|
3
3
|
module OasContrib
|
4
|
-
# OpenAPI
|
5
4
|
module OpenAPI
|
6
|
-
# Version 3 module
|
7
5
|
module V3
|
8
|
-
# Spec class
|
9
6
|
class Spec < OasContrib::OpenAPI::Base
|
10
|
-
|
11
|
-
# @return [<Type>] <description>
|
12
|
-
attr_reader :meta
|
13
|
-
# @!attribute [r] path
|
14
|
-
# @return [<Type>] <description>
|
15
|
-
attr_reader :path
|
16
|
-
# @!attribute [r] model
|
17
|
-
# @return [<Type>] <description>
|
18
|
-
attr_reader :model
|
7
|
+
attr_reader :meta ,:path, :model
|
19
8
|
|
20
|
-
# Initialize
|
21
|
-
# @param [Hash] data mapping data
|
22
9
|
def initialize(data)
|
23
10
|
super
|
24
11
|
end
|
25
12
|
|
26
|
-
# Mapping
|
27
|
-
# @return [OpenAPI::V3::Spec]
|
28
13
|
def mapping
|
29
14
|
@meta = data.select { |v| v != 'paths' && v != 'components' } || nil
|
30
15
|
@path = data['paths'] || nil
|
@@ -6,33 +6,19 @@ require 'json'
|
|
6
6
|
|
7
7
|
module OasContrib
|
8
8
|
module Resolver
|
9
|
-
# CommandResolver Base
|
10
9
|
class Base
|
11
|
-
|
12
|
-
# @return [<Type>] <description>
|
13
|
-
attr_reader :data
|
14
|
-
|
15
|
-
# @!attribute [r] spec
|
16
|
-
# @return [<Type>] <description>
|
17
|
-
attr_reader :spec
|
10
|
+
attr_reader :data, :spec
|
18
11
|
|
19
12
|
include OasContrib::Interface::Resolver
|
20
13
|
|
21
|
-
# <Description>
|
22
|
-
# @return [<Type>] <description>
|
23
14
|
def v3?
|
24
15
|
@data['openapi'] =~ /^3/
|
25
16
|
end
|
26
17
|
|
27
|
-
# <Description>
|
28
|
-
# @return [<Type>] <description>
|
29
18
|
def v2?
|
30
19
|
@data['swagger'] =~ /^2/
|
31
20
|
end
|
32
21
|
|
33
|
-
# Resolver spec object
|
34
|
-
# @raise [StandardError]
|
35
|
-
# @return [OasContrib::Swagger::V2::Spec|OasContrib::OpenAPI::V3::Spec] spec
|
36
22
|
def resolve
|
37
23
|
@spec = OasContrib::OpenAPI::V2::Spec.new(@data) if v2?
|
38
24
|
@spec = OasContrib::OpenAPI::V3::Spec.new(@data) if v3?
|
@@ -40,25 +26,14 @@ module OasContrib
|
|
40
26
|
@spec.mapping
|
41
27
|
end
|
42
28
|
|
43
|
-
# Load a file
|
44
|
-
# @param [String] path input file path
|
45
|
-
# @return [Hash]
|
46
29
|
def input(path)
|
47
30
|
@data = _input(path)
|
48
31
|
end
|
49
32
|
|
50
|
-
# Output a file
|
51
|
-
# @param [Hash] hash data
|
52
|
-
# @param [String] path output file path
|
53
|
-
# @return [File]
|
54
33
|
def output(hash, path)
|
55
34
|
File.open(path, 'w') { |f| _output(hash, f) }
|
56
35
|
end
|
57
36
|
|
58
|
-
# Convert file type string to file extention string.
|
59
|
-
# @param [String] type file type string (yaml or json)
|
60
|
-
# @raise [ArgumentError] invalid file type string
|
61
|
-
# @return [String] file extension string (.yml or .json)
|
62
37
|
def str2ext(type)
|
63
38
|
case type
|
64
39
|
when 'yaml' then '.yml'
|
@@ -67,12 +42,21 @@ module OasContrib
|
|
67
42
|
end
|
68
43
|
end
|
69
44
|
|
45
|
+
def input_dir(dir)
|
46
|
+
path = dir + '/**/*' + @infile_ext
|
47
|
+
Dir.glob(path).sort.each_with_object({}, &input_lambda)
|
48
|
+
end
|
49
|
+
|
50
|
+
def input_lambda
|
51
|
+
lambda do |file, result|
|
52
|
+
hash = _input(file)
|
53
|
+
key = hash.keys[0]
|
54
|
+
result[key] = hash[key]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
70
58
|
private
|
71
59
|
|
72
|
-
# Load a file depending on file extension
|
73
|
-
# @param [String] path file path
|
74
|
-
# @raise [ArgumentError] invalid file type string
|
75
|
-
# @return [Hash]
|
76
60
|
def _input(path)
|
77
61
|
puts "Load: #{path}"
|
78
62
|
case @infile_ext
|
@@ -82,11 +66,6 @@ module OasContrib
|
|
82
66
|
end
|
83
67
|
end
|
84
68
|
|
85
|
-
# <Description>
|
86
|
-
# @param [Hash] hash data
|
87
|
-
# @param [File] file output file object
|
88
|
-
# @raise [ArgumentError] invalid file type string
|
89
|
-
# @return [IO]
|
90
69
|
def _output(hash, file)
|
91
70
|
puts "Dist: #{file.path}"
|
92
71
|
case @outfile_ext
|
@@ -1,14 +1,8 @@
|
|
1
1
|
require 'oas_contrib/resolver/base'
|
2
2
|
|
3
3
|
module OasContrib
|
4
|
-
# Command Resolvers
|
5
4
|
module Resolver
|
6
|
-
# Divide command resolver
|
7
5
|
class Divide < OasContrib::Resolver::Base
|
8
|
-
# Initialize
|
9
|
-
# @param [String] infile input file path
|
10
|
-
# @param [String] outdir output directory path
|
11
|
-
# @param [Array] options options
|
12
6
|
def initialize(infile, outdir, options)
|
13
7
|
@meta_dir = outdir + '/meta'
|
14
8
|
@path_dir = outdir + '/path'
|
@@ -17,31 +11,16 @@ module OasContrib
|
|
17
11
|
@outfile_type = options['out_type']
|
18
12
|
end
|
19
13
|
|
20
|
-
# Run
|
21
|
-
# @return [nil]
|
22
|
-
def run
|
23
|
-
setup
|
24
|
-
load
|
25
|
-
resolve
|
26
|
-
dist
|
27
|
-
end
|
28
|
-
|
29
|
-
# <Description>
|
30
|
-
# @return [<Type>] <description>
|
31
14
|
def setup
|
32
15
|
@infile_ext = File.extname(@infile)
|
33
16
|
@outfile_ext = str2ext(@outfile_type)
|
34
17
|
end
|
35
18
|
|
36
|
-
# Load the OAS file
|
37
|
-
# @return [Hash] loaded data
|
38
19
|
def load
|
39
20
|
input(@infile)
|
40
21
|
end
|
41
22
|
|
42
|
-
|
43
|
-
# @return [nil]
|
44
|
-
def dist
|
23
|
+
def distribute
|
45
24
|
output_dir(@spec.meta, @meta_dir)
|
46
25
|
output_dir(@spec.path, @path_dir)
|
47
26
|
output_dir(@spec.model, @model_dir)
|
@@ -49,10 +28,6 @@ module OasContrib
|
|
49
28
|
|
50
29
|
private
|
51
30
|
|
52
|
-
# Output directory and files
|
53
|
-
# @param [Hash] hash data
|
54
|
-
# @param [String] path directory path
|
55
|
-
# @return [nil]
|
56
31
|
def output_dir(hash, path)
|
57
32
|
puts "Dist: #{path}"
|
58
33
|
FileUtils.mkdir_p(path)
|
@@ -64,21 +39,12 @@ module OasContrib
|
|
64
39
|
nil
|
65
40
|
end
|
66
41
|
|
67
|
-
# <Description>
|
68
|
-
# @param [<Type>] dir <description>
|
69
|
-
# @param [<Type>] hash_key <description>
|
70
|
-
# @param [<Type>] num <description>
|
71
|
-
# @return [<Type>] <description>
|
72
42
|
def _output_dir_file_path_modify(dir, hash_key, num)
|
73
43
|
prefix = num.to_s.rjust(3, '0')
|
74
44
|
file_name = hash_key.tr('/', '_').gsub(/^_/, '')
|
75
45
|
dir + '/' + prefix + '_' + file_name + @outfile_ext
|
76
46
|
end
|
77
47
|
|
78
|
-
# <Description>
|
79
|
-
# @param [<Type>] hash <description>
|
80
|
-
# @param [<Type>] filter_key <description>
|
81
|
-
# @return [<Type>] <description>
|
82
48
|
def _output_dir_file_data_filter(hash, filter_key)
|
83
49
|
hash.select { |key, _| key == filter_key }
|
84
50
|
end
|
@@ -1,14 +1,8 @@
|
|
1
1
|
require 'oas_contrib/resolver/base'
|
2
2
|
|
3
3
|
module OasContrib
|
4
|
-
# Command Resolvers
|
5
4
|
module Resolver
|
6
|
-
# Merge command resolver
|
7
5
|
class Merge < OasContrib::Resolver::Base
|
8
|
-
# Initialize
|
9
|
-
# @param [String] indir input directory path
|
10
|
-
# @param [String] outfile output file path
|
11
|
-
# @param [Array] options options
|
12
6
|
def initialize(indir, outfile, options)
|
13
7
|
@meta_dir = indir + '/meta'
|
14
8
|
@path_dir = indir + '/path'
|
@@ -17,74 +11,21 @@ module OasContrib
|
|
17
11
|
@infile_type = options['in_type']
|
18
12
|
end
|
19
13
|
|
20
|
-
# Run
|
21
|
-
# @return [nil]
|
22
|
-
def run
|
23
|
-
setup
|
24
|
-
load
|
25
|
-
resolve
|
26
|
-
dist
|
27
|
-
end
|
28
|
-
|
29
|
-
# <Description>
|
30
|
-
# @return [<Type>] <description>
|
31
14
|
def setup
|
32
15
|
@infile_ext = str2ext(@infile_type)
|
33
16
|
@outfile_ext = File.extname(@outfile)
|
34
17
|
end
|
35
18
|
|
36
|
-
# Load divided files
|
37
|
-
# @return [Hash] load and merged data
|
38
19
|
def load
|
39
|
-
load_meta
|
40
|
-
resolve
|
41
|
-
load_path
|
42
|
-
load_model
|
43
|
-
end
|
44
|
-
|
45
|
-
# Output the OAS file
|
46
|
-
# @return [nil]
|
47
|
-
def dist
|
48
|
-
output(@data, @outfile)
|
49
|
-
end
|
50
|
-
|
51
|
-
private
|
52
|
-
|
53
|
-
# Load meta part files
|
54
|
-
# @return [Hash] loaded data
|
55
|
-
def load_meta
|
56
20
|
@data = input_dir(@meta_dir)
|
57
|
-
|
58
|
-
|
59
|
-
# Load path part files
|
60
|
-
# @return [Hash] load and merged data
|
61
|
-
def load_path
|
21
|
+
resolve
|
62
22
|
@data['paths'] = input_dir(@path_dir)
|
63
|
-
end
|
64
|
-
|
65
|
-
# Load model part files
|
66
|
-
# @return [Hash] load and merged data
|
67
|
-
def load_model
|
68
23
|
@data['definitions'] = input_dir(@model_dir) if v2?
|
69
24
|
@data['components'] = { 'schemas' => input_dir(@model_dir) } if v3?
|
70
25
|
end
|
71
26
|
|
72
|
-
|
73
|
-
|
74
|
-
# @return [Hash] merged input files data
|
75
|
-
def input_dir(dir)
|
76
|
-
path = dir + '/**/*' + @infile_ext
|
77
|
-
Dir.glob(path).sort.each_with_object({}, &input_lambda)
|
78
|
-
end
|
79
|
-
|
80
|
-
# Proc of input a yaml or json file
|
81
|
-
# @return [Proc]
|
82
|
-
def input_lambda
|
83
|
-
lambda do |file, result|
|
84
|
-
hash = _input(file)
|
85
|
-
key = hash.keys[0]
|
86
|
-
result[key] = hash[key]
|
87
|
-
end
|
27
|
+
def distribute
|
28
|
+
output(@data, @outfile)
|
88
29
|
end
|
89
30
|
end
|
90
31
|
end
|
@@ -1,41 +1,19 @@
|
|
1
1
|
require 'oas_contrib/resolver/base'
|
2
2
|
|
3
3
|
module OasContrib
|
4
|
-
# Command Resolvers
|
5
4
|
module Resolver
|
6
|
-
# Preview command resolver
|
7
5
|
class Preview < OasContrib::Resolver::Base
|
8
|
-
# Initialize
|
9
|
-
# @param [String] infile input file path
|
10
|
-
# @param [Integer] port listen port
|
11
6
|
def initialize(infile, options)
|
12
7
|
@infile = infile
|
13
|
-
@port
|
14
|
-
end
|
15
|
-
|
16
|
-
# Run
|
17
|
-
# @return [nil]
|
18
|
-
def run
|
19
|
-
setup
|
20
|
-
# load
|
21
|
-
# resolve
|
22
|
-
dist
|
8
|
+
@port = options['port']
|
23
9
|
end
|
24
10
|
|
25
11
|
def setup
|
26
12
|
@expand_path = File.expand_path(@infile)
|
27
|
-
@basename
|
28
|
-
end
|
29
|
-
|
30
|
-
# Load
|
31
|
-
# @return [nil]
|
32
|
-
def load
|
33
|
-
nil
|
13
|
+
@basename = File.basename(@expand_path)
|
34
14
|
end
|
35
15
|
|
36
|
-
|
37
|
-
# @return [nil]
|
38
|
-
def dist
|
16
|
+
def distribute
|
39
17
|
puts "SwaggerUI listen: http://localhost:#{@port} with: #{@expand_path}"
|
40
18
|
`docker run --rm --name oas_contrib_preview_swagger_ui \
|
41
19
|
-p #{@port}:8080 -e API_URL=#{@basename} \
|
data/lib/oas_contrib/version.rb
CHANGED
data/lib/oas_contrib.rb
CHANGED