minitest-openapi 0.0.1
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 +7 -0
- data/lib/minitest/doc.rb +13 -0
- data/lib/minitest/openapi/hooks.rb +45 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 842cf7448f6ccde919d1c6d51eccf576923fa47d7da657139b3956c09955fea3
|
4
|
+
data.tar.gz: b623ad83736c487b3f0aa51f83ecedc9dc153670c15ce855b9202dcefc87f19a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6c65f04a0d795172d7f1100a045ff6139b3bfa391bdf4dac4c64240b0d7cf72b61136555fb80a1cb76c47645866dce982021c557c6940a0457dd812e4b61f48c
|
7
|
+
data.tar.gz: d960a442315236435eb6121978468bd5670fb31d1a6f80ad72fa245294c45c1c78416a5e87003def8c2431d344415fc4368c3d6ba940ef84b3f192dd14f62190
|
data/lib/minitest/doc.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'minitest'
|
4
|
+
|
5
|
+
module Minitest
|
6
|
+
module OpenAPI
|
7
|
+
module RunPatch
|
8
|
+
def run(*args)
|
9
|
+
result = super
|
10
|
+
if ENV['OPENAPI'] && self.class.openapi?
|
11
|
+
# This will run before specs
|
12
|
+
end
|
13
|
+
result
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
module ActivateOpenApiClassMethods
|
18
|
+
def self.prepended(base)
|
19
|
+
base.extend(ClassMethods)
|
20
|
+
end
|
21
|
+
|
22
|
+
module ClassMethods
|
23
|
+
def openapi?
|
24
|
+
@openapi
|
25
|
+
end
|
26
|
+
|
27
|
+
def openapi!
|
28
|
+
@openapi = true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
Minitest::Test.prepend Minitest::OpenAPI::ActivateOpenApiClassMethods
|
36
|
+
|
37
|
+
if ENV['OPENAPI']
|
38
|
+
Minitest::Test.prepend Minitest::OpenAPI::RunPatch
|
39
|
+
Minitest.after_run do
|
40
|
+
puts "============================="
|
41
|
+
puts "Building Docs 🎉"
|
42
|
+
puts "============================="
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: minitest-openapi
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Austin Wasson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-01-01 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: API documentation generator based on the OpenAPI spec.
|
14
|
+
email: austinpwasson@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/minitest/doc.rb
|
20
|
+
- lib/minitest/openapi/hooks.rb
|
21
|
+
homepage:
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.1'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubygems_version: 3.3.26
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: API documentation generator based on the OpenAPI spec.
|
44
|
+
test_files: []
|