Class: OasContrib::Command
- Inherits:
-
Thor
- Object
- Thor
- OasContrib::Command
- Includes:
- Thor::Actions
- Defined in:
- lib/oas_contrib/command.rb
Overview
Command class
Instance Method Summary collapse
-
#divide(spec_file, outdir) ⇒ Integer
Divide the spec file command.
-
#merge(indir, spec_file) ⇒ Integer
Merge divided files to spec file command.
-
#preview(spec_file) ⇒ Integer
Preview the spec file with Swagger UI.
Instance Method Details
#divide(spec_file, outdir) ⇒ Integer
Divide the spec file command
18 19 20 21 22 23 24 25 26 |
# File 'lib/oas_contrib/command.rb', line 18 def divide(spec_file, outdir) resolver = OasContrib::Resolver::Divide.new(spec_file, outdir, ) resolver.setup resolver.load resolver.resolve resolver.distribute say 'complete!', :green exit(0) end |
#merge(indir, spec_file) ⇒ Integer
Merge divided files to spec file command
35 36 37 38 39 40 41 42 43 |
# File 'lib/oas_contrib/command.rb', line 35 def merge(indir, spec_file) resolver = OasContrib::Resolver::Merge.new(indir, spec_file, ) resolver.setup resolver.load resolver.resolve resolver.distribute say 'complete!', :green exit(0) end |
#preview(spec_file) ⇒ Integer
Preview the spec file with Swagger UI
51 52 53 54 55 56 57 |
# File 'lib/oas_contrib/command.rb', line 51 def preview(spec_file) resolver = OasContrib::Resolver::Preview.new(spec_file, ) resolver.setup resolver.distribute say 'complete!', :green exit(0) end |